From owner-svn-src-user@FreeBSD.ORG Sun Dec 7 00:41:41 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 771191065672; Sun, 7 Dec 2008 00:41:41 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 662BD8FC16; Sun, 7 Dec 2008 00:41:41 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB70ff4h009447; Sun, 7 Dec 2008 00:41:41 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB70ff82009445; Sun, 7 Dec 2008 00:41:41 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812070041.mB70ff82009445@svn.freebsd.org> From: Kip Macy Date: Sun, 7 Dec 2008 00:41:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185726 - user/kmacy/HEAD_fast_multi_xmit/sys/net X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Dec 2008 00:41:41 -0000 Author: kmacy Date: Sun Dec 7 00:41:40 2008 New Revision: 185726 URL: http://svn.freebsd.org/changeset/base/185726 Log: - fix need for conditional runlock - style changes - add comment Modified: user/kmacy/HEAD_fast_multi_xmit/sys/net/radix.h user/kmacy/HEAD_fast_multi_xmit/sys/net/route.c Modified: user/kmacy/HEAD_fast_multi_xmit/sys/net/radix.h ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/net/radix.h Sat Dec 6 23:55:29 2008 (r185725) +++ user/kmacy/HEAD_fast_multi_xmit/sys/net/radix.h Sun Dec 7 00:41:40 2008 (r185726) @@ -157,6 +157,7 @@ struct radix_node_head { #define RADIX_NODE_HEAD_DESTROY(rnh) rw_destroy(&(rnh)->rnh_lock) #define RADIX_NODE_HEAD_LOCK_ASSERT(rnh) rw_assert(&(rnh)->rnh_lock, RA_LOCKED) +#define RADIX_NODE_HEAD_WLOCK_ASSERT(rnh) rw_assert(&(rnh)->rnh_lock, RA_WLOCKED) #endif /* _KERNEL */ void rn_init(void); Modified: user/kmacy/HEAD_fast_multi_xmit/sys/net/route.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/net/route.c Sat Dec 6 23:55:29 2008 (r185725) +++ user/kmacy/HEAD_fast_multi_xmit/sys/net/route.c Sun Dec 7 00:41:40 2008 (r185726) @@ -289,6 +289,10 @@ rtalloc1_fib(struct sockaddr *dst, int r retry: if (needlock) RADIX_NODE_HEAD_RLOCK(rnh); +#ifdef INVARIANTS + else + RADIX_NODE_HEAD_LOCK_ASSERT(rnh); +#endif rn = rnh->rnh_matchaddr(dst, rnh); if (rn && ((rn->rn_flags & RNF_ROOT) == 0)) { @@ -313,26 +317,25 @@ retry: } else { RT_LOCK(newrt); RT_ADDREF(newrt); - RADIX_NODE_HEAD_RUNLOCK(rnh); + if (needlock) + RADIX_NODE_HEAD_RUNLOCK(rnh); goto done; } } - + /* + * if needresolve is set then we have the exclusive lock + * and we need to keep it held for the benefit of rtrequest_fib + */ if (!needresolve && needlock) RADIX_NODE_HEAD_RUNLOCK(rnh); - if (needresolve) { - + RADIX_NODE_HEAD_WLOCK_ASSERT(rnh); /* - * If we find it and it's not the root node, then - * get a reference on the rtentry associated. + * We are apparently adding (report = 0 in delete). + * If it requires that it be cloned, do so. + * (This implies it wasn't a HOST route.) */ - /* - * We are apparently adding (report = 0 in delete). - * If it requires that it be cloned, do so. - * (This implies it wasn't a HOST route.) - */ err = rtrequest_fib(RTM_RESOLVE, dst, NULL, NULL, RTF_RNH_LOCKED, &newrt, fibnum); if (err) { @@ -560,16 +563,16 @@ rtredirect_fib(struct sockaddr *dst, info.rti_info[RTAX_NETMASK] = netmask; info.rti_ifa = ifa; info.rti_flags = flags; - if (rt0) + if (rt0 != NULL) RT_UNLOCK(rt0); /* drop lock to avoid LOR with RNH */ error = rtrequest1_fib(RTM_ADD, &info, &rt, fibnum); - if (rt) { + if (rt != NULL) { RT_LOCK(rt); - if (rt0) + if (rt0 != NULL) EVENTHANDLER_INVOKE(route_redirect_event, rt0, rt, dst); flags = rt->rt_flags; } - if (rt0) + if (rt0 != NULL) RTFREE(rt0); stat = &V_rtstat.rts_dynamic; From owner-svn-src-user@FreeBSD.ORG Sun Dec 7 05:26:06 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42287106564A; Sun, 7 Dec 2008 05:26:06 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 18FDD8FC08; Sun, 7 Dec 2008 05:26:06 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB75Q6Vj015107; Sun, 7 Dec 2008 05:26:06 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB75Q5HL015106; Sun, 7 Dec 2008 05:26:05 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200812070526.mB75Q5HL015106@svn.freebsd.org> From: Andrew Thompson Date: Sun, 7 Dec 2008 05:26:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185730 - user/thompsa X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Dec 2008 05:26:06 -0000 Author: thompsa Date: Sun Dec 7 05:26:05 2008 New Revision: 185730 URL: http://svn.freebsd.org/changeset/base/185730 Log: Add my user dir. Added: user/thompsa/ From owner-svn-src-user@FreeBSD.ORG Sun Dec 7 05:27:33 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52D8D1065670; Sun, 7 Dec 2008 05:27:33 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 29BD88FC17; Sun, 7 Dec 2008 05:27:33 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB75RXFg015166; Sun, 7 Dec 2008 05:27:33 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB75RXNq015165; Sun, 7 Dec 2008 05:27:33 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200812070527.mB75RXNq015165@svn.freebsd.org> From: Andrew Thompson Date: Sun, 7 Dec 2008 05:27:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185731 - user/thompsa/vaptq X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Dec 2008 05:27:33 -0000 Author: thompsa Date: Sun Dec 7 05:27:32 2008 New Revision: 185731 URL: http://svn.freebsd.org/changeset/base/185731 Log: Branch for taskq additions to net80211. Added: user/thompsa/vaptq/ - copied from r185730, head/ From owner-svn-src-user@FreeBSD.ORG Sun Dec 7 05:46:18 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D54F1065672; Sun, 7 Dec 2008 05:46:18 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1CDBA8FC12; Sun, 7 Dec 2008 05:46:18 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB75kIOJ015583; Sun, 7 Dec 2008 05:46:18 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB75kItP015582; Sun, 7 Dec 2008 05:46:18 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812070546.mB75kItP015582@svn.freebsd.org> From: Kip Macy Date: Sun, 7 Dec 2008 05:46:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185732 - user/kmacy/HEAD_fast_multi_xmit/sys/net X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Dec 2008 05:46:18 -0000 Author: kmacy Date: Sun Dec 7 05:46:17 2008 New Revision: 185732 URL: http://svn.freebsd.org/changeset/base/185732 Log: don't leak buf ring in to user namespace Modified: user/kmacy/HEAD_fast_multi_xmit/sys/net/if_var.h Modified: user/kmacy/HEAD_fast_multi_xmit/sys/net/if_var.h ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/net/if_var.h Sun Dec 7 05:27:32 2008 (r185731) +++ user/kmacy/HEAD_fast_multi_xmit/sys/net/if_var.h Sun Dec 7 05:46:17 2008 (r185732) @@ -77,12 +77,12 @@ struct ifvlantrunk; #ifdef _KERNEL #include #include +#include #endif /* _KERNEL */ #include /* XXX */ #include /* XXX */ #include /* XXX */ #include -#include #define IF_DUNIT_NONE -1 @@ -542,6 +542,7 @@ do { \ } while (0) +#ifdef _KERNEL static __inline int drbr_enqueue(struct buf_ring *br, struct mbuf *m) { @@ -565,9 +566,7 @@ drbr_free(struct buf_ring *br, struct ma buf_ring_free(br, type); } - - - +#endif /* * 72 was chosen below because it is the size of a TCP/IP From owner-svn-src-user@FreeBSD.ORG Sun Dec 7 05:49:23 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2ED3106564A; Sun, 7 Dec 2008 05:49:23 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF9AA8FC08; Sun, 7 Dec 2008 05:49:23 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB75nNSa015690; Sun, 7 Dec 2008 05:49:23 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB75nN6i015674; Sun, 7 Dec 2008 05:49:23 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200812070549.mB75nN6i015674@svn.freebsd.org> From: Andrew Thompson Date: Sun, 7 Dec 2008 05:49:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185733 - in user/thompsa/vaptq/sys: dev/if_ndis dev/ipw dev/iwi dev/iwn dev/usb dev/usb2/wlan dev/wi dev/wpi net80211 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Dec 2008 05:49:23 -0000 Author: thompsa Date: Sun Dec 7 05:49:22 2008 New Revision: 185733 URL: http://svn.freebsd.org/changeset/base/185733 Log: Commit WIP to move net80211 state changes and scanning to threads in order to simplify drivers. Once complete drivers will be able to sleep during callbacks and not need private taskqueues at all. Modified: user/thompsa/vaptq/sys/dev/if_ndis/if_ndis.c user/thompsa/vaptq/sys/dev/if_ndis/if_ndisvar.h user/thompsa/vaptq/sys/dev/ipw/if_ipw.c user/thompsa/vaptq/sys/dev/ipw/if_ipwvar.h user/thompsa/vaptq/sys/dev/iwi/if_iwi.c user/thompsa/vaptq/sys/dev/iwi/if_iwivar.h user/thompsa/vaptq/sys/dev/iwn/if_iwn.c user/thompsa/vaptq/sys/dev/iwn/if_iwnvar.h user/thompsa/vaptq/sys/dev/usb/if_rum.c user/thompsa/vaptq/sys/dev/usb/if_rumvar.h user/thompsa/vaptq/sys/dev/usb/if_upgt.c user/thompsa/vaptq/sys/dev/usb/if_upgtvar.h user/thompsa/vaptq/sys/dev/usb/if_ural.c user/thompsa/vaptq/sys/dev/usb/if_uralvar.h user/thompsa/vaptq/sys/dev/usb/if_zyd.c user/thompsa/vaptq/sys/dev/usb/if_zydreg.h user/thompsa/vaptq/sys/dev/usb2/wlan/if_rum2.c user/thompsa/vaptq/sys/dev/usb2/wlan/if_ural2.c user/thompsa/vaptq/sys/dev/usb2/wlan/if_zyd2.c user/thompsa/vaptq/sys/dev/wi/if_wi.c user/thompsa/vaptq/sys/dev/wi/if_wivar.h user/thompsa/vaptq/sys/dev/wpi/if_wpi.c user/thompsa/vaptq/sys/dev/wpi/if_wpivar.h user/thompsa/vaptq/sys/net80211/ieee80211.c user/thompsa/vaptq/sys/net80211/ieee80211_proto.c user/thompsa/vaptq/sys/net80211/ieee80211_var.h Modified: user/thompsa/vaptq/sys/dev/if_ndis/if_ndis.c ============================================================================== --- user/thompsa/vaptq/sys/dev/if_ndis/if_ndis.c Sun Dec 7 05:46:17 2008 (r185732) +++ user/thompsa/vaptq/sys/dev/if_ndis/if_ndis.c Sun Dec 7 05:49:22 2008 (r185733) @@ -165,8 +165,6 @@ static void ndis_init (void *); static void ndis_stop (struct ndis_softc *); static int ndis_ifmedia_upd (struct ifnet *); static void ndis_ifmedia_sts (struct ifnet *, struct ifmediareq *); -static void ndis_auth (void *, int); -static void ndis_assoc (void *, int); static int ndis_get_assoc (struct ndis_softc *, ndis_wlan_bssid_ex **); static int ndis_probe_offload (struct ndis_softc *); static int ndis_set_offload (struct ndis_softc *); @@ -719,8 +717,6 @@ ndis_attach(dev) taskqueue_start_threads(&sc->ndis_tq, 1, PI_NET, "%s taskq", device_get_nameunit(dev)); TASK_INIT(&sc->ndis_scantask, 0, ndis_scan, sc); - TASK_INIT(&sc->ndis_authtask, 0, ndis_auth, sc); - TASK_INIT(&sc->ndis_assoctask, 0, ndis_assoc, sc); ifp->if_ioctl = ndis_ioctl_80211; ic->ic_ifp = ifp; @@ -1017,8 +1013,6 @@ ndis_detach(dev) if (sc->ndis_80211) { taskqueue_drain(sc->ndis_tq, &sc->ndis_scantask); - taskqueue_drain(sc->ndis_tq, &sc->ndis_authtask); - taskqueue_drain(sc->ndis_tq, &sc->ndis_assoctask); } if (sc->ndis_tickitem != NULL) @@ -2361,30 +2355,6 @@ ndis_setstate_80211(sc) } static void -ndis_auth(void *arg, int npending) -{ - struct ndis_softc *sc = arg; - struct ifnet *ifp = sc->ifp; - struct ieee80211com *ic = ifp->if_l2com; - struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); - - vap->iv_state = IEEE80211_S_AUTH; - ndis_auth_and_assoc(sc, vap); -} - -static void -ndis_assoc(void *arg, int npending) -{ - struct ndis_softc *sc = arg; - struct ifnet *ifp = sc->ifp; - struct ieee80211com *ic = ifp->if_l2com; - struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); - - vap->iv_state = IEEE80211_S_ASSOC; - ndis_auth_and_assoc(sc, vap); -} - -static void ndis_auth_and_assoc(sc, vap) struct ndis_softc *sc; struct ieee80211vap *vap; @@ -2598,9 +2568,6 @@ ndis_auth_and_assoc(sc, vap) if (rval) device_printf (sc->ndis_dev, "set ssid failed: %d\n", rval); - if (vap->iv_state == IEEE80211_S_AUTH) - ieee80211_new_state(vap, IEEE80211_S_ASSOC, 0); - return; } @@ -3228,13 +3195,18 @@ ndis_newstate(struct ieee80211vap *vap, return nvp->newstate(vap, nstate, arg); case IEEE80211_S_ASSOC: if (ostate != IEEE80211_S_AUTH) { - taskqueue_enqueue(sc->ndis_tq, &sc->ndis_assoctask); - return EINPROGRESS; + IEEE80211_UNLOCK(ic); + ndis_auth_and_assoc(sc, vap); + IEEE80211_LOCK(ic); } break; case IEEE80211_S_AUTH: - taskqueue_enqueue(sc->ndis_tq, &sc->ndis_authtask); - return EINPROGRESS; + IEEE80211_UNLOCK(ic); + ndis_auth_and_assoc(sc, vap); + if (vap->iv_state == IEEE80211_S_AUTH) /* XXX */ + ieee80211_new_state(vap, IEEE80211_S_ASSOC, 0); + IEEE80211_LOCK(ic); + break; default: break; } Modified: user/thompsa/vaptq/sys/dev/if_ndis/if_ndisvar.h ============================================================================== --- user/thompsa/vaptq/sys/dev/if_ndis/if_ndisvar.h Sun Dec 7 05:46:17 2008 (r185732) +++ user/thompsa/vaptq/sys/dev/if_ndis/if_ndisvar.h Sun Dec 7 05:49:22 2008 (r185733) @@ -177,8 +177,6 @@ struct ndis_softc { struct taskqueue *ndis_tq; /* private task queue */ struct task ndis_scantask; - struct task ndis_authtask; - struct task ndis_assoctask; int (*ndis_newstate)(struct ieee80211com *, enum ieee80211_state, int); int ndis_tx_timer; Modified: user/thompsa/vaptq/sys/dev/ipw/if_ipw.c ============================================================================== --- user/thompsa/vaptq/sys/dev/ipw/if_ipw.c Sun Dec 7 05:46:17 2008 (r185732) +++ user/thompsa/vaptq/sys/dev/ipw/if_ipw.c Sun Dec 7 05:49:22 2008 (r185733) @@ -147,8 +147,8 @@ static int ipw_reset(struct ipw_softc *) static int ipw_load_ucode(struct ipw_softc *, const char *, int); static int ipw_load_firmware(struct ipw_softc *, const char *, int); static int ipw_config(struct ipw_softc *); -static void ipw_assoc_task(void *, int); -static void ipw_disassoc_task(void *, int); +static void ipw_assoc(struct ieee80211com *, struct ieee80211vap *); +static void ipw_disassoc(struct ieee80211com *, struct ieee80211vap *); static void ipw_init_task(void *, int); static void ipw_init(void *); static void ipw_init_locked(struct ipw_softc *); @@ -511,8 +511,6 @@ ipw_vap_create(struct ieee80211com *ic, return NULL; vap = &ivp->vap; - TASK_INIT(&ivp->assoc_task, 0, ipw_assoc_task, vap); - TASK_INIT(&ivp->disassoc_task, 0, ipw_disassoc_task, vap); TASK_INIT(&ivp->assoc_success_task, 0, ipw_assocsuccess, vap); TASK_INIT(&ivp->assoc_failed_task, 0, ipw_assocfailed, vap); TASK_INIT(&ivp->scandone_task, 0, ipw_scandone, vap); @@ -894,11 +892,15 @@ ipw_newstate(struct ieee80211vap *vap, e struct ieee80211com *ic = vap->iv_ic; struct ifnet *ifp = ic->ic_ifp; struct ipw_softc *sc = ifp->if_softc; + enum ieee80211_state ostate; DPRINTF(("%s: %s -> %s flags 0x%x\n", __func__, ieee80211_state_name[vap->iv_state], ieee80211_state_name[nstate], sc->flags)); + ostate = vap->iv_state; + IEEE80211_UNLOCK(ic); + switch (nstate) { case IEEE80211_S_RUN: if (ic->ic_opmode == IEEE80211_M_IBSS) { @@ -910,39 +912,33 @@ ipw_newstate(struct ieee80211vap *vap, e * AUTH -> RUN transition and we want to do nothing. * This is all totally bogus and needs to be redone. */ - if (vap->iv_state == IEEE80211_S_SCAN) { - taskqueue_enqueue(taskqueue_swi, - &IPW_VAP(vap)->assoc_task); - return EINPROGRESS; - } + if (ostate == IEEE80211_S_SCAN) + ipw_assoc(ic, vap); } break; case IEEE80211_S_INIT: if (sc->flags & IPW_FLAG_ASSOCIATED) - taskqueue_enqueue(taskqueue_swi, - &IPW_VAP(vap)->disassoc_task); + ipw_disassoc(ic, vap); break; case IEEE80211_S_AUTH: - taskqueue_enqueue(taskqueue_swi, &IPW_VAP(vap)->assoc_task); - return EINPROGRESS; + ipw_assoc(ic, vap); + break; case IEEE80211_S_ASSOC: /* * If we are not transitioning from AUTH the resend the * association request. */ - if (vap->iv_state != IEEE80211_S_AUTH) { - taskqueue_enqueue(taskqueue_swi, - &IPW_VAP(vap)->assoc_task); - return EINPROGRESS; - } + if (ostate != IEEE80211_S_AUTH) + ipw_assoc(ic, vap); break; default: break; } + IEEE80211_LOCK(ic); return ivp->newstate(vap, nstate, arg); } @@ -2263,11 +2259,9 @@ ipw_setchannel(struct ipw_softc *sc, str } static void -ipw_assoc_task(void *context, int pending) +ipw_assoc(struct ieee80211com *ic, struct ieee80211vap *vap) { - struct ieee80211vap *vap = context; struct ifnet *ifp = vap->iv_ic->ic_ifp; - struct ieee80211com *ic = ifp->if_l2com; struct ipw_softc *sc = ifp->if_softc; struct ieee80211_node *ni = vap->iv_bss; struct ipw_security security; @@ -2358,9 +2352,8 @@ done: } static void -ipw_disassoc_task(void *context, int pending) +ipw_disassoc(struct ieee80211com *ic, struct ieee80211vap *vap) { - struct ieee80211vap *vap = context; struct ifnet *ifp = vap->iv_ic->ic_ifp; struct ieee80211_node *ni = vap->iv_bss; struct ipw_softc *sc = ifp->if_softc; Modified: user/thompsa/vaptq/sys/dev/ipw/if_ipwvar.h ============================================================================== --- user/thompsa/vaptq/sys/dev/ipw/if_ipwvar.h Sun Dec 7 05:46:17 2008 (r185732) +++ user/thompsa/vaptq/sys/dev/ipw/if_ipwvar.h Sun Dec 7 05:49:22 2008 (r185733) @@ -78,8 +78,6 @@ struct ipw_tx_radiotap_header { struct ipw_vap { struct ieee80211vap vap; - struct task assoc_task; - struct task disassoc_task; struct task assoc_success_task; struct task assoc_failed_task; struct task scandone_task; Modified: user/thompsa/vaptq/sys/dev/iwi/if_iwi.c ============================================================================== --- user/thompsa/vaptq/sys/dev/iwi/if_iwi.c Sun Dec 7 05:46:17 2008 (r185732) +++ user/thompsa/vaptq/sys/dev/iwi/if_iwi.c Sun Dec 7 05:49:22 2008 (r185733) @@ -986,21 +986,21 @@ iwi_newstate(struct ieee80211vap *vap, e ieee80211_state_name[vap->iv_state], ieee80211_state_name[nstate], sc->flags)); + IEEE80211_UNLOCK(ic); + IWI_LOCK(sc); switch (nstate) { case IEEE80211_S_INIT: - IWI_LOCK(sc); /* * NB: don't try to do this if iwi_stop_master has * shutdown the firmware and disabled interrupts. */ if (vap->iv_state == IEEE80211_S_RUN && (sc->flags & IWI_FLAG_FW_INITED)) - iwi_queue_cmd(sc, IWI_DISASSOC, 1); - IWI_UNLOCK(sc); + iwi_disassociate(sc, 0); break; case IEEE80211_S_AUTH: - iwi_queue_cmd(sc, IWI_AUTH, arg); - return EINPROGRESS; + iwi_auth_and_assoc(sc, vap); + break; case IEEE80211_S_RUN: if (vap->iv_opmode == IEEE80211_M_IBSS && vap->iv_state == IEEE80211_S_SCAN) { @@ -1012,8 +1012,7 @@ iwi_newstate(struct ieee80211vap *vap, e * AUTH -> RUN transition and we want to do nothing. * This is all totally bogus and needs to be redone. */ - iwi_queue_cmd(sc, IWI_ASSOC, 0); - return EINPROGRESS; + iwi_auth_and_assoc(sc, vap); } break; case IEEE80211_S_ASSOC: @@ -1024,11 +1023,13 @@ iwi_newstate(struct ieee80211vap *vap, e */ if (vap->iv_state == IEEE80211_S_AUTH) break; - iwi_queue_cmd(sc, IWI_ASSOC, arg); - return EINPROGRESS; + iwi_auth_and_assoc(sc, vap); + break; default: break; } + IWI_UNLOCK(sc); + IEEE80211_LOCK(ic); return ivp->iwi_newstate(vap, nstate, arg); } @@ -3546,8 +3547,6 @@ iwi_ops(void *arg0, int npending) [IWI_CMD_FREE] = "FREE", [IWI_SCAN_START] = "SCAN_START", [IWI_SET_CHANNEL] = "SET_CHANNEL", - [IWI_AUTH] = "AUTH", - [IWI_ASSOC] = "ASSOC", [IWI_DISASSOC] = "DISASSOC", [IWI_SCAN_CURCHAN] = "SCAN_CURCHAN", [IWI_SCAN_ALLCHAN] = "SCAN_ALLCHAN", @@ -3586,15 +3585,6 @@ again: DPRINTF(("%s: %s arg %lu\n", __func__, opnames[cmd], arg)); switch (cmd) { - case IWI_AUTH: - case IWI_ASSOC: - if (cmd == IWI_AUTH) - vap->iv_state = IEEE80211_S_AUTH; - else - vap->iv_state = IEEE80211_S_ASSOC; - iwi_auth_and_assoc(sc, vap); - /* NB: completion done in iwi_notification_intr */ - break; case IWI_DISASSOC: iwi_disassociate(sc, 0); break; Modified: user/thompsa/vaptq/sys/dev/iwi/if_iwivar.h ============================================================================== --- user/thompsa/vaptq/sys/dev/iwi/if_iwivar.h Sun Dec 7 05:46:17 2008 (r185732) +++ user/thompsa/vaptq/sys/dev/iwi/if_iwivar.h Sun Dec 7 05:49:22 2008 (r185733) @@ -227,12 +227,10 @@ struct iwi_softc { #define IWI_CMD_FREE 0 /* for marking slots unused */ #define IWI_SCAN_START 1 #define IWI_SET_CHANNEL 2 -#define IWI_AUTH 3 -#define IWI_ASSOC 4 -#define IWI_DISASSOC 5 -#define IWI_SCAN_CURCHAN 6 -#define IWI_SCAN_ALLCHAN 7 -#define IWI_SET_WME 8 +#define IWI_DISASSOC 3 +#define IWI_SCAN_CURCHAN 4 +#define IWI_SCAN_ALLCHAN 5 +#define IWI_SET_WME 6 struct iwi_rx_radiotap_header sc_rxtap; int sc_rxtap_len; Modified: user/thompsa/vaptq/sys/dev/iwn/if_iwn.c ============================================================================== --- user/thompsa/vaptq/sys/dev/iwn/if_iwn.c Sun Dec 7 05:46:17 2008 (r185732) +++ user/thompsa/vaptq/sys/dev/iwn/if_iwn.c Sun Dec 7 05:49:22 2008 (r185733) @@ -165,8 +165,8 @@ void iwn_compute_differential_gain(stru void iwn_tune_sensitivity(struct iwn_softc *, const struct iwn_rx_stats *); int iwn_send_sensitivity(struct iwn_softc *); -int iwn_auth(struct iwn_softc *); -int iwn_run(struct iwn_softc *); +int iwn_auth(struct iwn_softc *, struct ieee80211vap *); +int iwn_run(struct iwn_softc *, struct ieee80211vap *); int iwn_scan(struct iwn_softc *); int iwn_config(struct iwn_softc *); void iwn_post_alive(struct iwn_softc *); @@ -981,20 +981,13 @@ iwn_newstate(struct ieee80211vap *vap, e ieee80211_state_name[vap->iv_state], ieee80211_state_name[nstate]); + IEEE80211_UNLOCK(ic); IWN_LOCK(sc); callout_stop(&sc->sc_timer_to); - IWN_UNLOCK(sc); - /* - * Some state transitions require issuing a configure request - * to the adapter. This must be done in a blocking context - * so we toss control to the task q thread where the state - * change will be finished after the command completes. - */ if (nstate == IEEE80211_S_AUTH && vap->iv_state != IEEE80211_S_AUTH) { /* !AUTH -> AUTH requires adapter config */ - error = iwn_queue_cmd(sc, IWN_AUTH, arg, IWN_QUEUE_NORMAL); - return (error != 0 ? error : EINPROGRESS); + error = iwn_auth(sc, vap); } if (nstate == IEEE80211_S_RUN && vap->iv_state != IEEE80211_S_RUN) { /* @@ -1002,8 +995,7 @@ iwn_newstate(struct ieee80211vap *vap, e * which is done with a firmware cmd. We also defer * starting the timers until that work is done. */ - error = iwn_queue_cmd(sc, IWN_RUN, arg, IWN_QUEUE_NORMAL); - return (error != 0 ? error : EINPROGRESS); + error = iwn_run(sc, vap); } if (nstate == IEEE80211_S_RUN) { /* @@ -1011,6 +1003,8 @@ iwn_newstate(struct ieee80211vap *vap, e */ iwn_calib_reset(sc); } + IWN_UNLOCK(sc); + IEEE80211_LOCK(ic); return ivp->iv_newstate(vap, nstate, arg); } @@ -3456,11 +3450,10 @@ iwn_send_sensitivity(struct iwn_softc *s } int -iwn_auth(struct iwn_softc *sc) +iwn_auth(struct iwn_softc *sc, struct ieee80211vap *vap) { struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; - struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); /*XXX*/ struct ieee80211_node *ni = vap->iv_bss; struct iwn_node_info node; int error; @@ -3549,12 +3542,11 @@ iwn_auth(struct iwn_softc *sc) * Configure the adapter for associated state. */ int -iwn_run(struct iwn_softc *sc) +iwn_run(struct iwn_softc *sc, struct ieee80211vap *vap) { #define MS(v,x) (((v) & x) >> x##_S) struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; - struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); /*XXX*/ struct ieee80211_node *ni = vap->iv_bss; struct iwn_node_info node; int error, maxrxampdu, ampdudensity; @@ -4386,7 +4378,6 @@ iwn_ops(void *arg0, int pending) struct ieee80211com *ic = ifp->if_l2com; struct ieee80211vap *vap; int cmd, arg, error; - enum ieee80211_state nstate; for (;;) { IWN_CMD_LOCK(sc); @@ -4442,30 +4433,6 @@ iwn_ops(void *arg0, int pending) return; } break; - case IWN_AUTH: - case IWN_RUN: - if (cmd == IWN_AUTH) { - error = iwn_auth(sc); - nstate = IEEE80211_S_AUTH; - } else { - error = iwn_run(sc); - nstate = IEEE80211_S_RUN; - } - if (error == 0) { - IWN_UNLOCK(sc); - IEEE80211_LOCK(ic); - IWN_VAP(vap)->iv_newstate(vap, nstate, arg); - if (vap->iv_newstate_cb != NULL) - vap->iv_newstate_cb(vap, nstate, arg); - IEEE80211_UNLOCK(ic); - IWN_LOCK(sc); - } else { - device_printf(sc->sc_dev, - "%s: %s state change failed, error %d\n", - __func__, ieee80211_state_name[nstate], - error); - } - break; case IWN_REINIT: IWN_UNLOCK(sc); iwn_init(sc); @@ -4559,9 +4526,7 @@ iwn_ops_str(int cmd) case IWN_SCAN_CURCHAN: return "SCAN_CURCHAN"; case IWN_SCAN_STOP: return "SCAN_STOP"; case IWN_SET_CHAN: return "SET_CHAN"; - case IWN_AUTH: return "AUTH"; case IWN_SCAN_NEXT: return "SCAN_NEXT"; - case IWN_RUN: return "RUN"; case IWN_RADIO_ENABLE: return "RADIO_ENABLE"; case IWN_RADIO_DISABLE: return "RADIO_DISABLE"; case IWN_REINIT: return "REINIT"; Modified: user/thompsa/vaptq/sys/dev/iwn/if_iwnvar.h ============================================================================== --- user/thompsa/vaptq/sys/dev/iwn/if_iwnvar.h Sun Dec 7 05:46:17 2008 (r185732) +++ user/thompsa/vaptq/sys/dev/iwn/if_iwnvar.h Sun Dec 7 05:49:22 2008 (r185733) @@ -185,12 +185,10 @@ struct iwn_softc { #define IWN_SCAN_CURCHAN (1<<1) #define IWN_SCAN_STOP (1<<2) #define IWN_SET_CHAN (1<<3) -#define IWN_AUTH (1<<4) -#define IWN_SCAN_NEXT (1<<5) -#define IWN_RUN (1<<6) -#define IWN_RADIO_ENABLE (1<<7) -#define IWN_RADIO_DISABLE (1<<8) -#define IWN_REINIT (1<<9) +#define IWN_SCAN_NEXT (1<<4) +#define IWN_RADIO_ENABLE (1<<5) +#define IWN_RADIO_DISABLE (1<<6) +#define IWN_REINIT (1<<7) #define IWN_CMD_MAXOPS 10 /* command queuing request type */ #define IWN_QUEUE_NORMAL 0 Modified: user/thompsa/vaptq/sys/dev/usb/if_rum.c ============================================================================== --- user/thompsa/vaptq/sys/dev/usb/if_rum.c Sun Dec 7 05:46:17 2008 (r185732) +++ user/thompsa/vaptq/sys/dev/usb/if_rum.c Sun Dec 7 05:49:22 2008 (r185733) @@ -140,7 +140,6 @@ static int rum_alloc_tx_list(struct rum static void rum_free_tx_list(struct rum_softc *); static int rum_alloc_rx_list(struct rum_softc *); static void rum_free_rx_list(struct rum_softc *); -static void rum_task(void *); static void rum_scantask(void *); static int rum_newstate(struct ieee80211vap *, enum ieee80211_state, int); @@ -448,7 +447,6 @@ rum_attach(device_t self) mtx_init(&sc->sc_mtx, device_get_nameunit(sc->sc_dev), MTX_NETWORK_LOCK, MTX_DEF | MTX_RECURSE); - usb_init_task(&sc->sc_task, rum_task, sc); usb_init_task(&sc->sc_scantask, rum_scantask, sc); callout_init(&sc->watchdog_ch, 0); @@ -556,7 +554,6 @@ rum_detach(device_t self) bpfdetach(ifp); ieee80211_ifdetach(ic); - usb_rem_task(sc->sc_udev, &sc->sc_task); usb_rem_task(sc->sc_udev, &sc->sc_scantask); callout_stop(&sc->watchdog_ch); @@ -751,24 +748,24 @@ rum_free_rx_list(struct rum_softc *sc) } } -static void -rum_task(void *arg) +static int +rum_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { - struct rum_softc *sc = arg; - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; - struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); struct rum_vap *rvp = RUM_VAP(vap); + struct ieee80211com *ic = vap->iv_ic; + struct rum_softc *sc = ic->ic_ifp->if_softc; const struct ieee80211_txparam *tp; enum ieee80211_state ostate; struct ieee80211_node *ni; uint32_t tmp; + usb_rem_task(sc->sc_udev, &sc->sc_scantask); + callout_stop(&rvp->amrr_ch); ostate = vap->iv_state; + IEEE80211_UNLOCK(ic); RUM_LOCK(sc); - - switch (sc->sc_state) { + switch (nstate) { case IEEE80211_S_INIT: if (ostate == IEEE80211_S_RUN) { /* abort TSF synchronization */ @@ -803,38 +800,10 @@ rum_task(void *arg) default: break; } - RUM_UNLOCK(sc); - IEEE80211_LOCK(ic); - rvp->newstate(vap, sc->sc_state, sc->sc_arg); - if (vap->iv_newstate_cb != NULL) - vap->iv_newstate_cb(vap, sc->sc_state, sc->sc_arg); - IEEE80211_UNLOCK(ic); -} - -static int -rum_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) -{ - struct rum_vap *rvp = RUM_VAP(vap); - struct ieee80211com *ic = vap->iv_ic; - struct rum_softc *sc = ic->ic_ifp->if_softc; - - usb_rem_task(sc->sc_udev, &sc->sc_task); - usb_rem_task(sc->sc_udev, &sc->sc_scantask); - callout_stop(&rvp->amrr_ch); - - /* do it in a process context */ - sc->sc_state = nstate; - sc->sc_arg = arg; - - if (nstate == IEEE80211_S_INIT) { - rvp->newstate(vap, nstate, arg); - return 0; - } else { - usb_add_task(sc->sc_udev, &sc->sc_task, USB_TASKQ_DRIVER); - return EINPROGRESS; - } + rvp->newstate(vap, nstate, arg); + return 0; } static void Modified: user/thompsa/vaptq/sys/dev/usb/if_rumvar.h ============================================================================== --- user/thompsa/vaptq/sys/dev/usb/if_rumvar.h Sun Dec 7 05:46:17 2008 (r185732) +++ user/thompsa/vaptq/sys/dev/usb/if_rumvar.h Sun Dec 7 05:49:22 2008 (r185733) @@ -105,10 +105,6 @@ struct rum_softc { usbd_pipe_handle sc_rx_pipeh; usbd_pipe_handle sc_tx_pipeh; - enum ieee80211_state sc_state; - int sc_arg; - struct usb_task sc_task; - struct usb_task sc_scantask; int sc_scan_action; #define RUM_SCAN_START 0 Modified: user/thompsa/vaptq/sys/dev/usb/if_upgt.c ============================================================================== --- user/thompsa/vaptq/sys/dev/usb/if_upgt.c Sun Dec 7 05:46:17 2008 (r185732) +++ user/thompsa/vaptq/sys/dev/usb/if_upgt.c Sun Dec 7 05:49:22 2008 (r185733) @@ -167,10 +167,9 @@ static void upgt_stop(struct upgt_softc static void upgt_setup_rates(struct ieee80211vap *, struct ieee80211com *); static int upgt_set_macfilter(struct upgt_softc *, uint8_t); static int upgt_newstate(struct ieee80211vap *, enum ieee80211_state, int); -static void upgt_task(void *); static void upgt_scantask(void *); static void upgt_set_chan(struct upgt_softc *, struct ieee80211_channel *); -static void upgt_set_led(struct upgt_softc *, int); +static void upgt_set_led(struct upgt_softc *, int, enum ieee80211_state); static void upgt_set_led_blink(void *); static void upgt_tx_task(void *); static int upgt_get_stats(struct upgt_softc *); @@ -333,7 +332,6 @@ upgt_attach_hook(device_t dev) MTX_DEF | MTX_RECURSE); usb_init_task(&sc->sc_mcasttask, upgt_set_multi, sc); usb_init_task(&sc->sc_scantask, upgt_scantask, sc); - usb_init_task(&sc->sc_task, upgt_task, sc); usb_init_task(&sc->sc_task_tx, upgt_tx_task, sc); callout_init(&sc->sc_led_ch, 0); callout_init(&sc->sc_watchdog_ch, 0); @@ -451,6 +449,7 @@ upgt_tx_task(void *arg) struct upgt_softc *sc = arg; struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); struct ieee80211_frame *wh; struct ieee80211_key *k; struct upgt_data *data_tx; @@ -461,7 +460,7 @@ upgt_tx_task(void *arg) int len, i; usbd_status error; - upgt_set_led(sc, UPGT_LED_BLINK); + upgt_set_led(sc, UPGT_LED_BLINK, vap->iv_state); UPGT_LOCK(sc); for (i = 0; i < upgt_txbuf; i++) { @@ -693,53 +692,7 @@ upgt_stop(struct upgt_softc *sc, int dis } static void -upgt_task(void *arg) -{ - struct upgt_softc *sc = arg; - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; - struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); - struct upgt_vap *uvp = UPGT_VAP(vap); - - DPRINTF(sc, UPGT_DEBUG_STATE, "%s: %s -> %s\n", __func__, - ieee80211_state_name[vap->iv_state], - ieee80211_state_name[sc->sc_state]); - - switch (sc->sc_state) { - case IEEE80211_S_INIT: - /* do not accept any frames if the device is down */ - UPGT_LOCK(sc); - upgt_set_macfilter(sc, sc->sc_state); - UPGT_UNLOCK(sc); - upgt_set_led(sc, UPGT_LED_OFF); - break; - case IEEE80211_S_SCAN: - upgt_set_chan(sc, ic->ic_curchan); - break; - case IEEE80211_S_AUTH: - upgt_set_chan(sc, ic->ic_curchan); - break; - case IEEE80211_S_ASSOC: - break; - case IEEE80211_S_RUN: - UPGT_LOCK(sc); - upgt_set_macfilter(sc, sc->sc_state); - UPGT_UNLOCK(sc); - upgt_set_led(sc, UPGT_LED_ON); - break; - default: - break; - } - - IEEE80211_LOCK(ic); - uvp->newstate(vap, sc->sc_state, sc->sc_arg); - if (vap->iv_newstate_cb != NULL) - vap->iv_newstate_cb(vap, sc->sc_state, sc->sc_arg); - IEEE80211_UNLOCK(ic); -} - -static void -upgt_set_led(struct upgt_softc *sc, int action) +upgt_set_led(struct upgt_softc *sc, int action, enum ieee80211_state nstate) { struct upgt_data *data_cmd = &sc->cmd_data; struct upgt_lmac_mem *mem; @@ -781,7 +734,7 @@ upgt_set_led(struct upgt_softc *sc, int led->action_tmp_dur = 0; break; case UPGT_LED_BLINK: - if (sc->sc_state != IEEE80211_S_RUN) + if (nstate != IEEE80211_S_RUN) return; if (sc->sc_led_blink) /* previous blink was not finished */ @@ -1311,19 +1264,35 @@ upgt_newstate(struct ieee80211vap *vap, struct ieee80211com *ic = vap->iv_ic; struct upgt_softc *sc = ic->ic_ifp->if_softc; - usb_rem_task(sc->sc_udev, &sc->sc_task); - - /* do it in a process context */ - sc->sc_state = nstate; - sc->sc_arg = arg; - - if (nstate == IEEE80211_S_INIT) { - uvp->newstate(vap, nstate, arg); - return 0; - } else { - usb_add_task(sc->sc_udev, &sc->sc_task, USB_TASKQ_DRIVER); - return EINPROGRESS; + IEEE80211_UNLOCK(ic); + switch (nstate) { + case IEEE80211_S_INIT: + /* do not accept any frames if the device is down */ + UPGT_LOCK(sc); + upgt_set_macfilter(sc, nstate); + UPGT_UNLOCK(sc); + upgt_set_led(sc, UPGT_LED_OFF, nstate); + break; + case IEEE80211_S_SCAN: + upgt_set_chan(sc, ic->ic_curchan); + break; + case IEEE80211_S_AUTH: + upgt_set_chan(sc, ic->ic_curchan); + break; + case IEEE80211_S_ASSOC: + break; + case IEEE80211_S_RUN: + UPGT_LOCK(sc); + upgt_set_macfilter(sc, nstate); + UPGT_UNLOCK(sc); + upgt_set_led(sc, UPGT_LED_ON, nstate); + break; + default: + break; } + IEEE80211_LOCK(ic); + uvp->newstate(vap, nstate, arg); + return 0; } static void @@ -2291,7 +2260,6 @@ upgt_detach(device_t dev) mtx_destroy(&sc->sc_mtx); usb_rem_task(sc->sc_udev, &sc->sc_mcasttask); usb_rem_task(sc->sc_udev, &sc->sc_scantask); - usb_rem_task(sc->sc_udev, &sc->sc_task); usb_rem_task(sc->sc_udev, &sc->sc_task_tx); callout_stop(&sc->sc_led_ch); callout_stop(&sc->sc_watchdog_ch); Modified: user/thompsa/vaptq/sys/dev/usb/if_upgtvar.h ============================================================================== --- user/thompsa/vaptq/sys/dev/usb/if_upgtvar.h Sun Dec 7 05:46:17 2008 (r185732) +++ user/thompsa/vaptq/sys/dev/usb/if_upgtvar.h Sun Dec 7 05:49:22 2008 (r185733) @@ -409,12 +409,9 @@ struct upgt_softc { int sc_debug; struct usb_task sc_mcasttask; - struct usb_task sc_task; struct usb_task sc_scantask; #define UPGT_SET_CHANNEL 2 int sc_scan_action; - enum ieee80211_state sc_state; - int sc_arg; int sc_led_blink; struct callout sc_led_ch; uint8_t sc_cur_rateset[8]; Modified: user/thompsa/vaptq/sys/dev/usb/if_ural.c ============================================================================== --- user/thompsa/vaptq/sys/dev/usb/if_ural.c Sun Dec 7 05:46:17 2008 (r185732) +++ user/thompsa/vaptq/sys/dev/usb/if_ural.c Sun Dec 7 05:49:22 2008 (r185733) @@ -125,7 +125,6 @@ static int ural_alloc_tx_list(struct ur static void ural_free_tx_list(struct ural_softc *); static int ural_alloc_rx_list(struct ural_softc *); static void ural_free_rx_list(struct ural_softc *); -static void ural_task(void *); static void ural_scantask(void *); static int ural_newstate(struct ieee80211vap *, enum ieee80211_state, int); @@ -451,7 +450,6 @@ ural_attach(device_t self) mtx_init(&sc->sc_mtx, device_get_nameunit(sc->sc_dev), MTX_NETWORK_LOCK, MTX_DEF | MTX_RECURSE); - usb_init_task(&sc->sc_task, ural_task, sc); usb_init_task(&sc->sc_scantask, ural_scantask, sc); callout_init(&sc->watchdog_ch, 0); @@ -539,7 +537,6 @@ ural_detach(device_t self) bpfdetach(ifp); ieee80211_ifdetach(ic); - usb_rem_task(sc->sc_udev, &sc->sc_task); usb_rem_task(sc->sc_udev, &sc->sc_scantask); callout_stop(&sc->watchdog_ch); @@ -737,22 +734,51 @@ ural_free_rx_list(struct ural_softc *sc) } static void -ural_task(void *xarg) +ural_scantask(void *arg) { - struct ural_softc *sc = xarg; + struct ural_softc *sc = arg; struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); + + RAL_LOCK(sc); + if (sc->sc_scan_action == URAL_SCAN_START) { + /* abort TSF synchronization */ + ural_write(sc, RAL_TXRX_CSR19, 0); + ural_set_bssid(sc, ifp->if_broadcastaddr); + } else if (sc->sc_scan_action == URAL_SET_CHANNEL) { + mtx_lock(&Giant); + ural_set_chan(sc, ic->ic_curchan); + mtx_unlock(&Giant); + } else { + ural_enable_tsf_sync(sc); + /* XXX keep local copy */ + ural_set_bssid(sc, vap->iv_bss->ni_bssid); + } + RAL_UNLOCK(sc); +} + +static int +ural_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) +{ struct ural_vap *uvp = URAL_VAP(vap); - const struct ieee80211_txparam *tp; + struct ieee80211com *ic = vap->iv_ic; + struct ural_softc *sc = ic->ic_ifp->if_softc; enum ieee80211_state ostate; + const struct ieee80211_txparam *tp; struct ieee80211_node *ni; struct mbuf *m; + callout_stop(&uvp->amrr_ch); ostate = vap->iv_state; + DPRINTF(("%s: %s -> %s\n", __func__, + ieee80211_state_name[vap->iv_state], + ieee80211_state_name[nstate])); + + IEEE80211_UNLOCK(ic); RAL_LOCK(sc); - switch (sc->sc_state) { + switch (nstate) { case IEEE80211_S_INIT: if (ostate == IEEE80211_S_RUN) { /* abort TSF synchronization */ @@ -779,13 +805,13 @@ ural_task(void *xarg) if (m == NULL) { device_printf(sc->sc_dev, "could not allocate beacon\n"); - return; + return ENXIO; } if (ural_tx_bcn(sc, m, ni) != 0) { device_printf(sc->sc_dev, "could not send beacon\n"); - return; + return ENXIO; } } @@ -805,62 +831,10 @@ ural_task(void *xarg) default: break; } - RAL_UNLOCK(sc); - IEEE80211_LOCK(ic); - uvp->newstate(vap, sc->sc_state, sc->sc_arg); - if (vap->iv_newstate_cb != NULL) - vap->iv_newstate_cb(vap, sc->sc_state, sc->sc_arg); - IEEE80211_UNLOCK(ic); -} - -static void -ural_scantask(void *arg) -{ - struct ural_softc *sc = arg; - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; - struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); - - RAL_LOCK(sc); - if (sc->sc_scan_action == URAL_SCAN_START) { - /* abort TSF synchronization */ - ural_write(sc, RAL_TXRX_CSR19, 0); - ural_set_bssid(sc, ifp->if_broadcastaddr); - } else if (sc->sc_scan_action == URAL_SET_CHANNEL) { - mtx_lock(&Giant); - ural_set_chan(sc, ic->ic_curchan); - mtx_unlock(&Giant); - } else { - ural_enable_tsf_sync(sc); - /* XXX keep local copy */ - ural_set_bssid(sc, vap->iv_bss->ni_bssid); - } - RAL_UNLOCK(sc); -} - -static int -ural_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) -{ - struct ural_vap *uvp = URAL_VAP(vap); - struct ieee80211com *ic = vap->iv_ic; - struct ural_softc *sc = ic->ic_ifp->if_softc; - - callout_stop(&uvp->amrr_ch); - - /* do it in a process context */ - sc->sc_state = nstate; - sc->sc_arg = arg; - - usb_rem_task(sc->sc_udev, &sc->sc_task); - if (nstate == IEEE80211_S_INIT) { - uvp->newstate(vap, nstate, arg); - return 0; - } else { - usb_add_task(sc->sc_udev, &sc->sc_task, USB_TASKQ_DRIVER); - return EINPROGRESS; - } + uvp->newstate(vap, nstate, arg); + return 0; } #define RAL_RXTX_TURNAROUND 5 /* us */ Modified: user/thompsa/vaptq/sys/dev/usb/if_uralvar.h ============================================================================== --- user/thompsa/vaptq/sys/dev/usb/if_uralvar.h Sun Dec 7 05:46:17 2008 (r185732) +++ user/thompsa/vaptq/sys/dev/usb/if_uralvar.h Sun Dec 7 05:49:22 2008 (r185733) @@ -110,10 +110,7 @@ struct ural_softc { usbd_pipe_handle sc_rx_pipeh; usbd_pipe_handle sc_tx_pipeh; - enum ieee80211_state sc_state; - int sc_arg; int sc_scan_action; /* should be an enum */ - struct usb_task sc_task; struct usb_task sc_scantask; struct ural_rx_data rx_data[RAL_RX_LIST_COUNT]; Modified: user/thompsa/vaptq/sys/dev/usb/if_zyd.c ============================================================================== --- user/thompsa/vaptq/sys/dev/usb/if_zyd.c Sun Dec 7 05:46:17 2008 (r185732) +++ user/thompsa/vaptq/sys/dev/usb/if_zyd.c Sun Dec 7 05:49:22 2008 (r185733) @@ -202,7 +202,6 @@ static int zyd_alloc_rx_list(struct zyd_ static void zyd_free_rx_list(struct zyd_softc *); static struct ieee80211_node *zyd_node_alloc(struct ieee80211vap *, const uint8_t mac[IEEE80211_ADDR_LEN]); -static void zyd_task(void *); static int zyd_newstate(struct ieee80211vap *, enum ieee80211_state, int); static int zyd_cmd(struct zyd_softc *, uint16_t, const void *, int, void *, int, u_int); @@ -322,7 +321,6 @@ zyd_attach(device_t dev) MTX_NETWORK_LOCK, MTX_DEF); usb_init_task(&sc->sc_mcasttask, zyd_set_multi, sc); usb_init_task(&sc->sc_scantask, zyd_scantask, sc); - usb_init_task(&sc->sc_task, zyd_task, sc); callout_init(&sc->sc_watchdog_ch, 0); STAILQ_INIT(&sc->sc_rqh); @@ -661,18 +659,24 @@ zyd_node_alloc(struct ieee80211vap *vap return (zn != NULL) ? (&zn->ni) : (NULL); } -static void -zyd_task(void *arg) +static int +zyd_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { - int error; - struct zyd_softc *sc = arg; - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; - struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); - struct ieee80211_node *ni = vap->iv_bss; struct zyd_vap *zvp = ZYD_VAP(vap); + struct ieee80211com *ic = vap->iv_ic; + struct zyd_softc *sc = ic->ic_ifp->if_softc; + struct ieee80211_node *ni = vap->iv_bss; + int error; - switch (sc->sc_state) { + DPRINTF(sc, ZYD_DEBUG_STATE, "%s: %s -> %s\n", __func__, + ieee80211_state_name[vap->iv_state], + ieee80211_state_name[nstate]); + + usb_rem_task(sc->sc_udev, &sc->sc_scantask); + callout_stop(&sc->sc_watchdog_ch); + + IEEE80211_UNLOCK(ic); + switch (nstate) { case IEEE80211_S_AUTH: zyd_set_chan(sc, ic->ic_curchan); break; @@ -684,51 +688,20 @@ zyd_task(void *arg) error = zyd_set_led(sc, ZYD_LED1, 1); if (error != 0) goto fail; - + /* make data LED blink upon Tx */ zyd_write32_m(sc, sc->sc_fwbase + ZYD_FW_LINK_STATUS, 1); - + IEEE80211_ADDR_COPY(sc->sc_bssid, ni->ni_bssid); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Sun Dec 7 06:00:21 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59A381065670; Sun, 7 Dec 2008 06:00:21 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 487A28FC17; Sun, 7 Dec 2008 06:00:21 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB760L1k015942; Sun, 7 Dec 2008 06:00:21 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB760LE4015939; Sun, 7 Dec 2008 06:00:21 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812070600.mB760LE4015939@svn.freebsd.org> From: Kip Macy Date: Sun, 7 Dec 2008 06:00:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185734 - user/kmacy/HEAD_fast_multi_xmit/sys/net X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Dec 2008 06:00:21 -0000 Author: kmacy Date: Sun Dec 7 06:00:20 2008 New Revision: 185734 URL: http://svn.freebsd.org/changeset/base/185734 Log: add support for "route shutdown" - allow existing connections to continue to use the route but no future ones Modified: user/kmacy/HEAD_fast_multi_xmit/sys/net/radix_mpath.c user/kmacy/HEAD_fast_multi_xmit/sys/net/route.c user/kmacy/HEAD_fast_multi_xmit/sys/net/route.h Modified: user/kmacy/HEAD_fast_multi_xmit/sys/net/radix_mpath.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/net/radix_mpath.c Sun Dec 7 05:49:22 2008 (r185733) +++ user/kmacy/HEAD_fast_multi_xmit/sys/net/radix_mpath.c Sun Dec 7 06:00:20 2008 (r185734) @@ -81,11 +81,15 @@ u_int32_t rn_mpath_count(struct radix_node *rn) { u_int32_t i; - + struct rtentry *rt; + i = 1; - while ((rn = rn_mpath_next(rn)) != NULL) - i++; - return i; + while ((rn = rn_mpath_next(rn)) != NULL) { + rt = (struct rtentry *)rn; + if ((rt->rt_flags & RTF_SHUTDOWN) == 0) + i++; + } + return (i); } struct rtentry * @@ -260,7 +264,8 @@ rtalloc_mpath_fib(struct route *ro, u_in { struct radix_node *rn0, *rn; u_int32_t n; - + struct rtentry *rt; + /* * XXX we don't attempt to lookup cached route again; what should * be done for sendto(3) case? @@ -285,6 +290,11 @@ rtalloc_mpath_fib(struct route *ro, u_in hash += hashjitter; hash %= n; while (hash-- > 0 && rn) { + rt = (struct rtentry *)rn; + if (rt->rt_flags & RTF_SHUTDOWN) { + hash++; + continue; + } /* stay within the multipath routes */ if (rn->rn_dupedkey && rn->rn_mask != rn->rn_dupedkey->rn_mask) break; Modified: user/kmacy/HEAD_fast_multi_xmit/sys/net/route.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/net/route.c Sun Dec 7 05:49:22 2008 (r185733) +++ user/kmacy/HEAD_fast_multi_xmit/sys/net/route.c Sun Dec 7 06:00:20 2008 (r185734) @@ -908,6 +908,98 @@ rtrequest1(int req, struct rt_addrinfo * return (rtrequest1_fib(req, info, ret_nrt, 0)); } +#ifdef RADIX_MPATH +static int +rn_mpath_delete(int req, struct rt_addrinfo *info, + struct radix_node_head *rnh, struct rtentry **ret_nrt) +{ + /* + * if we got multipath routes, we require users to specify + * a matching RTAX_GATEWAY. + */ + struct rtentry *rto = NULL; + int error = 0; + + rn = rnh->rnh_matchaddr(dst, rnh); + if (rn == NULL) + return (ESRCH); + rto = rt = RNTORT(rn); + rt = rt_mpath_matchgate(rt, gateway); + if (!rt) + return (ESRCH); + /* + * this is the first entry in the chain + */ + if (rto == rt) { + rn = rn_mpath_next((struct radix_node *)rt); + /* + * there is another entry, now it's active + */ + if (rn) { + rto = RNTORT(rn); + RT_LOCK(rto); + rto->rt_flags |= RTF_UP; + RT_UNLOCK(rto); + } else if (rt->rt_flags & RTF_GATEWAY) { + /* + * For gateway routes, we need to + * make sure that we we are deleting + * the correct gateway. + * rt_mpath_matchgate() does not + * check the case when there is only + * one route in the chain. + */ + if (gateway && + (rt->rt_gateway->sa_len != gateway->sa_len || + memcmp(rt->rt_gateway, gateway, gateway->sa_len))) + error = ESRCH; + goto done; + } + /* + * use the normal delete code to remove + * the first entry + */ + error = ENOENT; + goto done; + } + + /* + * if the entry is 2nd and on up + */ + if ((req == RTM_DELETE) && !rt_mpath_deldup(rto, rt)) + panic ("rtrequest1: rt_mpath_deldup"); + RT_LOCK(rt); + RT_ADDREF(rt); + if (req == RTM_DELETE) { + rt->rt_flags &= ~RTF_UP; + /* + * One more rtentry floating around that is not + * linked to the routing table. rttrash will be decremented + * when RTFREE(rt) is eventually called. + */ + V_rttrash++; + + } else if (req == RTM_SHUTDOWN) + rt->rt_flags |= RTF_SHUTDOWN; + else + panic("unrecognized request %d", req); + + + /* + * If the caller wants it, then it can have it, + * but it's up to it to free the rtentry as we won't be + * doing it. + */ + if (ret_nrt) { + *ret_nrt = rt; + RT_UNLOCK(rt); + } else + RTFREE_LOCKED(rt); +done: + return (error); +} +#endif + int rtrequest1_fib(int req, struct rt_addrinfo *info, struct rtentry **ret_nrt, u_int fibnum) @@ -945,65 +1037,16 @@ rtrequest1_fib(int req, struct rt_addrin switch (req) { case RTM_DELETE: #ifdef RADIX_MPATH - /* - * if we got multipath routes, we require users to specify - * a matching RTAX_GATEWAY. - */ + case RTM_SHUTDOWN: if (rn_mpath_capable(rnh)) { - struct rtentry *rto = NULL; - - rn = rnh->rnh_matchaddr(dst, rnh); - if (rn == NULL) - senderr(ESRCH); - rto = rt = RNTORT(rn); - rt = rt_mpath_matchgate(rt, gateway); - if (!rt) - senderr(ESRCH); + error = rn_mpath_delete(req, info, rnh, ret_nrt); /* - * this is the first entry in the chain + * "bad" holds true for the success case + * as well */ - if (rto == rt) { - rn = rn_mpath_next((struct radix_node *)rt); - /* - * there is another entry, now it's active - */ - if (rn) { - rto = RNTORT(rn); - RT_LOCK(rto); - rto->rt_flags |= RTF_UP; - RT_UNLOCK(rto); - } else if (rt->rt_flags & RTF_GATEWAY) { - /* - * For gateway routes, we need to - * make sure that we we are deleting - * the correct gateway. - * rt_mpath_matchgate() does not - * check the case when there is only - * one route in the chain. - */ - if (gateway && - (rt->rt_gateway->sa_len != gateway->sa_len || - memcmp(rt->rt_gateway, gateway, gateway->sa_len))) - senderr(ESRCH); - } - /* - * use the normal delete code to remove - * the first entry - */ - goto normal_rtdel; - } - /* - * if the entry is 2nd and on up - */ - if (!rt_mpath_deldup(rto, rt)) - panic ("rtrequest1: rt_mpath_deldup"); - RT_LOCK(rt); - RT_ADDREF(rt); - rt->rt_flags &= ~RTF_UP; - goto deldone; /* done with the RTM_DELETE command */ + if (error != ENOENT) + goto bad; } - -normal_rtdel: #endif /* * Remove the item from the tree and return it. @@ -1044,9 +1087,6 @@ normal_rtdel: if ((ifa = rt->rt_ifa) && ifa->ifa_rtrequest) ifa->ifa_rtrequest(RTM_DELETE, rt, info); -#ifdef RADIX_MPATH -deldone: -#endif /* * One more rtentry floating around that is not * linked to the routing table. rttrash will be decremented Modified: user/kmacy/HEAD_fast_multi_xmit/sys/net/route.h ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/net/route.h Sun Dec 7 05:49:22 2008 (r185733) +++ user/kmacy/HEAD_fast_multi_xmit/sys/net/route.h Sun Dec 7 06:00:20 2008 (r185734) @@ -197,7 +197,8 @@ struct ortentry { #define RTF_BROADCAST 0x400000 /* route represents a bcast address */ #define RTF_MULTICAST 0x800000 /* route represents a mcast address */ /* 0x1000000 and up unassigned */ -#define RTF_RNH_LOCKED 0x40000000 +#define RTF_SHUTDOWN 0x20000000 /* no new connections */ +#define RTF_RNH_LOCKED 0x40000000 #define RTF_DESTEN_VALID 0x80000000 /* rtentry_info L2 addr is valid */ /* Mask of RTF flags that are allowed to be modified by RTM_CHANGE. */ @@ -257,6 +258,7 @@ struct rt_msghdr { #define RTM_DELMADDR 0x10 /* mcast group membership being deleted */ #define RTM_IFANNOUNCE 0x11 /* iface arrival/departure */ #define RTM_IEEE80211 0x12 /* IEEE80211 wireless event */ +#define RTM_SHUTDOWN 0x13 /* don't use for new connections */ /* * Bitmask values for rtm_inits and rmx_locks. From owner-svn-src-user@FreeBSD.ORG Sun Dec 7 06:01:10 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50C771065673; Sun, 7 Dec 2008 06:01:10 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 407808FC08; Sun, 7 Dec 2008 06:01:10 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB761A5X015995; Sun, 7 Dec 2008 06:01:10 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB761ARM015993; Sun, 7 Dec 2008 06:01:10 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812070601.mB761ARM015993@svn.freebsd.org> From: Kip Macy Date: Sun, 7 Dec 2008 06:01:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185735 - user/kmacy/HEAD_fast_multi_xmit/sbin/route X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Dec 2008 06:01:10 -0000 Author: kmacy Date: Sun Dec 7 06:01:09 2008 New Revision: 185735 URL: http://svn.freebsd.org/changeset/base/185735 Log: add shutdown command to route Modified: user/kmacy/HEAD_fast_multi_xmit/sbin/route/keywords user/kmacy/HEAD_fast_multi_xmit/sbin/route/route.c Modified: user/kmacy/HEAD_fast_multi_xmit/sbin/route/keywords ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sbin/route/keywords Sun Dec 7 06:00:20 2008 (r185734) +++ user/kmacy/HEAD_fast_multi_xmit/sbin/route/keywords Sun Dec 7 06:01:09 2008 (r185735) @@ -44,6 +44,7 @@ rtt rttvar sa sendpipe +shutdown ssthresh static x25 Modified: user/kmacy/HEAD_fast_multi_xmit/sbin/route/route.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sbin/route/route.c Sun Dec 7 06:00:20 2008 (r185734) +++ user/kmacy/HEAD_fast_multi_xmit/sbin/route/route.c Sun Dec 7 06:01:09 2008 (r185735) @@ -176,6 +176,7 @@ main(argc, argv) case K_ADD: case K_DEL: case K_DELETE: + case K_SHUTDOWN: newroute(argc, argv); /* NOTREACHED */ @@ -1203,7 +1204,9 @@ rtmsg(cmd, flags) so_ifp.sa.sa_len = sizeof(struct sockaddr_dl); rtm_addrs |= RTA_IFP; } - } else + } else if (cmd == 's') + cmd = RTM_SHUTDOWN; + else cmd = RTM_DELETE; #define rtm m_rtmsg.m_rtm rtm.rtm_type = cmd; From owner-svn-src-user@FreeBSD.ORG Sun Dec 7 07:02:27 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E1D2106564A; Sun, 7 Dec 2008 07:02:27 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C3AC8FC12; Sun, 7 Dec 2008 07:02:27 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB772RjU017238; Sun, 7 Dec 2008 07:02:27 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB772Qdp017229; Sun, 7 Dec 2008 07:02:26 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812070702.mB772Qdp017229@svn.freebsd.org> From: Kip Macy Date: Sun, 7 Dec 2008 07:02:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185738 - in user/kmacy/head_arpv2/sys: net netinet netinet6 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Dec 2008 07:02:27 -0000 Author: kmacy Date: Sun Dec 7 07:02:26 2008 New Revision: 185738 URL: http://svn.freebsd.org/changeset/base/185738 Log: - add refcount and rwlock to llentry - reduce coverage of AFDATA lock Modified: user/kmacy/head_arpv2/sys/net/if_llatbl.c user/kmacy/head_arpv2/sys/net/if_llatbl.h user/kmacy/head_arpv2/sys/netinet/if_ether.c user/kmacy/head_arpv2/sys/netinet/in.c user/kmacy/head_arpv2/sys/netinet6/in6.c user/kmacy/head_arpv2/sys/netinet6/ip6_input.c user/kmacy/head_arpv2/sys/netinet6/nd6.c user/kmacy/head_arpv2/sys/netinet6/nd6.h Modified: user/kmacy/head_arpv2/sys/net/if_llatbl.c ============================================================================== --- user/kmacy/head_arpv2/sys/net/if_llatbl.c Sun Dec 7 06:34:50 2008 (r185737) +++ user/kmacy/head_arpv2/sys/net/if_llatbl.c Sun Dec 7 07:02:26 2008 (r185738) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -89,13 +90,14 @@ done: void llentry_free(struct llentry *lle) { - struct lltable *llt = lle->lle_tbl; + LLE_WLOCK(lle); LIST_REMOVE(lle, lle_next); if (lle->la_hold != NULL) m_freem(lle->la_hold); - llt->llt_free(llt, lle); + + LLE_FREE_LOCKED(lle); } /* Modified: user/kmacy/head_arpv2/sys/net/if_llatbl.h ============================================================================== --- user/kmacy/head_arpv2/sys/net/if_llatbl.h Sun Dec 7 06:34:50 2008 (r185737) +++ user/kmacy/head_arpv2/sys/net/if_llatbl.h Sun Dec 7 07:02:26 2008 (r185738) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #ifndef _NET_IF_LLATBL_H_ #define _NET_IF_LLATBL_H_ +#include #include struct ifnet; @@ -38,8 +39,13 @@ struct rt_addrinfo; struct llentry; LIST_HEAD(llentries, llentry); +/* + * Code referencing llentry must at least hold + * a shared lock + */ struct llentry { LIST_ENTRY(llentry) lle_next; + struct rwlock lle_lock; struct lltable *lle_tbl; struct llentries *lle_head; struct mbuf *la_hold; @@ -51,6 +57,8 @@ struct llentry { int16_t ln_state; /* IPv6 has ND6_LLINFO_NOSTATE == -2 */ uint16_t ln_router; time_t ln_ntick; + int lle_refcnt; + union { uint64_t mac_aligned; uint16_t mac16[3]; @@ -64,6 +72,40 @@ struct llentry { /* NB: struct sockaddr must immediately follow */ }; +#define LLE_WLOCK(lle) rw_wlock(&(lle)->lle_lock) +#define LLE_RLOCK(lle) rw_rlock(&(lle)->lle_lock) +#define LLE_WUNLOCK(lle) rw_wunlock(&(lle)->lle_lock) +#define LLE_RUNLOCK(lle) rw_runlock(&(lle)->lle_lock) +#define LLE_DOWNGRADE(lle) rw_downgrade(&(lle)->lle_lock) +#define LLE_LOCK_INIT(lle) rw_init_flags(&(lle)->lle_lock, "lle", RW_DUPOK) +#define LLE_WLOCK_ASSERT(lle) rw_assert(&(lle)->lle_lock, RA_WLOCKED) + +#define LLE_ADDREF(lle) do { \ + LLE_WLOCK_ASSERT(lle); \ + KASSERT((lle)->lle_refcnt >= 0, \ + ("negative refcnt %d", (lle)->lle_refcnt)); \ + (lle)->lle_refcnt++; \ +} while (0) + +#define LLE_REMREF(lle) do { \ + LLE_WLOCK_ASSERT(lle); \ + KASSERT((lle)->rt_refcnt > 0, \ + ("bogus refcnt %ld", (lle)->rt_refcnt)); \ + (lle)->rt_refcnt--; \ +} while (0) + +#define LLE_FREE_LOCKED(lle) do { \ + if ((lle)->lle_refcnt <= 1) \ + (lle)->lle_tbl->llt_free((lle)->lle_tbl, (lle));\ + else { \ + (lle)->lle_refcnt--; \ + LLE_WUNLOCK(lle); \ + } \ + /* guard against invalid refs */ \ + lle = 0; \ +} while (0) + + #define ln_timer_ch lle_timer.ln_timer_ch #define la_timer lle_timer.la_timer @@ -105,8 +147,9 @@ MALLOC_DECLARE(M_LLTABLE); #define LLE_VALID 0x0008 /* ll_addr is valid */ #define LLE_PROXY 0x0010 /* proxy entry ??? */ #define LLE_PUB 0x0020 /* publish entry ??? */ -#define LLE_CREATE 0x8000 /* create on a lookup miss */ #define LLE_DELETE 0x4000 /* delete on a lookup - match LLE_IFADDR */ +#define LLE_CREATE 0x8000 /* create on a lookup miss */ +#define LLE_EXCLUSIVE 0x2000 /* return lle xlocked */ #define LLATBL_HASH(key, mask) \ (((((((key >> 8) ^ key) >> 8) ^ key) >> 8) ^ key) & mask) Modified: user/kmacy/head_arpv2/sys/netinet/if_ether.c ============================================================================== --- user/kmacy/head_arpv2/sys/netinet/if_ether.c Sun Dec 7 06:34:50 2008 (r185737) +++ user/kmacy/head_arpv2/sys/netinet/if_ether.c Sun Dec 7 07:02:26 2008 (r185738) @@ -130,20 +130,15 @@ void arp_ifscrub(struct ifnet *ifp, uint32_t addr) { struct sockaddr_in addr4; - struct llentry *lle; bzero((void *)&addr4, sizeof(addr4)); addr4.sin_len = sizeof(addr4); addr4.sin_family = AF_INET; addr4.sin_addr.s_addr = addr; IF_AFDATA_LOCK(ifp); - lle = lla_lookup(LLTABLE(ifp), (LLE_DELETE | LLE_IFADDR), + lla_lookup(LLTABLE(ifp), (LLE_DELETE | LLE_IFADDR), (struct sockaddr *)&addr4); IF_AFDATA_UNLOCK(ifp); -#if 0 - if (lle == NULL) - log(LOG_INFO, "arp_ifscrub: interface address is missing from cache\n"); -#endif } #endif @@ -257,7 +252,6 @@ arpresolve(struct ifnet *ifp, struct rte int error; *lle = NULL; - if (m != NULL) { if (m->m_flags & M_BCAST) { /* broadcast */ @@ -273,6 +267,7 @@ arpresolve(struct ifnet *ifp, struct rte } flags = (ifp->if_flags & (IFF_NOARP | IFF_STATICARP)) ? 0 : LLE_CREATE; + flags |= (m ? LLE_EXCLUSIVE : 0); /* XXXXX * Since this function returns an llentry, the @@ -304,14 +299,16 @@ arpresolve(struct ifnet *ifp, struct rte la->la_preempt--; } *lle = la; - return (0); + error = 0; + goto done; } if (la->la_flags & LLE_STATIC) { /* should not happen! */ log(LOG_DEBUG, "arpresolve: ouch, empty static llinfo for %s\n", inet_ntoa(SIN(dst)->sin_addr)); m_freem(m); - return (EINVAL); + error = EINVAL; + goto done; } /* * There is an arptab entry, but no ethernet address @@ -322,6 +319,7 @@ arpresolve(struct ifnet *ifp, struct rte if (la->la_hold) m_freem(la->la_hold); la->la_hold = m; + LLE_DOWNGRADE(la); } /* * Return EWOULDBLOCK if we have tried less than arp_maxtries. It @@ -344,7 +342,9 @@ arpresolve(struct ifnet *ifp, struct rte IF_LLADDR(ifp)); } - return (EWOULDBLOCK); +done: + LLE_RUNLOCK(la); + return (error); } /* @@ -434,7 +434,7 @@ in_arpinput(struct mbuf *m) struct sockaddr sa; struct in_addr isaddr, itaddr, myaddr; u_int8_t *enaddr = NULL; - int op, flag; + int op, flags; /* , rif_len; */ @@ -561,9 +561,11 @@ match: sin.sin_len = sizeof(struct sockaddr_in); sin.sin_family = AF_INET; sin.sin_addr = isaddr; - flag = (itaddr.s_addr == myaddr.s_addr) ? LLE_CREATE : 0; + flags = (itaddr.s_addr == myaddr.s_addr) ? LLE_CREATE : 0; + flags |= LLE_EXCLUSIVE; IF_AFDATA_LOCK(ifp); - la = lla_lookup(LLTABLE(ifp), flag, (struct sockaddr *)&sin); + la = lla_lookup(LLTABLE(ifp), flags, (struct sockaddr *)&sin); + IF_AFDATA_UNLOCK(ifp); if (la != NULL) { /* the following is not an error when doing bridging */ if (!bridged && la->lle_tbl->llt_ifp != ifp @@ -698,8 +700,8 @@ reply: } } - IF_AFDATA_UNLOCK(ifp); - + if (la) + LLE_WUNLOCK(la); if (itaddr.s_addr == myaddr.s_addr && IN_LINKLOCAL(ntohl(itaddr.s_addr))) { /* RFC 3927 link-local IPv4; always reply by broadcast. */ @@ -725,7 +727,8 @@ reply: return; drop: - IF_AFDATA_UNLOCK(ifp); + if (la) + LLE_WUNLOCK(la); m_freem(m); } #endif @@ -750,6 +753,7 @@ arp_ifinit(struct ifnet *ifp, struct ifa if (lle == NULL) log(LOG_INFO, "arp_ifinit: cannot create arp " "entry for interface address\n"); + LLE_RUNLOCK(lle); ifa->ifa_rtrequest = NULL; } Modified: user/kmacy/head_arpv2/sys/netinet/in.c ============================================================================== --- user/kmacy/head_arpv2/sys/netinet/in.c Sun Dec 7 06:34:50 2008 (r185737) +++ user/kmacy/head_arpv2/sys/netinet/in.c Sun Dec 7 07:02:26 2008 (r185738) @@ -1046,7 +1046,8 @@ in_lltable_new(const struct sockaddr *l3 */ lle->base.la_expire = time_second; /* mark expired */ lle->l3_addr4 = *(const struct sockaddr_in *)l3addr; - + lle->base.lle_refcnt = 1; + LLE_LOCK_INIT(&lle->base); return &lle->base; } @@ -1083,6 +1084,11 @@ in_lltable_rtcheck(struct ifnet *ifp, co return 0; } +/* + * Returns NULL if not found or marked for deletion + * if found returns lle read locked + * + */ static struct llentry * in_lltable_lookup(struct lltable *llt, u_int flags, const struct sockaddr *l3addr) { @@ -1104,7 +1110,22 @@ in_lltable_lookup(struct lltable *llt, u break; } - if (lle == NULL) { + if (lle != NULL ) { + if (flags & LLE_DELETE) { + LLE_WLOCK(lle); + lle->la_flags = LLE_DELETED; + LLE_WUNLOCK(lle); +#ifdef INVARIANTS + log(LOG_INFO, "ifaddr cache = %p is deleted\n", lle); +#endif + lle = NULL; + } else + LLE_RLOCK(lle); + } else { +#ifdef INVARIANTS + if (flags & LLE_DELETE) + log(LOG_INFO, "interface address is missing from cache = %p in delete\n", lle); +#endif if (!(flags & LLE_CREATE)) return (NULL); /* @@ -1114,12 +1135,12 @@ in_lltable_lookup(struct lltable *llt, u */ if (!(flags & LLE_IFADDR) && in_lltable_rtcheck(ifp, l3addr) != 0) - return NULL; + goto done; lle = in_lltable_new(l3addr, flags); if (lle == NULL) { log(LOG_INFO, "lla_lookup: new lle malloc failed\n"); - return NULL; + goto done; } lle->la_flags = flags & ~LLE_CREATE; if ((flags & (LLE_CREATE | LLE_IFADDR)) == (LLE_CREATE | LLE_IFADDR)) { @@ -1129,12 +1150,11 @@ in_lltable_lookup(struct lltable *llt, u lle->lle_tbl = llt; lle->lle_head = lleh; + LLE_RLOCK(lle); LIST_INSERT_HEAD(lleh, lle, lle_next); - } else { - if (flags & LLE_DELETE) - lle->la_flags = LLE_DELETED; - } - return lle; + } +done: + return (lle); } static int Modified: user/kmacy/head_arpv2/sys/netinet6/in6.c ============================================================================== --- user/kmacy/head_arpv2/sys/netinet6/in6.c Sun Dec 7 06:34:50 2008 (r185737) +++ user/kmacy/head_arpv2/sys/netinet6/in6.c Sun Dec 7 07:02:26 2008 (r185738) @@ -1143,21 +1143,16 @@ in6_purgeaddr(struct ifaddr *ifa) { struct ifnet *ifp = ifa->ifa_ifp; struct in6_ifaddr *ia = (struct in6_ifaddr *) ifa; - struct llentry *ln = NULL; struct in6_multi_mship *imm; /* stop DAD processing */ nd6_dad_stop(ifa); IF_AFDATA_LOCK(ifp); - ln = lla_lookup(LLTABLE6(ifp), (LLE_DELETE | LLE_IFADDR), + lla_lookup(LLTABLE6(ifp), (LLE_DELETE | LLE_IFADDR), (struct sockaddr *)&ia->ia_addr); - if (ln == NULL) - log(LOG_INFO, "nd6_purgeaddr: interface address is missing from cache\n"); - else - log(LOG_INFO, "nd6_purgeaddr: ifaddr cache = %p is deleted\n", ln); IF_AFDATA_UNLOCK(ifp); - + /* * leave from multicast groups we have joined for the interface */ @@ -1609,13 +1604,14 @@ in6_ifinit(struct ifnet *ifp, struct in6 /* Qing * we need to report rt_newaddrmsg */ - ln = lla_lookup(LLTABLE6(ifp), (LLE_CREATE | LLE_IFADDR), + ln = lla_lookup(LLTABLE6(ifp), (LLE_CREATE | LLE_IFADDR | LLE_EXCLUSIVE), (struct sockaddr *)&ia->ia_addr); + IF_AFDATA_UNLOCK(ifp); if (ln) { ln->la_expire = 0; /* for IPv6 this means permanent */ ln->ln_state = ND6_LLINFO_REACHABLE; + LLE_WUNLOCK(ln); } - IF_AFDATA_UNLOCK(ifp); } return (error); @@ -2119,7 +2115,8 @@ in6_lltable_new(const struct sockaddr *l callout_init(&lle->base.ln_timer_ch, CALLOUT_MPSAFE); lle->l3_addr6 = *(const struct sockaddr_in6 *)l3addr; - + lle->base.lle_refcnt = 1; + LLE_LOCK_INIT(&lle->base); return &lle->base; } Modified: user/kmacy/head_arpv2/sys/netinet6/ip6_input.c ============================================================================== --- user/kmacy/head_arpv2/sys/netinet6/ip6_input.c Sun Dec 7 06:34:50 2008 (r185737) +++ user/kmacy/head_arpv2/sys/netinet6/ip6_input.c Sun Dec 7 07:02:26 2008 (r185738) @@ -554,13 +554,13 @@ passin: IF_AFDATA_LOCK(ifp); lle = lla_lookup(LLTABLE6(ifp), 0, (struct sockaddr *)&dst6); + IF_AFDATA_UNLOCK(ifp); if ((lle != NULL) && (lle->la_flags & LLE_IFADDR)) { ours = 1; deliverifp = ifp; - IF_AFDATA_UNLOCK(ifp); + LLE_RUNLOCK(lle); goto hbhcheck; } - IF_AFDATA_UNLOCK(ifp); if (ip6_forward_rt.ro_rt != NULL && (ip6_forward_rt.ro_rt->rt_flags & RTF_UP) != 0 && Modified: user/kmacy/head_arpv2/sys/netinet6/nd6.c ============================================================================== --- user/kmacy/head_arpv2/sys/netinet6/nd6.c Sun Dec 7 06:34:50 2008 (r185737) +++ user/kmacy/head_arpv2/sys/netinet6/nd6.c Sun Dec 7 07:02:26 2008 (r185738) @@ -48,6 +48,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include @@ -434,12 +436,14 @@ skip1: void nd6_llinfo_settimer(struct llentry *ln, long tick) { + LLE_WLOCK(ln); if (tick < 0) { ln->la_expire = 0; ln->ln_ntick = 0; callout_stop(&ln->ln_timer_ch); } else { ln->la_expire = time_second + tick / hz; + LLE_ADDREF(ln); if (tick > INT_MAX) { ln->ln_ntick = tick - INT_MAX; callout_reset(&ln->ln_timer_ch, INT_MAX, @@ -450,6 +454,7 @@ nd6_llinfo_settimer(struct llentry *ln, nd6_llinfo_timer, ln); } } + LLE_WUNLOCK(ln); } static void @@ -472,6 +477,10 @@ nd6_llinfo_timer(void *arg) CURVNET_SET(ifp->if_vnet); INIT_VNET_INET6(curvnet); + /* + * llentry is refcounted - we shouldn't need to protect it + * with IF_AFDATA + */ IF_AFDATA_LOCK(ifp); if (ln->ln_ntick > 0) { @@ -483,7 +492,7 @@ nd6_llinfo_timer(void *arg) nd6_llinfo_settimer(ln, ln->ln_ntick); } IF_AFDATA_UNLOCK(ifp); - return; + goto done; } ndi = ND_IFINFO(ifp); @@ -491,13 +500,13 @@ nd6_llinfo_timer(void *arg) if ((ln->la_flags & LLE_STATIC) || (ln->la_expire > time_second)) { IF_AFDATA_UNLOCK(ifp); - return; + goto done; } if (ln->la_flags & LLE_DELETED) { (void)nd6_free(ln, 0); IF_AFDATA_UNLOCK(ifp); - return; + goto done; } switch (ln->ln_state) { @@ -567,6 +576,8 @@ nd6_llinfo_timer(void *arg) } IF_AFDATA_UNLOCK(ifp); CURVNET_RESTORE(); +done: + LLE_FREE_LOCKED(ln); } @@ -853,27 +864,28 @@ nd6_purge(struct ifnet *ifp) #endif } - - /* Qing * the caller acquires and releases the lock on the lltbls */ struct llentry * -nd6_lookup(struct in6_addr *addr6, int create, struct ifnet *ifp) +nd6_lookup(struct in6_addr *addr6, int flags, struct ifnet *ifp) { INIT_VNET_INET6(curvnet); struct sockaddr_in6 sin6; struct llentry *ln; - int flags = 0; - + int llflags = 0; + bzero(&sin6, sizeof(sin6)); sin6.sin6_len = sizeof(struct sockaddr_in6); sin6.sin6_family = AF_INET6; sin6.sin6_addr = *addr6; - if (create) - flags |= LLE_CREATE; - ln = lla_lookup(LLTABLE6(ifp), flags, (struct sockaddr *)&sin6); + if (flags & ND6_CREATE) + llflags |= LLE_CREATE; + if (flags & ND6_EXCLUSIVE) + llflags |= LLE_EXCLUSIVE; + + ln = lla_lookup(LLTABLE6(ifp), llflags, (struct sockaddr *)&sin6); if ((ln != NULL) && (flags & LLE_CREATE)) { ln->ln_state = ND6_LLINFO_NOSTATE; callout_init(&ln->ln_timer_ch, 0); @@ -964,7 +976,9 @@ nd6_is_new_addr_neighbor(struct sockaddr int nd6_is_addr_neighbor(struct sockaddr_in6 *addr, struct ifnet *ifp) { - + struct llentry *lle; + int rc = 0; + if (nd6_is_new_addr_neighbor(addr, ifp)) return (1); @@ -973,12 +987,12 @@ nd6_is_addr_neighbor(struct sockaddr_in6 * in the neighbor cache. */ IF_AFDATA_LOCK(ifp); - if (nd6_lookup(&addr->sin6_addr, 0, ifp) != NULL) { - IF_AFDATA_UNLOCK(ifp); - return (1); + if ((lle = nd6_lookup(&addr->sin6_addr, 0, ifp)) != NULL) { + LLE_RUNLOCK(lle); + rc = 1; } IF_AFDATA_UNLOCK(ifp); - return (0); + return (rc); } /* @@ -1104,15 +1118,13 @@ nd6_nud_hint(struct rtentry *rt, struct return; IF_AFDATA_LOCK(ifp); - if ((ln = nd6_lookup(dst6, 0, NULL)) == NULL) { - IF_AFDATA_UNLOCK(ifp); + ln = nd6_lookup(dst6, ND6_EXCLUSIVE, NULL); + IF_AFDATA_UNLOCK(ifp); + if (ln == NULL) return; - } - if (ln->ln_state < ND6_LLINFO_REACHABLE) { - IF_AFDATA_UNLOCK(ifp); - return; - } + if (ln->ln_state < ND6_LLINFO_REACHABLE) + goto done; /* * if we get upper-layer reachability confirmation many times, @@ -1121,17 +1133,17 @@ nd6_nud_hint(struct rtentry *rt, struct if (!force) { ln->ln_byhint++; if (ln->ln_byhint > V_nd6_maxnudhint) { - IF_AFDATA_UNLOCK(ifp); - return; + goto done; } } - ln->ln_state = ND6_LLINFO_REACHABLE; + ln->ln_state = ND6_LLINFO_REACHABLE; if (!ND6_LLINFO_PERMANENT(ln)) { nd6_llinfo_settimer(ln, (long)ND_IFINFO(rt->rt_ifp)->reachable * hz); } - IF_AFDATA_UNLOCK(ifp); +done: + LLE_WUNLOCK(ln); } @@ -1342,17 +1354,18 @@ nd6_ioctl(u_long cmd, caddr_t data, stru return (error); IF_AFDATA_LOCK(ifp); - if ((ln = nd6_lookup(&nb_addr, 0, ifp)) == NULL) { + ln = nd6_lookup(&nb_addr, 0, ifp); + IF_AFDATA_UNLOCK(ifp); + + if (ln == NULL) { error = EINVAL; - IF_AFDATA_UNLOCK(ifp); break; } nbi->state = ln->ln_state; nbi->asked = ln->la_asked; nbi->isrouter = ln->ln_router; nbi->expire = ln->la_expire; - IF_AFDATA_UNLOCK(ifp); - + LLE_RUNLOCK(ln); break; } case SIOCGDEFIFACE_IN6: /* XXX: should be implemented as a sysctl? */ @@ -1385,6 +1398,7 @@ nd6_cache_lladdr(struct ifnet *ifp, stru int do_update; int olladdr; int llchange; + int flags = 0; int newstate = 0; if (ifp == NULL) @@ -1405,27 +1419,25 @@ nd6_cache_lladdr(struct ifnet *ifp, stru * Spec says nothing in sections for RA, RS and NA. There's small * description on it in NS section (RFC 2461 7.2.3). */ - ln = nd6_lookup(from, 0, ifp); + flags |= lladdr ? ND6_EXCLUSIVE : 0; + ln = nd6_lookup(from, flags, ifp); if (ln == NULL) { - ln = nd6_lookup(from, 1, ifp); + ln = nd6_lookup(from, flags |ND6_CREATE, ifp); is_newentry = 1; } else { /* do nothing if static ndp is set */ if (ln->la_flags & LLE_STATIC) - return NULL; + goto done; is_newentry = 0; } - if (ln == NULL) { - return NULL; - } + if (ln == NULL) + return (NULL); olladdr = (ln->la_flags & LLE_VALID) ? 1 : 0; if (olladdr && lladdr) { - if (bcmp(lladdr, &ln->ll_addr, ifp->if_addrlen)) - llchange = 1; - else - llchange = 0; + llchange = bcmp(lladdr, &ln->ll_addr, + ifp->if_addrlen); } else llchange = 0; @@ -1588,8 +1600,16 @@ nd6_cache_lladdr(struct ifnet *ifp, stru */ if (do_update && ln->ln_router && !V_ip6_forwarding && V_ip6_accept_rtadv) defrouter_select(); - - return ln; +done: + if (ln) { + if (ln->la_flags & LLE_STATIC) + ln = NULL; + if (lladdr) + LLE_WUNLOCK(ln); + else + LLE_RUNLOCK(ln); + } + return (ln); } static void @@ -1623,6 +1643,14 @@ nd6_slowtimo(void *arg) CURVNET_RESTORE(); } +/* + * Note that I'm not enforcing any global serialization + * lle state or asked changes here as the logic is too + * complicated to avoid having to always acquire an exclusive + * lock + * KMM + * + */ #define senderr(e) { error = (e); goto bad;} int nd6_output(struct ifnet *ifp, struct ifnet *origifp, struct mbuf *m0, @@ -1633,6 +1661,7 @@ nd6_output(struct ifnet *ifp, struct ifn struct rtentry *rt = rt0; struct llentry *ln = NULL; int error = 0; + int flags = 0; if (IN6_IS_ADDR_MULTICAST(&dst->sin6_addr)) goto sendpkt; @@ -1650,6 +1679,7 @@ nd6_output(struct ifnet *ifp, struct ifn * At this point, the destination of the packet must be a unicast * or an anycast address(i.e. not a multicast). */ + flags = m ? LLE_EXCLUSIVE : 0; ln = lla_lookup(LLTABLE6(ifp), 0, (struct sockaddr *)dst); if ((ln == NULL) && nd6_is_addr_neighbor(dst, ifp)) { /* @@ -1657,7 +1687,8 @@ nd6_output(struct ifnet *ifp, struct ifn * the condition below is not very efficient. But we believe * it is tolerable, because this should be a rare case. */ - ln = nd6_lookup(&dst->sin6_addr, 1, ifp); + flags = ND6_CREATE | (m ? ND6_EXCLUSIVE : 0); + ln = nd6_lookup(&dst->sin6_addr, flags, ifp); } if (ln == NULL) { if ((ifp->if_flags & IFF_POINTOPOINT) == 0 && @@ -1742,6 +1773,11 @@ nd6_output(struct ifnet *ifp, struct ifn (long)ND_IFINFO(ifp)->retrans * hz / 1000); nd6_ns_output(ifp, NULL, &dst->sin6_addr, ln, 0); } + if (m0) + LLE_WUNLOCK(ln); + else + LLE_RUNLOCK(ln); + return (0); sendpkt: @@ -1762,6 +1798,12 @@ nd6_output(struct ifnet *ifp, struct ifn return (error); bad: + if (ln) { + if (m0) + LLE_WUNLOCK(ln); + else + LLE_RUNLOCK(ln); + } if (m) m_freem(m); return (error); Modified: user/kmacy/head_arpv2/sys/netinet6/nd6.h ============================================================================== --- user/kmacy/head_arpv2/sys/netinet6/nd6.h Sun Dec 7 06:34:50 2008 (r185737) +++ user/kmacy/head_arpv2/sys/netinet6/nd6.h Sun Dec 7 07:02:26 2008 (r185738) @@ -85,6 +85,9 @@ struct nd_ifinfo { */ #define ND6_IFF_DONT_SET_IFROUTE 0x10 +#define ND6_CREATE 0x1 +#define ND6_EXCLUSIVE 0x2 + #ifdef _KERNEL #define ND_IFINFO(ifp) \ (((struct in6_ifextra *)(ifp)->if_afdata[AF_INET6])->nd_ifinfo) From owner-svn-src-user@FreeBSD.ORG Mon Dec 8 06:53:54 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 528A9106564A; Mon, 8 Dec 2008 06:53:54 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 41BEE8FC08; Mon, 8 Dec 2008 06:53:54 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB86rsaH049416; Mon, 8 Dec 2008 06:53:54 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB86rsFF049414; Mon, 8 Dec 2008 06:53:54 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812080653.mB86rsFF049414@svn.freebsd.org> From: Kip Macy Date: Mon, 8 Dec 2008 06:53:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185759 - user/kmacy/HEAD_fast_multi_xmit/sys/netinet6 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Dec 2008 06:53:54 -0000 Author: kmacy Date: Mon Dec 8 06:53:53 2008 New Revision: 185759 URL: http://svn.freebsd.org/changeset/base/185759 Log: replace rtfree with RTFREE Modified: user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/in6_gif.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/nd6_nbr.c Modified: user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/in6_gif.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/in6_gif.c Mon Dec 8 03:48:03 2008 (r185758) +++ user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/in6_gif.c Mon Dec 8 06:53:53 2008 (r185759) @@ -375,10 +375,10 @@ gif_validate6(const struct ip6_hdr *ip6, ip6_sprintf(ip6buf, &sin6.sin6_addr)); #endif if (rt) - rtfree(rt); - return 0; + RTFREE(rt); + return (0); } - rtfree(rt); + RTFREE(rt); } return 128 * 2; Modified: user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/nd6_nbr.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/nd6_nbr.c Mon Dec 8 03:48:03 2008 (r185758) +++ user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/nd6_nbr.c Mon Dec 8 06:53:53 2008 (r185759) @@ -255,7 +255,7 @@ nd6_ns_input(struct mbuf *m, int off, in need_proxy = (rt && (rt->rt_flags & RTF_ANNOUNCE) != 0 && rt->rt_gateway->sa_family == AF_LINK); if (rt) - rtfree(rt); + RTFREE(rt); if (need_proxy) { /* * proxy NDP for single entry From owner-svn-src-user@FreeBSD.ORG Mon Dec 8 06:54:25 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0DC51065670; Mon, 8 Dec 2008 06:54:24 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E05B68FC1A; Mon, 8 Dec 2008 06:54:24 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB86sOjK049462; Mon, 8 Dec 2008 06:54:24 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB86sOeR049461; Mon, 8 Dec 2008 06:54:24 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812080654.mB86sOeR049461@svn.freebsd.org> From: Kip Macy Date: Mon, 8 Dec 2008 06:54:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185760 - user/kmacy/HEAD_fast_multi_xmit/sys/netinet6 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Dec 2008 06:54:25 -0000 Author: kmacy Date: Mon Dec 8 06:54:24 2008 New Revision: 185760 URL: http://svn.freebsd.org/changeset/base/185760 Log: replace rtfree with RTFREE Modified: user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/in6_ifattach.c Modified: user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/in6_ifattach.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/in6_ifattach.c Mon Dec 8 06:53:53 2008 (r185759) +++ user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/in6_ifattach.c Mon Dec 8 06:54:24 2008 (r185760) @@ -778,7 +778,7 @@ in6_ifdetach(struct ifnet *ifp) if ((ia->ia_flags & IFA_ROUTE) && (rt = rtalloc1((struct sockaddr *)&ia->ia_addr, 0, 0UL))) { rtflags = rt->rt_flags; - rtfree(rt); + RTFREE(rt); rtrequest(RTM_DELETE, (struct sockaddr *)&ia->ia_addr, (struct sockaddr *)&ia->ia_addr, (struct sockaddr *)&ia->ia_prefixmask, From owner-svn-src-user@FreeBSD.ORG Tue Dec 9 04:54:17 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1921106564A; Tue, 9 Dec 2008 04:54:17 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF51F8FC13; Tue, 9 Dec 2008 04:54:17 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB94sHur080438; Tue, 9 Dec 2008 04:54:17 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB94sHgZ080428; Tue, 9 Dec 2008 04:54:17 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812090454.mB94sHgZ080428@svn.freebsd.org> From: Kip Macy Date: Tue, 9 Dec 2008 04:54:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185785 - in user/kmacy/head_arpv2/sys: net netinet netinet6 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Dec 2008 04:54:18 -0000 Author: kmacy Date: Tue Dec 9 04:54:17 2008 New Revision: 185785 URL: http://svn.freebsd.org/changeset/base/185785 Log: - remove a number of cases of IF_AFDATA_LOCK recursion - implement LLE_EXCLUSIVE - implement LLE_FREE Modified: user/kmacy/head_arpv2/sys/net/if_llatbl.c user/kmacy/head_arpv2/sys/net/if_llatbl.h user/kmacy/head_arpv2/sys/net/if_var.h user/kmacy/head_arpv2/sys/netinet/if_ether.c user/kmacy/head_arpv2/sys/netinet/in.c user/kmacy/head_arpv2/sys/netinet/ip_output.c user/kmacy/head_arpv2/sys/netinet6/icmp6.c user/kmacy/head_arpv2/sys/netinet6/in6.c user/kmacy/head_arpv2/sys/netinet6/nd6.c user/kmacy/head_arpv2/sys/netinet6/nd6_nbr.c Modified: user/kmacy/head_arpv2/sys/net/if_llatbl.c ============================================================================== --- user/kmacy/head_arpv2/sys/net/if_llatbl.c Tue Dec 9 04:30:47 2008 (r185784) +++ user/kmacy/head_arpv2/sys/net/if_llatbl.c Tue Dec 9 04:54:17 2008 (r185785) @@ -213,10 +213,10 @@ lla_rt_output(struct rt_msghdr *rtm, str log(LOG_INFO, "%s: RTM_ADD publish " "(proxy only) is invalid\n", __func__); - rtfree(rt); + RTFREE(rt); return EINVAL; } - rtfree(rt); + RTFREE(rt); flags |= LLE_PROXY; } Modified: user/kmacy/head_arpv2/sys/net/if_llatbl.h ============================================================================== --- user/kmacy/head_arpv2/sys/net/if_llatbl.h Tue Dec 9 04:30:47 2008 (r185784) +++ user/kmacy/head_arpv2/sys/net/if_llatbl.h Tue Dec 9 04:54:17 2008 (r185785) @@ -77,6 +77,7 @@ struct llentry { #define LLE_WUNLOCK(lle) rw_wunlock(&(lle)->lle_lock) #define LLE_RUNLOCK(lle) rw_runlock(&(lle)->lle_lock) #define LLE_DOWNGRADE(lle) rw_downgrade(&(lle)->lle_lock) +#define LLE_TRY_UPGRADE(lle) rw_try_upgrade(&(lle)->lle_lock) #define LLE_LOCK_INIT(lle) rw_init_flags(&(lle)->lle_lock, "lle", RW_DUPOK) #define LLE_WLOCK_ASSERT(lle) rw_assert(&(lle)->lle_lock, RA_WLOCKED) @@ -105,6 +106,18 @@ struct llentry { lle = 0; \ } while (0) +#define LLE_FREE(lle) do { \ + LLE_WLOCK(lle); \ + if ((lle)->lle_refcnt <= 1) \ + (lle)->lle_tbl->llt_free((lle)->lle_tbl, (lle));\ + else { \ + (lle)->lle_refcnt--; \ + LLE_WUNLOCK(lle); \ + } \ + /* guard against invalid refs */ \ + lle = 0; \ +} while (0) + #define ln_timer_ch lle_timer.ln_timer_ch #define la_timer lle_timer.la_timer Modified: user/kmacy/head_arpv2/sys/net/if_var.h ============================================================================== --- user/kmacy/head_arpv2/sys/net/if_var.h Tue Dec 9 04:30:47 2008 (r185784) +++ user/kmacy/head_arpv2/sys/net/if_var.h Tue Dec 9 04:54:17 2008 (r185785) @@ -359,13 +359,15 @@ typedef void (*group_change_event_handle EVENTHANDLER_DECLARE(group_change_event, group_change_event_handler_t); #define IF_AFDATA_LOCK_INIT(ifp) \ - mtx_init(&(ifp)->if_afdata_mtx, "if_afdata", NULL, \ - (MTX_DEF | MTX_RECURSE)) + mtx_init(&(ifp)->if_afdata_mtx, "if_afdata", NULL, MTX_DEF) #define IF_AFDATA_LOCK(ifp) mtx_lock(&(ifp)->if_afdata_mtx) #define IF_AFDATA_TRYLOCK(ifp) mtx_trylock(&(ifp)->if_afdata_mtx) #define IF_AFDATA_UNLOCK(ifp) mtx_unlock(&(ifp)->if_afdata_mtx) #define IF_AFDATA_DESTROY(ifp) mtx_destroy(&(ifp)->if_afdata_mtx) +#define IF_AFDATA_LOCK_ASSERT(ifp) mtx_assert(&(ifp)->if_afdata_mtx, MA_OWNED) +#define IF_AFDATA_UNLOCK_ASSERT(ifp) mtx_assert(&(ifp)->if_afdata_mtx, MA_NOTOWNED) + #define IFF_LOCKGIANT(ifp) do { \ if ((ifp)->if_flags & IFF_NEEDSGIANT) \ mtx_lock(&Giant); \ Modified: user/kmacy/head_arpv2/sys/netinet/if_ether.c ============================================================================== --- user/kmacy/head_arpv2/sys/netinet/if_ether.c Tue Dec 9 04:30:47 2008 (r185784) +++ user/kmacy/head_arpv2/sys/netinet/if_ether.c Tue Dec 9 04:54:17 2008 (r185785) @@ -156,15 +156,22 @@ arptimer(void *arg) return; } ifp = lle->lle_tbl->llt_ifp; - IF_AFDATA_LOCK(ifp); if ((lle->la_flags & LLE_DELETED) || (time_second >= lle->la_expire)) { + printf("deleting entry\n"); + + IF_AFDATA_LOCK(ifp); if (!callout_pending(&lle->la_timer) && (callout_active(&lle->la_timer))) { (void)llentry_free(lle); } + IF_AFDATA_UNLOCK(ifp); + } else { + /* + * Still valid, just drop our reference + */ + LLE_FREE(lle); } - IF_AFDATA_UNLOCK(ifp); } @@ -251,6 +258,7 @@ arpresolve(struct ifnet *ifp, struct rte u_int flags; int error; + log(LOG_DEBUG, "arpesolve called\n"); *lle = NULL; if (m != NULL) { if (m->m_flags & M_BCAST) { @@ -280,11 +288,12 @@ arpresolve(struct ifnet *ifp, struct rte "arpresolve: can't allocate llinfo for %s\n", inet_ntoa(SIN(dst)->sin_addr)); m_freem(m); + log(LOG_DEBUG, "arpesolve: lla_lookup fail\n"); return (EINVAL); } - if (la->la_flags & LLE_VALID && - (la->la_flags & LLE_STATIC || la->la_expire > time_uptime)) { + if ((la->la_flags & LLE_VALID) && + ((la->la_flags & LLE_STATIC) || (la->la_expire > time_uptime))) { bcopy(&la->ll_addr, desten, ifp->if_addrlen); /* * If entry has an expiry time and it is approaching, @@ -297,12 +306,18 @@ arpresolve(struct ifnet *ifp, struct rte &SIN(dst)->sin_addr, IF_LLADDR(ifp)); la->la_preempt--; - } + } + log(LOG_DEBUG, "arpresolve: success\n"); + *lle = la; error = 0; goto done; - } - + } else + log(LOG_DEBUG, + "la=%p valid=%d static=%d expire=%ld uptime=%ld\n", la, + !!(la->la_flags & LLE_VALID), !!(la->la_flags & LLE_STATIC), + la->la_expire, time_uptime); + if (la->la_flags & LLE_STATIC) { /* should not happen! */ log(LOG_DEBUG, "arpresolve: ouch, empty static llinfo for %s\n", inet_ntoa(SIN(dst)->sin_addr)); @@ -319,7 +334,8 @@ arpresolve(struct ifnet *ifp, struct rte if (la->la_hold) m_freem(la->la_hold); la->la_hold = m; - LLE_DOWNGRADE(la); + if (!(la->la_asked == 0 || la->la_expire != time_uptime)) + LLE_DOWNGRADE(la); } /* * Return EWOULDBLOCK if we have tried less than arp_maxtries. It @@ -334,12 +350,17 @@ arpresolve(struct ifnet *ifp, struct rte (rt0->rt_flags & RTF_GATEWAY) ? EHOSTDOWN : EHOSTUNREACH; if (la->la_asked == 0 || la->la_expire != time_uptime) { + log(LOG_DEBUG, + "arpresolve: kicking off new resolve expire=%ld\n", + la->la_expire); + LLE_ADDREF(la); la->la_expire = time_uptime; callout_reset(&la->la_timer, hz, arptimer, la); la->la_asked++; - + LLE_WUNLOCK(la); arprequest(ifp, NULL, &SIN(dst)->sin_addr, IF_LLADDR(ifp)); + return (error); } done: @@ -435,6 +456,7 @@ in_arpinput(struct mbuf *m) struct in_addr isaddr, itaddr, myaddr; u_int8_t *enaddr = NULL; int op, flags; + struct mbuf *m0; /* , rif_len; */ @@ -529,6 +551,7 @@ in_arpinput(struct mbuf *m) if (!bridged || (ia = TAILQ_FIRST(&V_in_ifaddrhead)) == NULL) goto drop; match: + log(LOG_DEBUG,"in_arpinput: match\n"); if (!enaddr) enaddr = (u_int8_t *)IF_LLADDR(ifp); myaddr = ia->ia_addr.sin_addr; @@ -567,12 +590,13 @@ match: la = lla_lookup(LLTABLE(ifp), flags, (struct sockaddr *)&sin); IF_AFDATA_UNLOCK(ifp); if (la != NULL) { + log(LOG_DEBUG, "in_arpinput: la found\n"); /* the following is not an error when doing bridging */ if (!bridged && la->lle_tbl->llt_ifp != ifp #ifdef DEV_CARP && (ifp->if_type != IFT_CARP || !carp_match) #endif - ) { + ) { if (log_arp_wrong_iface) log(LOG_ERR, "arp: %s is on %s " "but got reply from %*D on %s\n", @@ -582,9 +606,9 @@ match: ifp->if_xname); goto reply; } - - if (la->la_flags & LLE_VALID && + if ((la->la_flags & LLE_VALID) && bcmp(ar_sha(ah), &la->ll_addr, ifp->if_addrlen)) { + log(LOG_DEBUG, "LLE_VALID and match\n"); if (la->la_flags & LLE_STATIC) { log(LOG_ERR, "arp: %*D attempts to modify permanent " @@ -603,6 +627,7 @@ match: ifp->if_xname); } } + if (ifp->if_addrlen != ah->ar_hln) { log(LOG_WARNING, "arp from %*D: addr len: new %d, i/f %d (ignored)", @@ -613,6 +638,7 @@ match: (void)memcpy(&la->ll_addr, ar_sha(ah), ifp->if_addrlen); la->la_flags |= LLE_VALID; + log(LOG_DEBUG, "in_arpinput: la=%p valid set\n", la); if (!(la->la_flags & LLE_STATIC)) { la->la_expire = time_uptime + arpt_keep; callout_reset(&la->la_timer, hz * V_arpt_keep, @@ -621,8 +647,13 @@ match: la->la_asked = 0; la->la_preempt = V_arp_maxtries; if (la->la_hold) { - (*ifp->if_output)(ifp, la->la_hold, L3_ADDR(la), NULL); + m0 = la->la_hold; la->la_hold = 0; + memcpy(&sa, L3_ADDR(la), sizeof(sa)); + LLE_WUNLOCK(la); + + (*ifp->if_output)(ifp, m0, &sa, NULL); + return; } } reply: @@ -639,7 +670,6 @@ reply: goto drop; sin.sin_addr = itaddr; - /* XXX MRT use table 0 for arp reply */ rt = in_rtalloc1((struct sockaddr *)&sin, 0, 0UL, 0); if (!rt) @@ -650,12 +680,12 @@ reply: * over who claims what Ether address. */ if (rt->rt_ifp == ifp) { - rtfree(rt); + RTFREE(rt); goto drop; } (void)memcpy(ar_tha(ah), ar_sha(ah), ah->ar_hln); (void)memcpy(ar_sha(ah), enaddr, ah->ar_hln); - rtfree(rt); + RTFREE(rt); /* * Also check that the node which sent the ARP packet @@ -674,10 +704,10 @@ reply: " from %s via %s, expecting %s\n", inet_ntoa(isaddr), ifp->if_xname, rt->rt_ifp->if_xname); - rtfree(rt); + RTFREE(rt); goto drop; } - rtfree(rt); + RTFREE(rt); #ifdef DEBUG_PROXY printf("arp: proxying for %s\n", Modified: user/kmacy/head_arpv2/sys/netinet/in.c ============================================================================== --- user/kmacy/head_arpv2/sys/netinet/in.c Tue Dec 9 04:30:47 2008 (r185784) +++ user/kmacy/head_arpv2/sys/netinet/in.c Tue Dec 9 04:54:17 2008 (r185785) @@ -1077,10 +1077,10 @@ in_lltable_rtcheck(struct ifnet *ifp, co log(LOG_INFO, "IPv4 address: \"%s\" is not on the network\n", inet_ntoa(((const struct sockaddr_in *)l3addr)->sin_addr)); if (rt != NULL) - rtfree(rt); - return EINVAL; + RTFREE_LOCKED(rt); + return (EINVAL); } - rtfree(rt); + RTFREE_LOCKED(rt); return 0; } @@ -1110,17 +1110,14 @@ in_lltable_lookup(struct lltable *llt, u break; } - if (lle != NULL ) { - if (flags & LLE_DELETE) { - LLE_WLOCK(lle); - lle->la_flags = LLE_DELETED; - LLE_WUNLOCK(lle); + if ((lle != NULL) && (flags & LLE_DELETE)) { + LLE_WLOCK(lle); + lle->la_flags = LLE_DELETED; + LLE_WUNLOCK(lle); #ifdef INVARIANTS - log(LOG_INFO, "ifaddr cache = %p is deleted\n", lle); + log(LOG_INFO, "ifaddr cache = %p is deleted\n", lle); #endif - lle = NULL; - } else - LLE_RLOCK(lle); + lle = NULL; } else { #ifdef INVARIANTS if (flags & LLE_DELETE) @@ -1150,9 +1147,14 @@ in_lltable_lookup(struct lltable *llt, u lle->lle_tbl = llt; lle->lle_head = lleh; - LLE_RLOCK(lle); LIST_INSERT_HEAD(lleh, lle, lle_next); } + if (lle) { + if (flags & LLE_EXCLUSIVE) + LLE_WLOCK(lle); + else + LLE_RLOCK(lle); + } done: return (lle); } Modified: user/kmacy/head_arpv2/sys/netinet/ip_output.c ============================================================================== --- user/kmacy/head_arpv2/sys/netinet/ip_output.c Tue Dec 9 04:30:47 2008 (r185784) +++ user/kmacy/head_arpv2/sys/netinet/ip_output.c Tue Dec 9 04:54:17 2008 (r185785) @@ -567,11 +567,8 @@ passout: * to avoid confusing lower layers. */ m->m_flags &= ~(M_PROTOFLAGS); - - IF_AFDATA_LOCK(ifp); error = (*ifp->if_output)(ifp, m, (struct sockaddr *)dst, ro->ro_rt); - IF_AFDATA_UNLOCK(ifp); goto done; } @@ -604,10 +601,8 @@ passout: */ m->m_flags &= ~(M_PROTOFLAGS); - IF_AFDATA_LOCK(ifp); error = (*ifp->if_output)(ifp, m, (struct sockaddr *)dst, ro->ro_rt); - IF_AFDATA_UNLOCK(ifp); } else m_freem(m); } Modified: user/kmacy/head_arpv2/sys/netinet6/icmp6.c ============================================================================== --- user/kmacy/head_arpv2/sys/netinet6/icmp6.c Tue Dec 9 04:30:47 2008 (r185784) +++ user/kmacy/head_arpv2/sys/netinet6/icmp6.c Tue Dec 9 04:54:17 2008 (r185785) @@ -2583,17 +2583,16 @@ icmp6_redirect_output(struct mbuf *m0, s IF_AFDATA_LOCK(ifp); ln = nd6_lookup(router_ll6, 0, ifp); - if (!ln) { - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_UNLOCK(ifp); + if (!ln) goto nolladdropt; - } + len = sizeof(*nd_opt) + ifp->if_addrlen; len = (len + 7) & ~7; /* round by 8 */ /* safety check */ - if (len + (p - (u_char *)ip6) > maxlen) { - IF_AFDATA_UNLOCK(ifp); + if (len + (p - (u_char *)ip6) > maxlen) goto nolladdropt; - } + if (ln->la_flags & LLE_VALID) { nd_opt = (struct nd_opt_hdr *)p; nd_opt->nd_opt_type = ND_OPT_TARGET_LINKADDR; @@ -2602,7 +2601,7 @@ icmp6_redirect_output(struct mbuf *m0, s bcopy(&ln->ll_addr, lladdr, ifp->if_addrlen); p += len; } - IF_AFDATA_UNLOCK(ifp); + LLE_RUNLOCK(ln); } nolladdropt:; Modified: user/kmacy/head_arpv2/sys/netinet6/in6.c ============================================================================== --- user/kmacy/head_arpv2/sys/netinet6/in6.c Tue Dec 9 04:30:47 2008 (r185784) +++ user/kmacy/head_arpv2/sys/netinet6/in6.c Tue Dec 9 04:54:17 2008 (r185785) @@ -2215,10 +2215,23 @@ in6_lltable_lookup(struct lltable *llt, lle->lle_head = lleh; LIST_INSERT_HEAD(lleh, lle, lle_next); } else { - if (flags & LLE_DELETE) + if (flags & LLE_DELETE) { + LLE_WLOCK(lle); lle->la_flags = LLE_DELETED; + LLE_WUNLOCK(lle); +#ifdef INVARIANTS + log(LOG_INFO, "ifaddr cache = %p is deleted\n", lle); +#endif + lle = NULL; + } + } + if (lle) { + if (flags & LLE_EXCLUSIVE) + LLE_WLOCK(lle); + else + LLE_RLOCK(lle); } - return lle; + return (lle); } static int Modified: user/kmacy/head_arpv2/sys/netinet6/nd6.c ============================================================================== --- user/kmacy/head_arpv2/sys/netinet6/nd6.c Tue Dec 9 04:30:47 2008 (r185784) +++ user/kmacy/head_arpv2/sys/netinet6/nd6.c Tue Dec 9 04:54:17 2008 (r185785) @@ -840,8 +840,12 @@ nd6_purge(struct ifnet *ifp) nd6_setdefaultiface(0); if (!V_ip6_forwarding && V_ip6_accept_rtadv) { /* XXX: too restrictive? */ - /* refresh default router list */ + /* refresh default router list + * + * + */ defrouter_select(); + } /* XXXXX @@ -851,21 +855,11 @@ nd6_purge(struct ifnet *ifp) * from if_detach() where everything gets purged. So let * in6_domifdetach() do the actual L2 table purging work. */ -#if 0 - /* - * Nuke neighbor cache entries for the ifp. - * Note that rt->rt_ifp may not be the same as ifp, - * due to KAME goto ours hack. See RTM_RESOLVE case in - * nd6_rtrequest(), and ip6_input(). - */ - IF_AFDATA_LOCK(ifp); - lltable_free(LLTABLE6(ifp)); - IF_AFDATA_UNLOCK(ifp); -#endif } /* Qing * the caller acquires and releases the lock on the lltbls + * Returns the llentry locked */ struct llentry * nd6_lookup(struct in6_addr *addr6, int flags, struct ifnet *ifp) @@ -880,6 +874,8 @@ nd6_lookup(struct in6_addr *addr6, int f sin6.sin6_family = AF_INET6; sin6.sin6_addr = *addr6; + IF_AFDATA_LOCK_ASSERT(ifp); + if (flags & ND6_CREATE) llflags |= LLE_CREATE; if (flags & ND6_EXCLUSIVE) @@ -890,6 +886,7 @@ nd6_lookup(struct in6_addr *addr6, int f ln->ln_state = ND6_LLINFO_NOSTATE; callout_init(&ln->ln_timer_ch, 0); } + return (ln); } @@ -978,7 +975,8 @@ nd6_is_addr_neighbor(struct sockaddr_in6 { struct llentry *lle; int rc = 0; - + + IF_AFDATA_UNLOCK_ASSERT(ifp); if (nd6_is_new_addr_neighbor(addr, ifp)) return (1); @@ -1401,6 +1399,8 @@ nd6_cache_lladdr(struct ifnet *ifp, stru int flags = 0; int newstate = 0; + IF_AFDATA_LOCK_ASSERT(ifp); + if (ifp == NULL) panic("ifp == NULL in nd6_cache_lladdr"); if (from == NULL) @@ -1598,16 +1598,27 @@ nd6_cache_lladdr(struct ifnet *ifp, stru * for those are not autoconfigured hosts, we explicitly avoid such * cases for safety. */ - if (do_update && ln->ln_router && !V_ip6_forwarding && V_ip6_accept_rtadv) + if (do_update && ln->ln_router && !V_ip6_forwarding && V_ip6_accept_rtadv) { +#ifdef notyet + /* + * XXX implement the boiler plate + */ + taskqueue_enqueue(ipv6_taskq, defrouter_select_task); +#endif + /* + * guaranteed recursion + */ defrouter_select(); + } + done: if (ln) { - if (ln->la_flags & LLE_STATIC) - ln = NULL; if (lladdr) LLE_WUNLOCK(ln); else LLE_RUNLOCK(ln); + if (ln->la_flags & LLE_STATIC) + ln = NULL; } return (ln); } @@ -1680,7 +1691,9 @@ nd6_output(struct ifnet *ifp, struct ifn * or an anycast address(i.e. not a multicast). */ flags = m ? LLE_EXCLUSIVE : 0; + IF_AFDATA_LOCK(rt->rt_ifp); ln = lla_lookup(LLTABLE6(ifp), 0, (struct sockaddr *)dst); + IF_AFDATA_UNLOCK(rt->rt_ifp); if ((ln == NULL) && nd6_is_addr_neighbor(dst, ifp)) { /* * Since nd6_is_addr_neighbor() internally calls nd6_lookup(), @@ -1688,7 +1701,9 @@ nd6_output(struct ifnet *ifp, struct ifn * it is tolerable, because this should be a rare case. */ flags = ND6_CREATE | (m ? ND6_EXCLUSIVE : 0); + IF_AFDATA_LOCK(rt->rt_ifp); ln = nd6_lookup(&dst->sin6_addr, flags, ifp); + IF_AFDATA_UNLOCK(rt->rt_ifp); } if (ln == NULL) { if ((ifp->if_flags & IFF_POINTOPOINT) == 0 && @@ -1700,7 +1715,6 @@ nd6_output(struct ifnet *ifp, struct ifn ip6_sprintf(ip6buf, &dst->sin6_addr), ln, rt); senderr(EIO); /* XXX: good error? */ } - goto sendpkt; /* send anyway */ } @@ -1786,6 +1800,12 @@ nd6_output(struct ifnet *ifp, struct ifn error = ENETDOWN; /* better error? */ goto bad; } + if (ln) { + if (m0) + LLE_WUNLOCK(ln); + else + LLE_RUNLOCK(ln); + } #ifdef MAC mac_netinet6_nd6_send(ifp, m); Modified: user/kmacy/head_arpv2/sys/netinet6/nd6_nbr.c ============================================================================== --- user/kmacy/head_arpv2/sys/netinet6/nd6_nbr.c Tue Dec 9 04:30:47 2008 (r185784) +++ user/kmacy/head_arpv2/sys/netinet6/nd6_nbr.c Tue Dec 9 04:54:17 2008 (r185785) @@ -115,7 +115,7 @@ nd6_ns_input(struct mbuf *m, int off, in struct ifaddr *ifa = NULL; int lladdrlen = 0; int anycast = 0, proxy = 0, tentative = 0; - int tlladdr; + int tlladdr, error; union nd_opts ndopts; struct sockaddr_dl *proxydl = NULL; char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN]; @@ -169,7 +169,8 @@ nd6_ns_input(struct mbuf *m, int off, in src_sa6.sin6_family = AF_INET6; src_sa6.sin6_len = sizeof(src_sa6); src_sa6.sin6_addr = saddr6; - if (!nd6_is_addr_neighbor(&src_sa6, ifp)) { + error = nd6_is_addr_neighbor(&src_sa6, ifp); + if (error) { nd6log((LOG_INFO, "nd6_ns_input: " "NS packet from non-neighbor\n")); goto bad; @@ -701,8 +702,8 @@ nd6_na_input(struct mbuf *m, int off, in */ IF_AFDATA_LOCK(ifp); ln = nd6_lookup(&taddr6, 0, ifp); + IF_AFDATA_UNLOCK(ifp); if (ln == NULL) { - IF_AFDATA_UNLOCK(ifp); goto freeit; } @@ -712,7 +713,6 @@ nd6_na_input(struct mbuf *m, int off, in * discard the packet. */ if (ifp->if_addrlen && lladdr == NULL) { - IF_AFDATA_UNLOCK(ifp); goto freeit; } @@ -786,7 +786,6 @@ nd6_na_input(struct mbuf *m, int off, in ln->ln_state = ND6_LLINFO_STALE; nd6_llinfo_settimer(ln, (long)V_nd6_gctimer * hz); } - IF_AFDATA_UNLOCK(ifp); goto freeit; } else if (is_override /* (2a) */ || (!is_override && (lladdr != NULL && !llchange)) /* (2b) */ @@ -883,8 +882,6 @@ nd6_na_input(struct mbuf *m, int off, in nd6_output(ifp, ifp, m_hold, L3_ADDR_SIN6(ln), NULL); } } - IF_AFDATA_UNLOCK(ifp); - freeit: m_freem(m); return; From owner-svn-src-user@FreeBSD.ORG Tue Dec 9 05:02:18 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BEA18106564A; Tue, 9 Dec 2008 05:02:18 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A96A18FC0C; Tue, 9 Dec 2008 05:02:18 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB952IVB080704; Tue, 9 Dec 2008 05:02:18 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB952HE5080680; Tue, 9 Dec 2008 05:02:17 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812090502.mB952HE5080680@svn.freebsd.org> From: Kip Macy Date: Tue, 9 Dec 2008 05:02:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185786 - in user/kmacy/head_arpv2/sys: amd64/amd64 arm/mv arm/mv/orion boot/common boot/forth boot/i386/boot0 boot/i386/btx/btxldr boot/zfs cddl/contrib/opensolaris/uts/common/sys comp... X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Dec 2008 05:02:18 -0000 Author: kmacy Date: Tue Dec 9 05:02:17 2008 New Revision: 185786 URL: http://svn.freebsd.org/changeset/base/185786 Log: IFC 185596:185785 Added: user/kmacy/head_arpv2/sys/xen/xenbus/xenbus_if.m user/kmacy/head_arpv2/sys/xen/xenbus/xenbusvar.h Deleted: user/kmacy/head_arpv2/sys/i386/include/xen/xenbus.h Modified: user/kmacy/head_arpv2/sys/amd64/amd64/db_trace.c user/kmacy/head_arpv2/sys/amd64/amd64/pmap.c user/kmacy/head_arpv2/sys/arm/mv/mv_pci.c user/kmacy/head_arpv2/sys/arm/mv/orion/std.db88f5xxx user/kmacy/head_arpv2/sys/boot/common/loader.8 user/kmacy/head_arpv2/sys/boot/forth/support.4th user/kmacy/head_arpv2/sys/boot/i386/boot0/boot0.S user/kmacy/head_arpv2/sys/boot/i386/btx/btxldr/btxldr.S user/kmacy/head_arpv2/sys/boot/zfs/Makefile user/kmacy/head_arpv2/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h user/kmacy/head_arpv2/sys/compat/linprocfs/linprocfs.c user/kmacy/head_arpv2/sys/conf/files user/kmacy/head_arpv2/sys/contrib/pf/net/pf_table.c user/kmacy/head_arpv2/sys/dev/adb/adb.h user/kmacy/head_arpv2/sys/dev/adb/adb_bus.c user/kmacy/head_arpv2/sys/dev/adb/adb_kbd.c user/kmacy/head_arpv2/sys/dev/adb/adb_mouse.c user/kmacy/head_arpv2/sys/dev/adb/adbvar.h user/kmacy/head_arpv2/sys/dev/ae/if_ae.c user/kmacy/head_arpv2/sys/dev/ath/if_ath.c user/kmacy/head_arpv2/sys/dev/ath/if_athvar.h user/kmacy/head_arpv2/sys/dev/cxgb/common/cxgb_ael1002.c user/kmacy/head_arpv2/sys/dev/cxgb/common/cxgb_t3_hw.c user/kmacy/head_arpv2/sys/dev/cxgb/cxgb_main.c user/kmacy/head_arpv2/sys/dev/dc/if_dc.c user/kmacy/head_arpv2/sys/dev/dc/if_dcreg.h user/kmacy/head_arpv2/sys/dev/e1000/if_em.c user/kmacy/head_arpv2/sys/dev/fxp/if_fxp.c user/kmacy/head_arpv2/sys/dev/jme/if_jmereg.h user/kmacy/head_arpv2/sys/dev/jme/if_jmevar.h user/kmacy/head_arpv2/sys/dev/mmc/mmc.c user/kmacy/head_arpv2/sys/dev/mmc/mmcsd.c user/kmacy/head_arpv2/sys/dev/pccbb/pccbb.c user/kmacy/head_arpv2/sys/dev/pccbb/pccbb_pci.c user/kmacy/head_arpv2/sys/dev/pccbb/pccbbvar.h user/kmacy/head_arpv2/sys/dev/re/if_re.c user/kmacy/head_arpv2/sys/dev/sdhci/sdhci.c user/kmacy/head_arpv2/sys/dev/sis/if_sis.c user/kmacy/head_arpv2/sys/dev/sis/if_sisreg.h user/kmacy/head_arpv2/sys/dev/usb/if_ural.c user/kmacy/head_arpv2/sys/dev/xen/blkfront/blkfront.c user/kmacy/head_arpv2/sys/dev/xen/blkfront/block.h user/kmacy/head_arpv2/sys/dev/xen/netfront/netfront.c user/kmacy/head_arpv2/sys/fs/procfs/procfs_map.c user/kmacy/head_arpv2/sys/geom/geom_subr.c user/kmacy/head_arpv2/sys/geom/journal/g_journal.c user/kmacy/head_arpv2/sys/geom/journal/g_journal.h user/kmacy/head_arpv2/sys/i386/include/atomic.h user/kmacy/head_arpv2/sys/i386/xen/xen_machdep.c user/kmacy/head_arpv2/sys/kern/kern_exec.c user/kmacy/head_arpv2/sys/kern/kern_exit.c user/kmacy/head_arpv2/sys/kern/kern_fork.c user/kmacy/head_arpv2/sys/kern/kern_linker.c user/kmacy/head_arpv2/sys/kern/kern_module.c user/kmacy/head_arpv2/sys/kern/kern_proc.c user/kmacy/head_arpv2/sys/kern/kern_rwlock.c user/kmacy/head_arpv2/sys/kern/subr_param.c user/kmacy/head_arpv2/sys/kern/subr_witness.c user/kmacy/head_arpv2/sys/kern/vfs_export.c user/kmacy/head_arpv2/sys/libkern/iconv.c user/kmacy/head_arpv2/sys/net/radix.c user/kmacy/head_arpv2/sys/net/radix.h user/kmacy/head_arpv2/sys/net/route.c user/kmacy/head_arpv2/sys/net/route.h user/kmacy/head_arpv2/sys/net/rtsock.c user/kmacy/head_arpv2/sys/netgraph/ng_mppc.c user/kmacy/head_arpv2/sys/netinet/if_ether.c user/kmacy/head_arpv2/sys/netinet/in_pcb.c user/kmacy/head_arpv2/sys/netinet/in_pcb.h user/kmacy/head_arpv2/sys/netinet/ip_carp.c user/kmacy/head_arpv2/sys/netinet/sctp.h user/kmacy/head_arpv2/sys/netinet/sctp_asconf.c user/kmacy/head_arpv2/sys/netinet/sctp_asconf.h user/kmacy/head_arpv2/sys/netinet/sctp_auth.c user/kmacy/head_arpv2/sys/netinet/sctp_auth.h user/kmacy/head_arpv2/sys/netinet/sctp_constants.h user/kmacy/head_arpv2/sys/netinet/sctp_header.h user/kmacy/head_arpv2/sys/netinet/sctp_indata.c user/kmacy/head_arpv2/sys/netinet/sctp_indata.h user/kmacy/head_arpv2/sys/netinet/sctp_input.c user/kmacy/head_arpv2/sys/netinet/sctp_os_bsd.h user/kmacy/head_arpv2/sys/netinet/sctp_output.c user/kmacy/head_arpv2/sys/netinet/sctp_output.h user/kmacy/head_arpv2/sys/netinet/sctp_pcb.c user/kmacy/head_arpv2/sys/netinet/sctp_pcb.h user/kmacy/head_arpv2/sys/netinet/sctp_structs.h user/kmacy/head_arpv2/sys/netinet/sctp_sysctl.c user/kmacy/head_arpv2/sys/netinet/sctp_sysctl.h user/kmacy/head_arpv2/sys/netinet/sctp_timer.c user/kmacy/head_arpv2/sys/netinet/sctp_uio.h user/kmacy/head_arpv2/sys/netinet/sctp_usrreq.c user/kmacy/head_arpv2/sys/netinet/sctp_var.h user/kmacy/head_arpv2/sys/netinet/sctputil.c user/kmacy/head_arpv2/sys/netinet/sctputil.h user/kmacy/head_arpv2/sys/netinet/tcp_input.c user/kmacy/head_arpv2/sys/netinet6/in6_rmx.c user/kmacy/head_arpv2/sys/netinet6/nd6_rtr.c user/kmacy/head_arpv2/sys/netinet6/sctp6_usrreq.c user/kmacy/head_arpv2/sys/pci/if_rlreg.h user/kmacy/head_arpv2/sys/powerpc/conf/NOTES user/kmacy/head_arpv2/sys/powerpc/powermac/cuda.c user/kmacy/head_arpv2/sys/powerpc/powermac/cudavar.h user/kmacy/head_arpv2/sys/powerpc/powermac/macgpio.c user/kmacy/head_arpv2/sys/powerpc/powermac/macgpiovar.h user/kmacy/head_arpv2/sys/powerpc/powermac/pmu.c user/kmacy/head_arpv2/sys/powerpc/powermac/pmuvar.h user/kmacy/head_arpv2/sys/sys/module.h user/kmacy/head_arpv2/sys/sys/proc.h user/kmacy/head_arpv2/sys/sys/rwlock.h user/kmacy/head_arpv2/sys/ufs/ufs/ufs_quota.c user/kmacy/head_arpv2/sys/xen/gnttab.c user/kmacy/head_arpv2/sys/xen/gnttab.h user/kmacy/head_arpv2/sys/xen/xenbus/xenbus_client.c user/kmacy/head_arpv2/sys/xen/xenbus/xenbus_comms.c user/kmacy/head_arpv2/sys/xen/xenbus/xenbus_comms.h user/kmacy/head_arpv2/sys/xen/xenbus/xenbus_dev.c user/kmacy/head_arpv2/sys/xen/xenbus/xenbus_probe.c user/kmacy/head_arpv2/sys/xen/xenbus/xenbus_probe_backend.c user/kmacy/head_arpv2/sys/xen/xenbus/xenbus_xs.c Modified: user/kmacy/head_arpv2/sys/amd64/amd64/db_trace.c ============================================================================== --- user/kmacy/head_arpv2/sys/amd64/amd64/db_trace.c Tue Dec 9 04:54:17 2008 (r185785) +++ user/kmacy/head_arpv2/sys/amd64/amd64/db_trace.c Tue Dec 9 05:02:17 2008 (r185786) @@ -27,6 +27,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_compat.h" + #include #include #include @@ -318,6 +320,10 @@ db_nextframe(struct amd64_frame **fp, db frame_type = INTERRUPT; else if (strcmp(name, "Xfast_syscall") == 0) frame_type = SYSCALL; +#ifdef COMPAT_IA32 + else if (strcmp(name, "Xint0x80_syscall") == 0) + frame_type = SYSCALL; +#endif /* XXX: These are interrupts with trap frames. */ else if (strcmp(name, "Xtimerint") == 0 || strcmp(name, "Xcpustop") == 0 || Modified: user/kmacy/head_arpv2/sys/amd64/amd64/pmap.c ============================================================================== --- user/kmacy/head_arpv2/sys/amd64/amd64/pmap.c Tue Dec 9 04:54:17 2008 (r185785) +++ user/kmacy/head_arpv2/sys/amd64/amd64/pmap.c Tue Dec 9 05:02:17 2008 (r185786) @@ -180,7 +180,7 @@ pt_entry_t pg_nx; SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters"); -static int pg_ps_enabled; +static int pg_ps_enabled = 1; SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RD, &pg_ps_enabled, 0, "Are large page mappings enabled?"); Modified: user/kmacy/head_arpv2/sys/arm/mv/mv_pci.c ============================================================================== --- user/kmacy/head_arpv2/sys/arm/mv/mv_pci.c Tue Dec 9 04:54:17 2008 (r185785) +++ user/kmacy/head_arpv2/sys/arm/mv/mv_pci.c Tue Dec 9 05:02:17 2008 (r185786) @@ -598,6 +598,10 @@ pcib_mbus_init_bridge(struct pcib_mbus_s mem_limit = mem_base + sc->sc_info->op_mem_size - 1; /* Configure I/O decode registers */ + pcib_mbus_write_config(sc->sc_dev, bus, slot, func, PCIR_IOBASEL_1, + io_base >> 8, 1); + pcib_mbus_write_config(sc->sc_dev, bus, slot, func, PCIR_IOBASEH_1, + io_base >> 16, 2); pcib_mbus_write_config(sc->sc_dev, bus, slot, func, PCIR_IOLIMITL_1, io_limit >> 8, 1); pcib_mbus_write_config(sc->sc_dev, bus, slot, func, PCIR_IOLIMITH_1, Modified: user/kmacy/head_arpv2/sys/arm/mv/orion/std.db88f5xxx ============================================================================== --- user/kmacy/head_arpv2/sys/arm/mv/orion/std.db88f5xxx Tue Dec 9 04:54:17 2008 (r185785) +++ user/kmacy/head_arpv2/sys/arm/mv/orion/std.db88f5xxx Tue Dec 9 05:02:17 2008 (r185786) @@ -3,11 +3,11 @@ include "../mv/std.mv" files "../mv/orion/files.db88f5xxx" -makeoptions KERNPHYSADDR=0x00400000 -makeoptions KERNVIRTADDR=0xc0400000 +makeoptions KERNPHYSADDR=0x00900000 +makeoptions KERNVIRTADDR=0xc0900000 -options KERNPHYSADDR=0x00400000 -options KERNVIRTADDR=0xc0400000 +options KERNPHYSADDR=0x00900000 +options KERNVIRTADDR=0xc0900000 options PHYSADDR=0x00000000 options PHYSMEM_SIZE=0x08000000 options STARTUP_PAGETABLE_ADDR=0x00100000 Modified: user/kmacy/head_arpv2/sys/boot/common/loader.8 ============================================================================== --- user/kmacy/head_arpv2/sys/boot/common/loader.8 Tue Dec 9 04:54:17 2008 (r185785) +++ user/kmacy/head_arpv2/sys/boot/common/loader.8 Tue Dec 9 05:02:17 2008 (r185786) @@ -454,7 +454,7 @@ if the script terminates with a non-zero or if a SIGTERM is delivered to the .Xr init 8 process (PID 1). -.It Va init_script +.It Va init_shell Defines the shell binary to be used for executing the various shell scripts. The default is .Dq Li /bin/sh . Modified: user/kmacy/head_arpv2/sys/boot/forth/support.4th ============================================================================== --- user/kmacy/head_arpv2/sys/boot/forth/support.4th Tue Dec 9 04:54:17 2008 (r185785) +++ user/kmacy/head_arpv2/sys/boot/forth/support.4th Tue Dec 9 05:02:17 2008 (r185786) @@ -288,6 +288,17 @@ only forth also support-functions defini : free-memory free if free_error throw then ; +: strget { var -- addr len } var .addr @ var .len @ ; + +\ assign addr len to variable. +: strset { addr len var -- } addr var .addr ! len var .len ! ; + +\ free memory and reset fields +: strfree { var -- } var .addr @ ?dup if free-memory 0 0 var strset then ; + +\ free old content, make a copy of the string and assign to variable +: string= { addr len var -- } var strfree addr len strdup var strset ; + \ Assignment data temporary storage string name_buffer @@ -712,19 +723,6 @@ only forth also support-functions also f module_loaderror_suffix suffix_type? ; -: set_conf_files - conf_files .addr @ ?dup if - free-memory - then - value_buffer .addr @ c@ [char] " = if - value_buffer .addr @ char+ value_buffer .len @ 2 chars - - else - value_buffer .addr @ value_buffer .len @ - then - strdup - conf_files .len ! conf_files .addr ! -; - : set_nextboot_conf nextboot_conf_file .addr @ ?dup if free-memory @@ -888,6 +886,11 @@ only forth also support-functions also f then ; +: set_conf_files + set_environment_variable + s" loader_conf_files" getenv conf_files string= +; + : set_nextboot_flag yes_value? to nextboot? ; @@ -1045,7 +1048,6 @@ only forth also support-functions defini \ Variables used for processing multiple conf files string current_file_name -variable current_conf_files \ Indicates if any conf file was succesfully read @@ -1053,16 +1055,8 @@ variable current_conf_files \ loader_conf_files processing support functions -: set_current_conf_files - conf_files .addr @ current_conf_files ! -; - -: get_conf_files - conf_files .addr @ conf_files .len @ strdup -; - -: recurse_on_conf_files? - current_conf_files @ conf_files .addr @ <> +: get_conf_files ( -- addr len ) \ put addr/len on stack, reset var + conf_files strget 0 0 conf_files strset ; : skip_leading_spaces { addr len pos -- addr len pos' } @@ -1133,7 +1127,6 @@ variable current_conf_files \ Interface to loader_conf_files processing : include_conf_files - set_current_conf_files get_conf_files 0 begin get_next_file ?dup @@ -1141,7 +1134,7 @@ variable current_conf_files set_current_file_name ['] load_conf catch process_conf_errors - recurse_on_conf_files? if recurse then + conf_files .addr @ if recurse then repeat ; Modified: user/kmacy/head_arpv2/sys/boot/i386/boot0/boot0.S ============================================================================== --- user/kmacy/head_arpv2/sys/boot/i386/boot0/boot0.S Tue Dec 9 04:54:17 2008 (r185785) +++ user/kmacy/head_arpv2/sys/boot/i386/boot0/boot0.S Tue Dec 9 05:02:17 2008 (r185786) @@ -93,7 +93,7 @@ * %si pointer to the partition table from which we were loaded. * Some boot code (e.g. syslinux) use this info to relocate * themselves, so we want to pass a valid one to the next stage. - * NOTE: the use of %is is not a standard. + * NOTE: the use of %si is not a standard. * * This boot block first relocates itself at a different address (0:0x600), * to free the space at 0:0x7c00 for the next stage boot block. Modified: user/kmacy/head_arpv2/sys/boot/i386/btx/btxldr/btxldr.S ============================================================================== --- user/kmacy/head_arpv2/sys/boot/i386/btx/btxldr/btxldr.S Tue Dec 9 04:54:17 2008 (r185785) +++ user/kmacy/head_arpv2/sys/boot/i386/btx/btxldr/btxldr.S Tue Dec 9 05:02:17 2008 (r185786) @@ -15,6 +15,9 @@ * $FreeBSD$ */ +#define RBX_MUTE 0x10 /* -m */ +#define OPT_SET(opt) (1 << (opt)) + /* * Prototype BTX loader program, written in a couple of hours. The * real thing should probably be more flexible, and in C. @@ -64,6 +67,8 @@ * BTX program loader for ELF clients. */ start: cld # String ops inc + testl $OPT_SET(RBX_MUTE), 4(%esp) # Check first argument + setnz muted # for RBX_MUTE, set flag movl $m_logo,%esi # Identify call putstr # ourselves movzwl BDA_MEM,%eax # Get base memory @@ -288,7 +293,9 @@ putstr: lodsb # Load char /* * Output character AL to the console. */ -putchr: pusha # Save +putchr: testb $1,muted # Check muted + jnz putchr.5 # do a nop + pusha # Save xorl %ecx,%ecx # Zero for loops movb $SCR_MAT,%ah # Mode/attribute movl $BDA_POS,%ebx # BDA pointer @@ -325,7 +332,7 @@ putchr.3: cmpb $SCR_ROW,%dh # Beyond sc movb $SCR_ROW-1,%dh # Bottom line putchr.4: movw %dx,(%ebx) # Update position popa # Restore - ret # To caller +putchr.5: ret # To caller /* * Convert EAX, AX, or AL to hex, saving the result to [EDI]. */ @@ -390,6 +397,12 @@ m_segs: .asciz "text segment: offset=" .asciz " memsz=\0\n" m_done: .asciz "Loading complete\n" #endif + +/* + * Flags + */ +muted: .byte 0x0 + /* * Uninitialized data area. */ Modified: user/kmacy/head_arpv2/sys/boot/zfs/Makefile ============================================================================== --- user/kmacy/head_arpv2/sys/boot/zfs/Makefile Tue Dec 9 04:54:17 2008 (r185785) +++ user/kmacy/head_arpv2/sys/boot/zfs/Makefile Tue Dec 9 05:02:17 2008 (r185786) @@ -29,7 +29,7 @@ CFLAGS+= -Wformat -Wall .if ${MACHINE_ARCH} == "amd64" CLEANFILES+= machine machine: - ln -sf ${.CURDIR}/../../../i386/include machine + ln -sf ${.CURDIR}/../../i386/include machine .endif .include Modified: user/kmacy/head_arpv2/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h ============================================================================== --- user/kmacy/head_arpv2/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h Tue Dec 9 04:54:17 2008 (r185785) +++ user/kmacy/head_arpv2/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h Tue Dec 9 05:02:17 2008 (r185786) @@ -387,6 +387,49 @@ extern "C" { #define _DONT_USE_1275_GENERIC_NAMES #define _HAVE_CPUID_INSN +#elif defined(__mips__) + +/* + * Define the appropriate "processor characteristics" + */ +#define _STACK_GROWS_DOWNWARD +#define _LONG_LONG_LTOH +#define _BIT_FIELDS_LTOH +#define _IEEE_754 +#define _CHAR_IS_SIGNED +#define _BOOL_ALIGNMENT 1 +#define _CHAR_ALIGNMENT 1 +#define _SHORT_ALIGNMENT 2 +#define _INT_ALIGNMENT 4 +#define _FLOAT_ALIGNMENT 4 +#define _FLOAT_COMPLEX_ALIGNMENT 4 +#define _LONG_ALIGNMENT 4 +#define _LONG_LONG_ALIGNMENT 4 +#define _DOUBLE_ALIGNMENT 4 +#define _DOUBLE_COMPLEX_ALIGNMENT 4 +#define _LONG_DOUBLE_ALIGNMENT 4 +#define _LONG_DOUBLE_COMPLEX_ALIGNMENT 4 +#define _POINTER_ALIGNMENT 4 +#define _MAX_ALIGNMENT 4 +#define _ALIGNMENT_REQUIRED 0 + +#define _LONG_LONG_ALIGNMENT_32 _LONG_LONG_ALIGNMENT + +/* + * Define the appropriate "implementation choices". + */ +#define _ILP32 +#if !defined(_I32LPx) && defined(_KERNEL) +#define _I32LPx +#endif +#define _SUNOS_VTOC_16 +#define _DMA_USES_PHYSADDR +#define _FIRMWARE_NEEDS_FDISK +#define _PSM_MODULES +#define _RTC_CONFIG +#define _DONT_USE_1275_GENERIC_NAMES +#define _HAVE_CPUID_INSN + #elif defined(__powerpc__) /* Modified: user/kmacy/head_arpv2/sys/compat/linprocfs/linprocfs.c ============================================================================== --- user/kmacy/head_arpv2/sys/compat/linprocfs/linprocfs.c Tue Dec 9 04:54:17 2008 (r185785) +++ user/kmacy/head_arpv2/sys/compat/linprocfs/linprocfs.c Tue Dec 9 05:02:17 2008 (r185786) @@ -273,8 +273,7 @@ linprocfs_docpuinfo(PFS_FILL_ARGS) /* XXX per-cpu vendor / class / model / id? */ } - sbuf_cat(sb, - "flags\t\t:"); + sbuf_cat(sb, "flags\t\t:"); if (!strcmp(cpu_vendor, "AuthenticAMD") && (class < 6)) { flags[16] = "fcmov"; @@ -876,10 +875,12 @@ static int linprocfs_doprocmaps(PFS_FILL_ARGS) { vm_map_t map = &p->p_vmspace->vm_map; - vm_map_entry_t entry; + vm_map_entry_t entry, tmp_entry; vm_object_t obj, tobj, lobj; - vm_offset_t saved_end; + vm_offset_t e_start, e_end; vm_ooffset_t off = 0; + vm_prot_t e_prot; + unsigned int last_timestamp; char *name = "", *freename = NULL; ino_t ino; int ref_count, shadow_count, flags; @@ -905,7 +906,9 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) freename = NULL; if (entry->eflags & MAP_ENTRY_IS_SUB_MAP) continue; - saved_end = entry->end; + e_prot = entry->protection; + e_start = entry->start; + e_end = entry->end; obj = entry->object.vm_object; for (lobj = tobj = obj; tobj; tobj = tobj->backing_object) { VM_OBJECT_LOCK(tobj); @@ -913,6 +916,8 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) VM_OBJECT_UNLOCK(lobj); lobj = tobj; } + last_timestamp = map->timestamp; + vm_map_unlock_read(map); ino = 0; if (lobj) { off = IDX_TO_OFF(lobj->size); @@ -950,10 +955,10 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) */ error = sbuf_printf(sb, "%08lx-%08lx %s%s%s%s %08lx %02x:%02x %lu%s%s\n", - (u_long)entry->start, (u_long)entry->end, - (entry->protection & VM_PROT_READ)?"r":"-", - (entry->protection & VM_PROT_WRITE)?"w":"-", - (entry->protection & VM_PROT_EXECUTE)?"x":"-", + (u_long)e_start, (u_long)e_end, + (e_prot & VM_PROT_READ)?"r":"-", + (e_prot & VM_PROT_WRITE)?"w":"-", + (e_prot & VM_PROT_EXECUTE)?"x":"-", "p", (u_long)off, 0, @@ -968,6 +973,16 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) error = 0; break; } + vm_map_lock_read(map); + if (last_timestamp + 1 != map->timestamp) { + /* + * Look again for the entry because the map was + * modified while it was unlocked. Specifically, + * the entry may have been clipped, merged, or deleted. + */ + vm_map_lookup_entry(map, e_end - 1, &tmp_entry); + entry = tmp_entry; + } } vm_map_unlock_read(map); Modified: user/kmacy/head_arpv2/sys/conf/files ============================================================================== --- user/kmacy/head_arpv2/sys/conf/files Tue Dec 9 04:54:17 2008 (r185785) +++ user/kmacy/head_arpv2/sys/conf/files Tue Dec 9 05:02:17 2008 (r185786) @@ -2764,10 +2764,14 @@ xen/evtchn/evtchn_dev.c o xen/xenbus/xenbus_client.c optional xen xen/xenbus/xenbus_comms.c optional xen xen/xenbus/xenbus_dev.c optional xen +xen/xenbus/xenbus_if.m optional xen xen/xenbus/xenbus_probe.c optional xen -xen/xenbus/xenbus_probe_backend.c optional xen +#xen/xenbus/xenbus_probe_backend.c optional xen xen/xenbus/xenbus_xs.c optional xen dev/xen/console/console.c optional xen dev/xen/console/xencons_ring.c optional xen dev/xen/blkfront/blkfront.c optional xen dev/xen/netfront/netfront.c optional xen +#dev/xen/xenpci/xenpci.c optional xen +#xen/xenbus/xenbus_newbus.c optional xenhvm + Modified: user/kmacy/head_arpv2/sys/contrib/pf/net/pf_table.c ============================================================================== --- user/kmacy/head_arpv2/sys/contrib/pf/net/pf_table.c Tue Dec 9 04:54:17 2008 (r185785) +++ user/kmacy/head_arpv2/sys/contrib/pf/net/pf_table.c Tue Dec 9 05:02:17 2008 (r185786) @@ -43,6 +43,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #ifdef __FreeBSD__ #include #endif Modified: user/kmacy/head_arpv2/sys/dev/adb/adb.h ============================================================================== --- user/kmacy/head_arpv2/sys/dev/adb/adb.h Tue Dec 9 04:54:17 2008 (r185785) +++ user/kmacy/head_arpv2/sys/dev/adb/adb.h Tue Dec 9 05:02:17 2008 (r185786) @@ -68,7 +68,7 @@ uint8_t adb_get_device_type(device_t dev uint8_t adb_get_device_handler(device_t dev); uint8_t adb_set_device_handler(device_t dev, uint8_t newhandler); -uint8_t adb_read_register(device_t dev, u_char reg, size_t *len, void *data); +size_t adb_read_register(device_t dev, u_char reg, void *data); /* Bits for implementing ADB host bus adapters */ extern devclass_t adb_devclass; Modified: user/kmacy/head_arpv2/sys/dev/adb/adb_bus.c ============================================================================== --- user/kmacy/head_arpv2/sys/dev/adb/adb_bus.c Tue Dec 9 04:54:17 2008 (r185785) +++ user/kmacy/head_arpv2/sys/dev/adb/adb_bus.c Tue Dec 9 05:02:17 2008 (r185786) @@ -48,7 +48,7 @@ static void adb_bus_enumerate(void *xdev static void adb_probe_nomatch(device_t dev, device_t child); static int adb_print_child(device_t dev, device_t child); -static int adb_send_raw_packet_sync(device_t dev, uint8_t to, uint8_t command, uint8_t reg, int len, u_char *data); +static int adb_send_raw_packet_sync(device_t dev, uint8_t to, uint8_t command, uint8_t reg, int len, u_char *data, u_char *reply); static char *adb_device_string[] = { "HOST", "dongle", "keyboard", "mouse", "tablet", "modem", "RESERVED", "misc" @@ -118,8 +118,7 @@ adb_bus_enumerate(void *xdev) sc->packet_reply = 0; sc->autopoll_mask = 0; - - mtx_init(&sc->sc_sync_mtx,"adbsyn",NULL,MTX_DEF | MTX_RECURSE); + sc->sync_packet = 0xffff; /* Initialize devinfo */ for (i = 0; i < 16; i++) { @@ -128,7 +127,7 @@ adb_bus_enumerate(void *xdev) } /* Reset ADB bus */ - adb_send_raw_packet_sync(dev,0,ADB_COMMAND_BUS_RESET,0,0,NULL); + adb_send_raw_packet_sync(dev,0,ADB_COMMAND_BUS_RESET,0,0,NULL,NULL); DELAY(1500); /* Enumerate bus */ @@ -140,7 +139,7 @@ adb_bus_enumerate(void *xdev) do { reply = adb_send_raw_packet_sync(dev,i, - ADB_COMMAND_TALK,3,0,NULL); + ADB_COMMAND_TALK,3,0,NULL,NULL); if (reply) { /* If we got a response, relocate to next_free */ @@ -150,10 +149,10 @@ adb_bus_enumerate(void *xdev) r3 |= 0x00fe; adb_send_raw_packet_sync(dev,i, ADB_COMMAND_LISTEN,3, - sizeof(uint16_t),(u_char *)(&r3)); + sizeof(uint16_t),(u_char *)(&r3),NULL); adb_send_raw_packet_sync(dev,next_free, - ADB_COMMAND_TALK,3,0,NULL); + ADB_COMMAND_TALK,3,0,NULL,NULL); sc->devinfo[next_free].default_address = i; if (first_relocated < 0) @@ -169,9 +168,9 @@ adb_bus_enumerate(void *xdev) adb_send_raw_packet_sync(dev,first_relocated, ADB_COMMAND_LISTEN,3, - sizeof(uint16_t),(u_char *)(&r3)); + sizeof(uint16_t),(u_char *)(&r3),NULL); adb_send_raw_packet_sync(dev,i, - ADB_COMMAND_TALK,3,0,NULL); + ADB_COMMAND_TALK,3,0,NULL,NULL); sc->devinfo[i].default_address = i; sc->devinfo[(int)(first_relocated)].default_address = 0; @@ -194,10 +193,6 @@ adb_bus_enumerate(void *xdev) static int adb_bus_detach(device_t dev) { - struct adb_softc *sc = device_get_softc(dev); - - mtx_destroy(&sc->sc_sync_mtx); - return (bus_generic_detach(dev)); } @@ -230,6 +225,7 @@ adb_receive_raw_packet(device_t dev, u_c if (sc->sync_packet == command) { memcpy(sc->syncreg,data,(len > 8) ? 8 : len); atomic_store_rel_int(&sc->packet_reply,len + 1); + wakeup(sc); } if (sc->children[addr] != NULL) { @@ -317,12 +313,12 @@ adb_get_device_handler(device_t dev) static int adb_send_raw_packet_sync(device_t dev, uint8_t to, uint8_t command, - uint8_t reg, int len, u_char *data) + uint8_t reg, int len, u_char *data, u_char *reply) { u_char command_byte = 0; struct adb_softc *sc; int result = -1; - int i = 0; + int i = 1; sc = device_get_softc(dev); @@ -331,7 +327,8 @@ adb_send_raw_packet_sync(device_t dev, u command_byte |= reg; /* Wait if someone else has a synchronous request pending */ - mtx_lock(&sc->sc_sync_mtx); + while (!atomic_cmpset_int(&sc->sync_packet, 0xffff, command_byte)) + tsleep(sc, 0, "ADB sync", hz/10); sc->packet_reply = 0; sc->sync_packet = command_byte; @@ -343,21 +340,27 @@ adb_send_raw_packet_sync(device_t dev, u * Maybe the command got lost? Try resending and polling the * controller. */ - if (i > 40) + if (i % 40 == 0) ADB_HB_SEND_RAW_PACKET(sc->parent, command_byte, len, data, 1); - DELAY(100); + tsleep(sc, 0, "ADB sync", hz/10); i++; } result = sc->packet_reply - 1; + if (reply != NULL && result > 0) + memcpy(reply,sc->syncreg,result); + /* Clear packet sync */ sc->packet_reply = 0; - sc->sync_packet = 0xffff; /* We can't match a 16 bit value */ - mtx_unlock(&sc->sc_sync_mtx); + /* + * We can't match a value beyond 8 bits, so set sync_packet to + * 0xffff to avoid collisions. + */ + atomic_set_int(&sc->sync_packet, 0xffff); return (result); } @@ -375,37 +378,27 @@ adb_set_device_handler(device_t dev, uin newr3 = dinfo->register3 & 0xff00; newr3 |= (uint16_t)(newhandler); + adb_send_raw_packet_sync(sc->sc_dev,dinfo->address, ADB_COMMAND_LISTEN, + 3, sizeof(uint16_t), (u_char *)(&newr3), NULL); adb_send_raw_packet_sync(sc->sc_dev,dinfo->address, - ADB_COMMAND_LISTEN, 3, sizeof(uint16_t), (u_char *)(&newr3)); - adb_send_raw_packet_sync(sc->sc_dev,dinfo->address, - ADB_COMMAND_TALK, 3, 0, NULL); + ADB_COMMAND_TALK, 3, 0, NULL, NULL); return (dinfo->handler_id); } -uint8_t -adb_read_register(device_t dev, u_char reg, - size_t *len, void *data) +size_t +adb_read_register(device_t dev, u_char reg, void *data) { struct adb_softc *sc; struct adb_devinfo *dinfo; - size_t orig_len; + size_t result; dinfo = device_get_ivars(dev); sc = device_get_softc(device_get_parent(dev)); - orig_len = *len; - - mtx_lock(&sc->sc_sync_mtx); - - *len = adb_send_raw_packet_sync(sc->sc_dev,dinfo->address, - ADB_COMMAND_TALK, reg, 0, NULL); + result = adb_send_raw_packet_sync(sc->sc_dev,dinfo->address, + ADB_COMMAND_TALK, reg, 0, NULL, data); - if (*len > 0) - memcpy(data,sc->syncreg,*len); - - mtx_unlock(&sc->sc_sync_mtx); - - return ((*len > 0) ? 0 : -1); + return (result); } Modified: user/kmacy/head_arpv2/sys/dev/adb/adb_kbd.c ============================================================================== --- user/kmacy/head_arpv2/sys/dev/adb/adb_kbd.c Tue Dec 9 04:54:17 2008 (r185785) +++ user/kmacy/head_arpv2/sys/dev/adb/adb_kbd.c Tue Dec 9 05:02:17 2008 (r185786) @@ -271,11 +271,12 @@ adb_kbd_attach(device_t dev) } #endif - adb_set_autopoll(dev,1); - - /* Check (asynchronously) if we can read out the LED state from + /* Check if we can read out the LED state from this keyboard by reading the key state register */ - adb_send_packet(dev,ADB_COMMAND_TALK,2,0,NULL); + if (adb_read_register(dev, 2, NULL) == 2) + sc->have_led_control = 1; + + adb_set_autopoll(dev,1); return (0); } @@ -323,11 +324,6 @@ adb_kbd_receive_packet(device_t dev, u_c if (command != ADB_COMMAND_TALK) return 0; - if (reg == 2 && len == 2) { - sc->have_led_control = 1; - return 0; - } - if (reg != 0 || len != 2) return (0); Modified: user/kmacy/head_arpv2/sys/dev/adb/adb_mouse.c ============================================================================== --- user/kmacy/head_arpv2/sys/dev/adb/adb_mouse.c Tue Dec 9 04:54:17 2008 (r185785) +++ user/kmacy/head_arpv2/sys/dev/adb/adb_mouse.c Tue Dec 9 05:02:17 2008 (r185786) @@ -181,7 +181,7 @@ adb_mouse_attach(device_t dev) sc->mode.resolution = 200; break; case 4: - adb_read_register(dev,1,&r1_len,r1); + r1_len = adb_read_register(dev,1,r1); if (r1_len < 8) break; Modified: user/kmacy/head_arpv2/sys/dev/adb/adbvar.h ============================================================================== --- user/kmacy/head_arpv2/sys/dev/adb/adbvar.h Tue Dec 9 04:54:17 2008 (r185785) +++ user/kmacy/head_arpv2/sys/dev/adb/adbvar.h Tue Dec 9 05:02:17 2008 (r185786) @@ -40,7 +40,6 @@ struct adb_softc { device_t parent; struct intr_config_hook enum_hook; - struct mtx sc_sync_mtx; volatile int sync_packet; volatile int packet_reply; Modified: user/kmacy/head_arpv2/sys/dev/ae/if_ae.c ============================================================================== --- user/kmacy/head_arpv2/sys/dev/ae/if_ae.c Tue Dec 9 04:54:17 2008 (r185785) +++ user/kmacy/head_arpv2/sys/dev/ae/if_ae.c Tue Dec 9 05:02:17 2008 (r185786) @@ -1105,12 +1105,9 @@ ae_dmamap_cb(void *arg, bus_dma_segment_ static int ae_alloc_rings(ae_softc_t *sc) { - bus_dma_tag_t bustag; bus_addr_t busaddr; int error; - bustag = bus_get_dma_tag(sc->dev); - /* * Create parent DMA tag. */ @@ -1903,8 +1900,8 @@ ae_rxeof(ae_softc_t *sc, ae_rxd_t *rxd) if_printf(ifp, "Rx interrupt occuried.\n"); #endif size = le16toh(rxd->len) - ETHER_CRC_LEN; - if (size < 0) { - if_printf(ifp, "Negative length packet received."); + if (size < (ETHER_MIN_LEN - ETHER_CRC_LEN - ETHER_VLAN_ENCAP_LEN)) { + if_printf(ifp, "Runt frame received."); return (EIO); } Modified: user/kmacy/head_arpv2/sys/dev/ath/if_ath.c ============================================================================== --- user/kmacy/head_arpv2/sys/dev/ath/if_ath.c Tue Dec 9 04:54:17 2008 (r185785) +++ user/kmacy/head_arpv2/sys/dev/ath/if_ath.c Tue Dec 9 05:02:17 2008 (r185786) @@ -219,9 +219,15 @@ static void ath_announce(struct ath_soft SYSCTL_DECL(_hw_ath); /* XXX validate sysctl values */ -static int ath_calinterval = 30; /* calibrate every 30 secs */ -SYSCTL_INT(_hw_ath, OID_AUTO, calibrate, CTLFLAG_RW, &ath_calinterval, - 0, "chip calibration interval (secs)"); +static int ath_longcalinterval = 30; /* long cals every 30 secs */ +SYSCTL_INT(_hw_ath, OID_AUTO, longcal, CTLFLAG_RW, &ath_longcalinterval, + 0, "long chip calibration interval (secs)"); +static int ath_shortcalinterval = 100; /* short cals every 100 ms */ +SYSCTL_INT(_hw_ath, OID_AUTO, shortcal, CTLFLAG_RW, &ath_shortcalinterval, + 0, "short chip calibration interval (msecs)"); +static int ath_resetcalinterval = 20*60; /* reset cal state 20 mins */ +SYSCTL_INT(_hw_ath, OID_AUTO, resetcal, CTLFLAG_RW, &ath_resetcalinterval, + 0, "reset chip calibration results (secs)"); static int ath_rxbuf = ATH_RXBUF; /* # rx buffers to allocate */ SYSCTL_INT(_hw_ath, OID_AUTO, rxbuf, CTLFLAG_RW, &ath_rxbuf, @@ -1433,8 +1439,9 @@ ath_init(void *arg) * state cached in the driver. */ sc->sc_diversity = ath_hal_getdiversity(ah); - sc->sc_calinterval = 1; - sc->sc_caltries = 0; + sc->sc_lastlongcal = 0; + sc->sc_resetcal = 1; + sc->sc_lastcalreset = 0; /* * Setup the hardware after reset: the key cache @@ -1566,8 +1573,6 @@ ath_reset(struct ifnet *ifp) if_printf(ifp, "%s: unable to reset hardware; hal status %u\n", __func__, status); sc->sc_diversity = ath_hal_getdiversity(ah); - sc->sc_calinterval = 1; - sc->sc_caltries = 0; if (ath_startrecv(sc) != 0) /* restart recv */ if_printf(ifp, "%s: unable to start recv logic\n", __func__); /* @@ -5493,8 +5498,6 @@ ath_chan_set(struct ath_softc *sc, struc } sc->sc_curchan = hchan; sc->sc_diversity = ath_hal_getdiversity(ah); - sc->sc_calinterval = 1; - sc->sc_caltries = 0; /* * Re-enable rx framework. @@ -5528,54 +5531,76 @@ ath_calibrate(void *arg) { struct ath_softc *sc = arg; struct ath_hal *ah = sc->sc_ah; - HAL_BOOL iqCalDone; - - sc->sc_stats.ast_per_cal++; + struct ifnet *ifp = sc->sc_ifp; + HAL_BOOL longCal, isCalDone; + int nextcal; - if (ath_hal_getrfgain(ah) == HAL_RFGAIN_NEED_CHANGE) { + longCal = (ticks - sc->sc_lastlongcal >= ath_longcalinterval*hz); + if (longCal) { + sc->sc_stats.ast_per_cal++; + if (ath_hal_getrfgain(ah) == HAL_RFGAIN_NEED_CHANGE) { + /* + * Rfgain is out of bounds, reset the chip + * to load new gain values. + */ + DPRINTF(sc, ATH_DEBUG_CALIBRATE, + "%s: rfgain change\n", __func__); + sc->sc_stats.ast_per_rfgain++; + ath_reset(ifp); + } /* - * Rfgain is out of bounds, reset the chip - * to load new gain values. + * If this long cal is after an idle period, then + * reset the data collection state so we start fresh. */ - DPRINTF(sc, ATH_DEBUG_CALIBRATE, - "%s: rfgain change\n", __func__); - sc->sc_stats.ast_per_rfgain++; - ath_reset(sc->sc_ifp); + if (sc->sc_resetcal) { + (void) ath_hal_calreset(ah, &sc->sc_curchan); + sc->sc_lastcalreset = ticks; + sc->sc_resetcal = 0; + } } - if (!ath_hal_calibrate(ah, &sc->sc_curchan, &iqCalDone)) { + if (ath_hal_calibrateN(ah, &sc->sc_curchan, longCal, &isCalDone)) { + if (longCal) { + /* + * Calibrate noise floor data again in case of change. + */ + ath_hal_process_noisefloor(ah); + } + } else { DPRINTF(sc, ATH_DEBUG_ANY, "%s: calibration of channel %u failed\n", __func__, sc->sc_curchan.channel); sc->sc_stats.ast_per_calfail++; } - /* - * Calibrate noise floor data again in case of change. - */ - ath_hal_process_noisefloor(ah); - /* - * Poll more frequently when the IQ calibration is in - * progress to speedup loading the final settings. - * We temper this aggressive polling with an exponential - * back off after 4 tries up to ath_calinterval. - */ - if (iqCalDone || sc->sc_calinterval >= ath_calinterval) { - sc->sc_caltries = 0; - sc->sc_calinterval = ath_calinterval; - } else if (sc->sc_caltries > 4) { - sc->sc_caltries = 0; - sc->sc_calinterval <<= 1; - if (sc->sc_calinterval > ath_calinterval) - sc->sc_calinterval = ath_calinterval; - } - KASSERT(0 < sc->sc_calinterval && sc->sc_calinterval <= ath_calinterval, - ("bad calibration interval %u", sc->sc_calinterval)); - - DPRINTF(sc, ATH_DEBUG_CALIBRATE, - "%s: next +%u (%siqCalDone tries %u)\n", __func__, - sc->sc_calinterval, iqCalDone ? "" : "!", sc->sc_caltries); - sc->sc_caltries++; - callout_reset(&sc->sc_cal_ch, sc->sc_calinterval * hz, - ath_calibrate, sc); + if (!isCalDone) { + /* + * Use a shorter interval to potentially collect multiple + * data samples required to complete calibration. Once + * we're told the work is done we drop back to a longer + * interval between requests. We're more aggressive doing + * work when operating as an AP to improve operation right + * after startup. + */ + nextcal = (1000*ath_shortcalinterval)/hz; + if (sc->sc_opmode != HAL_M_HOSTAP) + nextcal *= 10; + } else { + nextcal = ath_longcalinterval*hz; + sc->sc_lastlongcal = ticks; + if (sc->sc_lastcalreset == 0) + sc->sc_lastcalreset = sc->sc_lastlongcal; + else if (ticks - sc->sc_lastcalreset >= ath_resetcalinterval*hz) + sc->sc_resetcal = 1; /* setup reset next trip */ + } + + if (nextcal != 0) { + DPRINTF(sc, ATH_DEBUG_CALIBRATE, "%s: next +%u (%sisCalDone)\n", + __func__, nextcal, isCalDone ? "" : "!"); + callout_reset(&sc->sc_cal_ch, nextcal, ath_calibrate, sc); + } else { + DPRINTF(sc, ATH_DEBUG_CALIBRATE, "%s: calibration disabled\n", + __func__); + /* NB: don't rearm timer */ + } } static void @@ -5803,10 +5828,12 @@ ath_newstate(struct ieee80211vap *vap, e * Finally, start any timers and the task q thread * (in case we didn't go through SCAN state). */ - if (sc->sc_calinterval != 0) { + if (ath_longcalinterval != 0) { /* start periodic recalibration timer */ - callout_reset(&sc->sc_cal_ch, sc->sc_calinterval * hz, - ath_calibrate, sc); + callout_reset(&sc->sc_cal_ch, 1, ath_calibrate, sc); + } else { + DPRINTF(sc, ATH_DEBUG_CALIBRATE, + "%s: calibration disabled\n", __func__); } taskqueue_unblock(sc->sc_tq); } else if (nstate == IEEE80211_S_INIT) { @@ -6885,7 +6912,7 @@ ath_tx_raw_start(struct ath_softc *sc, s struct ieee80211com *ic = ifp->if_l2com; struct ath_hal *ah = sc->sc_ah; int error, ismcast, ismrr; - int hdrlen, pktlen, try0, txantenna; + int keyix, hdrlen, pktlen, try0, txantenna; u_int8_t rix, cix, txrate, ctsrate, rate1, rate2, rate3; struct ieee80211_frame *wh; u_int flags, ctsduration; @@ -6904,6 +6931,54 @@ ath_tx_raw_start(struct ath_softc *sc, s /* XXX honor IEEE80211_BPF_DATAPAD */ pktlen = m0->m_pkthdr.len - (hdrlen & 3) + IEEE80211_CRC_LEN; + if (params->ibp_flags & IEEE80211_BPF_CRYPTO) { + const struct ieee80211_cipher *cip; + struct ieee80211_key *k; + + /* + * Construct the 802.11 header+trailer for an encrypted + * frame. The only reason this can fail is because of an + * unknown or unsupported cipher/key type. + */ + k = ieee80211_crypto_encap(ni, m0); + if (k == NULL) { + /* + * This can happen when the key is yanked after the + * frame was queued. Just discard the frame; the + * 802.11 layer counts failures and provides + * debugging/diagnostics. + */ + ath_freetx(m0); + return EIO; + } + /* + * Adjust the packet + header lengths for the crypto + * additions and calculate the h/w key index. When + * a s/w mic is done the frame will have had any mic + * added to it prior to entry so m0->m_pkthdr.len will + * account for it. Otherwise we need to add it to the + * packet length. + */ + cip = k->wk_cipher; + hdrlen += cip->ic_header; + pktlen += cip->ic_header + cip->ic_trailer; + /* NB: frags always have any TKIP MIC done in s/w */ + if ((k->wk_flags & IEEE80211_KEY_SWMIC) == 0) + pktlen += cip->ic_miclen; + keyix = k->wk_keyix; + + /* packet header may have moved, reset our local pointer */ + wh = mtod(m0, struct ieee80211_frame *); + } else if (ni->ni_ucastkey.wk_cipher == &ieee80211_cipher_none) { + /* + * Use station key cache slot, if assigned. + */ + keyix = ni->ni_ucastkey.wk_keyix; + if (keyix == IEEE80211_KEYIX_NONE) + keyix = HAL_TXKEYIX_INVALID; + } else + keyix = HAL_TXKEYIX_INVALID; + error = ath_tx_dmasetup(sc, bf, m0); if (error != 0) return error; @@ -6992,7 +7067,7 @@ ath_tx_raw_start(struct ath_softc *sc, s , atype /* Atheros packet type */ , params->ibp_power /* txpower */ , txrate, try0 /* series 0 rate/tries */ - , HAL_TXKEYIX_INVALID /* key cache index */ + , keyix /* key cache index */ , txantenna /* antenna mode */ , flags /* flags */ , ctsrate /* rts/cts rate */ Modified: user/kmacy/head_arpv2/sys/dev/ath/if_athvar.h ============================================================================== --- user/kmacy/head_arpv2/sys/dev/ath/if_athvar.h Tue Dec 9 04:54:17 2008 (r185785) +++ user/kmacy/head_arpv2/sys/dev/ath/if_athvar.h Tue Dec 9 05:02:17 2008 (r185786) @@ -248,7 +248,8 @@ struct ath_softc { sc_swbmiss : 1,/* sta mode using sw bmiss */ sc_stagbeacons:1,/* use staggered beacons */ sc_wmetkipmic:1,/* can do WME+TKIP MIC */ - sc_resume_up: 1;/* on resume, start all vaps */ + sc_resume_up: 1,/* on resume, start all vaps */ + sc_resetcal : 1;/* reset cal state next trip */ uint32_t sc_eerd; /* regdomain from EEPROM */ uint32_t sc_eecc; /* country code from EEPROM */ /* rate tables */ @@ -334,8 +335,8 @@ struct ath_softc { int sc_nbcnvaps; /* # vaps with beacons */ struct callout sc_cal_ch; /* callout handle for cals */ - int sc_calinterval; /* current polling interval */ - int sc_caltries; /* cals at current interval */ + int sc_lastlongcal; /* last long cal completed */ + int sc_lastcalreset;/* last cal reset done */ HAL_NODE_STATS sc_halstats; /* station-mode rssi stats */ }; @@ -438,6 +439,16 @@ void ath_intr(void *); ((*(_ah)->ah_setChannel)((_ah), (_chan))) #define ath_hal_calibrate(_ah, _chan, _iqcal) \ ((*(_ah)->ah_perCalibration)((_ah), (_chan), (_iqcal))) +#if HAL_ABI_VERSION >= 0x08111000 +#define ath_hal_calibrateN(_ah, _chan, _lcal, _isdone) \ + ((*(_ah)->ah_perCalibrationN)((_ah), (_chan), 0x1, (_lcal), (_isdone))) +#define ath_hal_calreset(_ah, _chan) \ + ((*(_ah)->ah_resetCalValid)((_ah), (_chan))) +#else +#define ath_hal_calibrateN(_ah, _chan, _lcal, _isdone) \ + ath_hal_calibrate(_ah, _chan, _isdone) +#define ath_hal_calreset(_ah, _chan) (0) +#endif #define ath_hal_setledstate(_ah, _state) \ ((*(_ah)->ah_setLedState)((_ah), (_state))) #define ath_hal_beaconinit(_ah, _nextb, _bperiod) \ Modified: user/kmacy/head_arpv2/sys/dev/cxgb/common/cxgb_ael1002.c ============================================================================== --- user/kmacy/head_arpv2/sys/dev/cxgb/common/cxgb_ael1002.c Tue Dec 9 04:54:17 2008 (r185785) +++ user/kmacy/head_arpv2/sys/dev/cxgb/common/cxgb_ael1002.c Tue Dec 9 05:02:17 2008 (r185786) @@ -205,6 +205,16 @@ static int ael1006_reset(struct cphy *ph t3_write_reg(phy->adapter, A_T3DBG_GPIO_EN, gpio_out); msleep(125); t3_phy_reset(phy, MDIO_DEV_PMA_PMD, wait); + + /* Phy loopback work around for ael1006 */ + /* Soft reset phy by toggling loopback */ + msleep(125); + /* Put phy into local loopback */ + t3_mdio_change_bits(phy, MDIO_DEV_PMA_PMD, MII_BMCR, 0, 1); + msleep(125); + /* Take phy out of local loopback */ + t3_mdio_change_bits(phy, MDIO_DEV_PMA_PMD, MII_BMCR, 1, 0); + return 0; } Modified: user/kmacy/head_arpv2/sys/dev/cxgb/common/cxgb_t3_hw.c ============================================================================== --- user/kmacy/head_arpv2/sys/dev/cxgb/common/cxgb_t3_hw.c Tue Dec 9 04:54:17 2008 (r185785) +++ user/kmacy/head_arpv2/sys/dev/cxgb/common/cxgb_t3_hw.c Tue Dec 9 05:02:17 2008 (r185786) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Tue Dec 9 14:56:39 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECD0B1065670; Tue, 9 Dec 2008 14:56:39 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DC2418FC1F; Tue, 9 Dec 2008 14:56:39 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB9Eudbk093568; Tue, 9 Dec 2008 14:56:39 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB9Eudoo093567; Tue, 9 Dec 2008 14:56:39 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <200812091456.mB9Eudoo093567@svn.freebsd.org> From: Andrew Gallatin Date: Tue, 9 Dec 2008 14:56:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185794 - in user/kmacy/HEAD_fast_multi_xmit/sys: net netinet6 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Dec 2008 14:56:40 -0000 Author: gallatin Date: Tue Dec 9 14:56:39 2008 New Revision: 185794 URL: http://svn.freebsd.org/changeset/base/185794 Log: Fix compilation errors by including sys/lock.h prior to sys/rwlock.h Modified: user/kmacy/HEAD_fast_multi_xmit/sys/net/rtsock.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/in6_rmx.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/nd6_rtr.c Modified: user/kmacy/HEAD_fast_multi_xmit/sys/net/rtsock.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/net/rtsock.c Tue Dec 9 11:05:59 2008 (r185793) +++ user/kmacy/HEAD_fast_multi_xmit/sys/net/rtsock.c Tue Dec 9 14:56:39 2008 (r185794) @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include Modified: user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/in6_rmx.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/in6_rmx.c Tue Dec 9 11:05:59 2008 (r185793) +++ user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/in6_rmx.c Tue Dec 9 14:56:39 2008 (r185794) @@ -83,6 +83,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/nd6_rtr.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/nd6_rtr.c Tue Dec 9 11:05:59 2008 (r185793) +++ user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/nd6_rtr.c Tue Dec 9 14:56:39 2008 (r185794) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include From owner-svn-src-user@FreeBSD.ORG Tue Dec 9 16:25:47 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 402C61065676; Tue, 9 Dec 2008 16:25:47 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E87E8FC12; Tue, 9 Dec 2008 16:25:47 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB9GPl2d095657; Tue, 9 Dec 2008 16:25:47 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB9GPkkq095656; Tue, 9 Dec 2008 16:25:47 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <200812091625.mB9GPkkq095656@svn.freebsd.org> From: Andrew Gallatin Date: Tue, 9 Dec 2008 16:25:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185797 - user/kmacy/HEAD_fast_multi_xmit/sys/dev/mxge X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Dec 2008 16:25:47 -0000 Author: gallatin Date: Tue Dec 9 16:25:46 2008 New Revision: 185797 URL: http://svn.freebsd.org/changeset/base/185797 Log: Convert mxge to buf_ring Modified: user/kmacy/HEAD_fast_multi_xmit/sys/dev/mxge/if_mxge.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/mxge/if_mxge_var.h Modified: user/kmacy/HEAD_fast_multi_xmit/sys/dev/mxge/if_mxge.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/dev/mxge/if_mxge.c Tue Dec 9 16:20:58 2008 (r185796) +++ user/kmacy/HEAD_fast_multi_xmit/sys/dev/mxge/if_mxge.c Tue Dec 9 16:25:46 2008 (r185797) @@ -30,6 +30,8 @@ POSSIBILITY OF SUCH DAMAGE. #include __FBSDID("$FreeBSD$"); +#define IFNET_MULTIQUEUE + #include #include #include @@ -66,6 +68,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef IFNET_MULTIQUEUE +#include +#endif #include #include #include @@ -1206,9 +1211,10 @@ mxge_reset(mxge_softc_t *sc, int interru * to setting up the interrupt queue DMA */ cmd.data0 = sc->num_slices; - cmd.data1 = MXGEFW_SLICE_INTR_MODE_ONE_PER_SLICE | - MXGEFW_SLICE_ENABLE_MULTIPLE_TX_QUEUES; - + cmd.data1 = MXGEFW_SLICE_INTR_MODE_ONE_PER_SLICE; +#ifdef IFNET_MULTIQUEUE + cmd.data1 |= MXGEFW_SLICE_ENABLE_MULTIPLE_TX_QUEUES; +#endif status = mxge_send_cmd(sc, MXGEFW_CMD_ENABLE_RSS_QUEUES, &cmd); if (status != 0) { @@ -1603,10 +1609,6 @@ mxge_add_sysctls(mxge_softc_t *sc) "rx_big_cnt", CTLFLAG_RD, &ss->rx_big.cnt, 0, "rx_small_cnt"); - SYSCTL_ADD_INT(ctx, children, OID_AUTO, - "tx_req", - CTLFLAG_RD, &ss->tx.req, - 0, "tx_req"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "lro_flushed", CTLFLAG_RD, &ss->lro_flushed, 0, "number of lro merge queues flushed"); @@ -1616,6 +1618,16 @@ mxge_add_sysctls(mxge_softc_t *sc) 0, "number of frames appended to lro merge" "queues"); +#ifndef IFNET_MULTIQUEUE + /* only transmit from slice 0 for now */ + if (slice > 0) + continue; +#endif + SYSCTL_ADD_INT(ctx, children, OID_AUTO, + "tx_req", + CTLFLAG_RD, &ss->tx.req, + 0, "tx_req"); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "tx_done", CTLFLAG_RD, &ss->tx.done, @@ -1870,13 +1882,15 @@ mxge_encap_tso(struct mxge_slice_state * tx->info[((cnt - 1) + tx->req) & tx->mask].flag = 1; mxge_submit_req(tx, tx->req_list, cnt); +#ifdef IFNET_MULTIQUEUE if ((ss->sc->num_slices > 1) && tx->queue_active == 0) { /* tell the NIC to start polling this slice */ *tx->send_go = 1; tx->queue_active = 1; tx->activate++; - mb(); + wmb(); } +#endif return; drop: @@ -2079,13 +2093,15 @@ mxge_encap(struct mxge_slice_state *ss, #endif tx->info[((cnt - 1) + tx->req) & tx->mask].flag = 1; mxge_submit_req(tx, tx->req_list, cnt); +#ifdef IFNET_MULTIQUEUE if ((ss->sc->num_slices > 1) && tx->queue_active == 0) { /* tell the NIC to start polling this slice */ *tx->send_go = 1; tx->queue_active = 1; tx->activate++; - mb(); + wmb(); } +#endif return; drop: @@ -2094,24 +2110,22 @@ drop: return; } - - - +#ifdef IFNET_MULTIQUEUE static inline void mxge_start_locked(struct mxge_slice_state *ss) { mxge_softc_t *sc; struct mbuf *m; struct ifnet *ifp; - struct ifaltq *ifq; mxge_tx_ring_t *tx; sc = ss->sc; ifp = sc->ifp; tx = &ss->tx; - ifq = &tx->ifq; - while ((tx->mask - (tx->req - tx->done)) > tx->max_desc) { - IFQ_DRV_DEQUEUE(ifq, m); + + while (((tx->mask - (tx->req - tx->done)) > tx->max_desc) + && (!buf_ring_empty(tx->br))) { + m = buf_ring_dequeue_sc(tx->br); if (m == NULL) { return; } @@ -2122,48 +2136,112 @@ mxge_start_locked(struct mxge_slice_stat mxge_encap(ss, m); } /* ran out of transmit slots */ - if ((ss->if_drv_flags & IFF_DRV_OACTIVE) == 0) { + if (((ss->if_drv_flags & IFF_DRV_OACTIVE) == 0) + && (!buf_ring_empty(tx->br))) { ss->if_drv_flags |= IFF_DRV_OACTIVE; tx->stall++; } } -static void -mxge_start(struct mxge_slice_state *ss) +static int +mxge_transmit_locked(struct mxge_slice_state *ss, struct mbuf *m) { - mtx_lock(&ss->tx.mtx); - mxge_start_locked(ss); - mtx_unlock(&ss->tx.mtx); + mxge_softc_t *sc; + struct ifnet *ifp; + mxge_tx_ring_t *tx; + int err; + + sc = ss->sc; + ifp = sc->ifp; + tx = &ss->tx; + + if ((ss->if_drv_flags & (IFF_DRV_RUNNING|IFF_DRV_OACTIVE)) != + IFF_DRV_RUNNING) { + err = drbr_enqueue(tx->br, m); + return (err); + } + + if (buf_ring_empty(tx->br) && + ((tx->mask - (tx->req - tx->done)) > tx->max_desc)) { + /* let BPF see it */ + BPF_MTAP(ifp, m); + /* give it to the nic */ + mxge_encap(ss, m); + } else if ((err = drbr_enqueue(tx->br, m)) != 0) { + return (err); + } + if (!buf_ring_empty(tx->br)) + mxge_start_locked(ss); + return (0); } static int mxge_transmit(struct ifnet *ifp, struct mbuf *m) { - struct ifaltq *ifq; mxge_softc_t *sc = ifp->if_softc; struct mxge_slice_state *ss; - int slice, error, len; - short mflags; - - /* - * XXX Andrew - this will only DTRT if num_slices is - * a power of 2 - */ - slice = m->m_pkthdr.flowid & (sc->num_slices - 1); -/* printf("%d & %d = %d\n", m->m_pkthdr.rss_hash, (sc->num_slices - 1), slice);*/ + mxge_tx_ring_t *tx; + int err = 0; + int slice; + + slice = m->m_pkthdr.flowid; + + slice &= (sc->num_slices - 1); /* num_slices always power of 2 */ ss = &sc->ss[slice]; - ifq = &ss->tx.ifq; - len = (m)->m_pkthdr.len; - mflags = (m)->m_flags; - IFQ_ENQUEUE(ifq, m, error); - if (error == 0) { - ss->obytes += len; - if (mflags & M_MCAST) - ss->omcasts++; - if ((ss->if_drv_flags & IFF_DRV_OACTIVE) == 0) - mxge_start(ss); + tx = &ss->tx; + + if (mtx_trylock(&tx->mtx)) { + err = mxge_transmit_locked(ss, m); + mtx_unlock(&tx->mtx); + } else { + err = drbr_enqueue(tx->br, m); } - return (error); + + return (err); +} + +#else + +static inline void +mxge_start_locked(struct mxge_slice_state *ss) +{ + mxge_softc_t *sc; + struct mbuf *m; + struct ifnet *ifp; + mxge_tx_ring_t *tx; + + sc = ss->sc; + ifp = sc->ifp; + tx = &ss->tx; + while ((tx->mask - (tx->req - tx->done)) > tx->max_desc) { + IFQ_DRV_DEQUEUE(&ifp->if_snd, m); + if (m == NULL) { + return; + } + /* let BPF see it */ + BPF_MTAP(ifp, m); + + /* give it to the nic */ + mxge_encap(ss, m); + } + /* ran out of transmit slots */ + if ((sc->ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0) { + sc->ifp->if_drv_flags |= IFF_DRV_OACTIVE; + tx->stall++; + } +} +#endif +static void +mxge_start(struct ifnet *ifp) +{ + mxge_softc_t *sc = ifp->if_softc; + struct mxge_slice_state *ss; + + /* only use the first slice for now */ + ss = &sc->ss[0]; + mtx_lock(&ss->tx.mtx); + mxge_start_locked(ss); + mtx_unlock(&ss->tx.mtx); } /* @@ -2464,8 +2542,8 @@ mxge_rx_done_small(struct mxge_slice_sta m->m_data += MXGEFW_PAD; m->m_pkthdr.rcvif = ifp; - m->m_len = m->m_pkthdr.len = len; m->m_pkthdr.flowid = ss - sc->ss; + m->m_len = m->m_pkthdr.len = len; ss->ipackets++; eh = mtod(m, struct ether_header *); if (eh->ether_type == htons(ETHERTYPE_VLAN)) { @@ -2526,6 +2604,7 @@ mxge_tx_done(struct mxge_slice_state *ss struct mbuf *m; bus_dmamap_t map; int idx; + int *flags; tx = &ss->tx; ifp = ss->sc->ifp; @@ -2536,6 +2615,11 @@ mxge_tx_done(struct mxge_slice_state *ss /* mbuf and DMA map only attached to the first segment per-mbuf */ if (m != NULL) { +#ifdef IFNET_MULTIQUEUE + ss->obytes += m->m_pkthdr.len; + if (m->m_flags & M_MCAST) + ss->omcasts++; +#endif ss->opackets++; tx->info[idx].m = NULL; map = tx->info[idx].map; @@ -2550,27 +2634,33 @@ mxge_tx_done(struct mxge_slice_state *ss /* If we have space, clear IFF_OACTIVE to tell the stack that its OK to send packets */ - - if (ss->if_drv_flags & IFF_DRV_OACTIVE && +#ifdef IFNET_MULTIQUEUE + flags = &ss->if_drv_flags; +#else + flags = &ifp->if_drv_flags; +#endif + mtx_lock(&ss->tx.mtx); + if ((*flags) & IFF_DRV_OACTIVE && tx->req - tx->done < (tx->mask + 1)/4) { - mtx_lock(&ss->tx.mtx); - ss->if_drv_flags &= ~IFF_DRV_OACTIVE; + *(flags) &= ~IFF_DRV_OACTIVE; ss->tx.wake++; mxge_start_locked(ss); - mtx_unlock(&ss->tx.mtx); } - if ((ss->sc->num_slices > 1) && (tx->req == tx->done) && - mtx_trylock(&ss->tx.mtx)) { +#ifdef IFNET_MULTIQUEUE + if ((ss->sc->num_slices > 1) && (tx->req == tx->done)) { /* let the NIC stop polling this queue, since there * are no more transmits pending */ if (tx->req == tx->done) { *tx->send_stop = 1; tx->queue_active = 0; tx->deactivate++; - mb(); + wmb(); } - mtx_unlock(&ss->tx.mtx); } + mtx_unlock(&ss->tx.mtx); + +#endif + } static struct mxge_media_type mxge_media_types[] = @@ -2721,6 +2811,16 @@ mxge_intr(void *arg) uint8_t valid; +#ifndef IFNET_MULTIQUEUE + /* an interrupt on a non-zero slice is implicitly valid + since MSI-X irqs are not shared */ + if (ss != sc->ss) { + mxge_clean_rx_done(ss); + *ss->irq_claim = be32toh(3); + return; + } +#endif + /* make sure the DMA has finished */ if (!stats->valid) { return; @@ -3042,7 +3142,11 @@ mxge_alloc_slice_rings(struct mxge_slice } /* now allocate TX resouces */ - +#ifndef IFNET_MULTIQUEUE + /* only use a single TX ring for now */ + if (ss != ss->sc->ss) + return 0; +#endif ss->tx.mask = tx_ring_entries - 1; ss->tx.max_desc = MIN(MXGE_MAX_SEND_DESC, tx_ring_entries / 4); @@ -3101,11 +3205,8 @@ mxge_alloc_slice_rings(struct mxge_slice return err;; } } - IFQ_SET_MAXLEN(&ss->tx.ifq, tx_ring_entries - 1); - ss->tx.ifq.ifq_drv_maxlen = ss->tx.ifq.ifq_maxlen; - IFQ_SET_READY(&ss->tx.ifq); - return 0; + } static int @@ -3210,16 +3311,21 @@ mxge_slice_open(struct mxge_slice_state /* get the lanai pointers to the send and receive rings */ err = 0; - - cmd.data0 = slice; - err = mxge_send_cmd(sc, MXGEFW_CMD_GET_SEND_OFFSET, &cmd); - ss->tx.lanai = - (volatile mcp_kreq_ether_send_t *)(sc->sram + cmd.data0); - ss->tx.send_go = (volatile uint32_t *) - (sc->sram + MXGEFW_ETH_SEND_GO + 64 * slice); - ss->tx.send_stop = (volatile uint32_t *) +#ifndef IFNET_MULTIQUEUE + /* We currently only send from the first slice */ + if (slice == 0) { +#endif + cmd.data0 = slice; + err = mxge_send_cmd(sc, MXGEFW_CMD_GET_SEND_OFFSET, &cmd); + ss->tx.lanai = + (volatile mcp_kreq_ether_send_t *)(sc->sram + cmd.data0); + ss->tx.send_go = (volatile uint32_t *) + (sc->sram + MXGEFW_ETH_SEND_GO + 64 * slice); + ss->tx.send_stop = (volatile uint32_t *) (sc->sram + MXGEFW_ETH_SEND_STOP + 64 * slice); - +#ifndef IFNET_MULTIQUEUE + } +#endif cmd.data0 = slice; err |= mxge_send_cmd(sc, MXGEFW_CMD_GET_SMALL_RX_OFFSET, &cmd); @@ -3271,6 +3377,7 @@ mxge_open(mxge_softc_t *sc) int err, big_bytes, nbufs, slice, cl_size, i; bus_addr_t bus; volatile uint8_t *itable; + struct mxge_slice_state *ss; /* Copy the MAC address in case it was overridden */ bcopy(IF_LLADDR(sc->ifp), sc->mac_addr, ETHER_ADDR_LEN); @@ -3340,8 +3447,14 @@ mxge_open(mxge_softc_t *sc) } /* Now give him the pointer to the stats block */ - for (slice = 0; slice < sc->num_slices; slice++) { - struct mxge_slice_state *ss = &sc->ss[slice]; + for (slice = 0; +#ifdef IFNET_MULTIQUEUE + slice < sc->num_slices; +#else + slice < 1; +#endif + slice++) { + ss = &sc->ss[slice]; cmd.data0 = MXGE_LOWPART_TO_U32(ss->fw_stats_dma.bus_addr); cmd.data1 = @@ -3385,8 +3498,16 @@ mxge_open(mxge_softc_t *sc) device_printf(sc->dev, "Couldn't bring up link\n"); goto abort; } +#ifdef IFNET_MULTIQUEUE + for (slice = 0; slice < sc->num_slices; slice++) { + ss = &sc->ss[slice]; + ss->if_drv_flags |= IFF_DRV_RUNNING; + ss->if_drv_flags &= ~IFF_DRV_OACTIVE; + } +#endif sc->ifp->if_drv_flags |= IFF_DRV_RUNNING; sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + callout_reset(&sc->co_hdl, mxge_ticks, mxge_tick, sc); return 0; @@ -3403,8 +3524,18 @@ mxge_close(mxge_softc_t *sc) { mxge_cmd_t cmd; int err, old_down_cnt; +#ifdef IFNET_MULTIQUEUE + struct mxge_slice_state *ss; + int slice; +#endif callout_stop(&sc->co_hdl); +#ifdef IFNET_MULTIQUEUE + for (slice = 0; slice < sc->num_slices; slice++) { + ss = &sc->ss[slice]; + ss->if_drv_flags &= ~IFF_DRV_RUNNING; + } +#endif sc->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; old_down_cnt = sc->down_cnt; wmb(); @@ -3521,8 +3652,11 @@ mxge_watchdog_reset(mxge_softc_t *sc, in } } else { tx = &sc->ss[slice].tx; - device_printf(sc->dev, "NIC did not reboot, slice %d ring state:\n", slice); - device_printf(sc->dev, "tx.req=%d tx.done=%d, tx.queue_active=%d\n", + device_printf(sc->dev, + "NIC did not reboot, slice %d ring state:\n", + slice); + device_printf(sc->dev, + "tx.req=%d tx.done=%d, tx.queue_active=%d\n", tx->req, tx->done, tx->queue_active); device_printf(sc->dev, "tx.activate=%d tx.deactivate=%d\n", tx->activate, tx->deactivate); @@ -3543,7 +3677,13 @@ mxge_watchdog(mxge_softc_t *sc) /* see if we have outstanding transmits, which have been pending for more than mxge_ticks */ - for (i = 0; (i < sc->num_slices) && (err == 0); i++) { + for (i = 0; +#ifdef IFNET_MULTIQUEUE + (i < sc->num_slices) && (err == 0); +#else + (i < 1) && (err == 0); +#endif + i++) { tx = &sc->ss[i].tx; if (tx->req != tx->done && tx->watchdog_req != tx->watchdog_done && @@ -3572,8 +3712,11 @@ mxge_update_stats(mxge_softc_t *sc) struct mxge_slice_state *ss; u_long ipackets = 0; u_long opackets = 0; +#ifdef IFNET_MULTIQUEUE u_long obytes = 0; u_long omcasts = 0; + u_long odrops = 0; +#endif u_long oerrors = 0; int slice; @@ -3581,14 +3724,20 @@ mxge_update_stats(mxge_softc_t *sc) ss = &sc->ss[slice]; ipackets += ss->ipackets; opackets += ss->opackets; +#ifdef IFNET_MULTIQUEUE obytes += ss->obytes; omcasts += ss->omcasts; + odrops += ss->tx.br->br_drops; +#endif oerrors += ss->oerrors; } sc->ifp->if_ipackets = ipackets; sc->ifp->if_opackets = opackets; +#ifdef IFNET_MULTIQUEUE sc->ifp->if_obytes = obytes; sc->ifp->if_omcasts = omcasts; + sc->ifp->if_snd.ifq_drops = odrops; +#endif sc->ifp->if_oerrors = oerrors; } @@ -3813,8 +3962,13 @@ mxge_free_slices(mxge_softc_t *sc) if (ss->fw_stats != NULL) { mxge_dma_free(&ss->fw_stats_dma); ss->fw_stats = NULL; +#ifdef IFNET_MULTIQUEUE + if (ss->tx.br != NULL) { + drbr_free(ss->tx.br, M_DEVBUF); + ss->tx.br = NULL; + } +#endif mtx_destroy(&ss->tx.mtx); - mtx_destroy(&ss->tx.ifq.ifq_mtx); } if (ss->rx_done.entry != NULL) { mxge_dma_free(&ss->rx_done.dma); @@ -3860,9 +4014,14 @@ mxge_alloc_slices(mxge_softc_t *sc) bzero(ss->rx_done.entry, bytes); /* - * allocate the per-slice firmware stats + * allocate the per-slice firmware stats; stats + * (including tx) are used used only on the first + * slice for now */ - +#ifndef IFNET_MULTIQUEUE + if (i > 0) + continue; +#endif bytes = sizeof (*ss->fw_stats); err = mxge_dma_alloc(sc, &ss->fw_stats_dma, sizeof (*ss->fw_stats), 64); @@ -3872,9 +4031,11 @@ mxge_alloc_slices(mxge_softc_t *sc) snprintf(ss->tx.mtx_name, sizeof(ss->tx.mtx_name), "%s:tx(%d)", device_get_nameunit(sc->dev), i); mtx_init(&ss->tx.mtx, ss->tx.mtx_name, NULL, MTX_DEF); - snprintf(ss->tx.ifq_mtx_name, sizeof(ss->tx.mtx_name), - "%s:ifp(%d)", device_get_nameunit(sc->dev), i); - mtx_init(&ss->tx.ifq.ifq_mtx, ss->tx.ifq_mtx_name, NULL, MTX_DEF); +#ifdef IFNET_MULTIQUEUE + ss->tx.br = buf_ring_alloc(2048, M_DEVBUF, M_WAITOK, + &ss->tx.mtx); +#endif + } return (0); @@ -4336,7 +4497,7 @@ mxge_attach(device_t dev) ifp->if_softc = sc; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = mxge_ioctl; -/* ifp->if_start = mxge_start;*/ + ifp->if_start = mxge_start; /* Initialise the ifmedia structure */ ifmedia_init(&sc->media, 0, mxge_media_change, mxge_media_status); @@ -4346,9 +4507,11 @@ mxge_attach(device_t dev) /* ether_ifattach sets mtu to 1500 */ if (ifp->if_capabilities & IFCAP_JUMBO_MTU) ifp->if_mtu = 9000; - ifp->if_transmit = mxge_transmit; mxge_add_sysctls(sc); +#ifdef IFNET_MULTIQUEUE + ifp->if_transmit = mxge_transmit; +#endif return 0; abort_with_rings: Modified: user/kmacy/HEAD_fast_multi_xmit/sys/dev/mxge/if_mxge_var.h ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/dev/mxge/if_mxge_var.h Tue Dec 9 16:20:58 2008 (r185796) +++ user/kmacy/HEAD_fast_multi_xmit/sys/dev/mxge/if_mxge_var.h Tue Dec 9 16:25:46 2008 (r185797) @@ -125,6 +125,9 @@ typedef struct typedef struct { struct mtx mtx; +#ifdef IFNET_MULTIQUEUE + struct buf_ring *br; +#endif volatile mcp_kreq_ether_send_t *lanai; /* lanai ptr for sendq */ volatile uint32_t *send_go; /* doorbell for sendq */ volatile uint32_t *send_stop; /* doorbell for sendq */ @@ -147,9 +150,7 @@ typedef struct int watchdog_done; /* cache of done */ int watchdog_rx_pause; /* cache of pause rq recvd */ int defrag; - struct ifaltq ifq; char mtx_name[16]; - char ifq_mtx_name[16]; } mxge_tx_ring_t; struct lro_entry; From owner-svn-src-user@FreeBSD.ORG Tue Dec 9 17:47:07 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4CEF2106567D; Tue, 9 Dec 2008 17:47:06 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B329B8FC17; Tue, 9 Dec 2008 17:47:06 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB9Hl6T6097539; Tue, 9 Dec 2008 17:47:06 GMT (envelope-from dfr@svn.freebsd.org) Received: (from dfr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB9Hl6hU097525; Tue, 9 Dec 2008 17:47:06 GMT (envelope-from dfr@svn.freebsd.org) Message-Id: <200812091747.mB9Hl6hU097525@svn.freebsd.org> From: Doug Rabson Date: Tue, 9 Dec 2008 17:47:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185803 - in user/dfr/xenhvm/6/sys: conf dev/xen/blkfront dev/xen/console dev/xen/netfront dev/xen/xenpci i386/include/xen i386/xen xen xen/xenbus X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Dec 2008 17:47:07 -0000 Author: dfr Date: Tue Dec 9 17:47:05 2008 New Revision: 185803 URL: http://svn.freebsd.org/changeset/base/185803 Log: Add support for suspend and resume. This currently only works for 64bit HV mode kernels. A 32bit PV mode kernel will suspend but fails to restore because Xen gets confused by the magic recursive mappings in the virtual address space. Added: user/dfr/xenhvm/6/sys/dev/xen/xenpci/machine_reboot.c Modified: user/dfr/xenhvm/6/sys/conf/files user/dfr/xenhvm/6/sys/dev/xen/blkfront/blkfront.c user/dfr/xenhvm/6/sys/dev/xen/console/xencons_ring.c user/dfr/xenhvm/6/sys/dev/xen/netfront/netfront.c user/dfr/xenhvm/6/sys/dev/xen/xenpci/evtchn.c user/dfr/xenhvm/6/sys/dev/xen/xenpci/xenpci.c user/dfr/xenhvm/6/sys/dev/xen/xenpci/xenpcivar.h user/dfr/xenhvm/6/sys/i386/include/xen/xenvar.h user/dfr/xenhvm/6/sys/i386/xen/clock.c user/dfr/xenhvm/6/sys/i386/xen/mp_machdep.c user/dfr/xenhvm/6/sys/i386/xen/xen_machdep.c user/dfr/xenhvm/6/sys/xen/reboot.c user/dfr/xenhvm/6/sys/xen/xenbus/xenbus_probe.c Modified: user/dfr/xenhvm/6/sys/conf/files ============================================================================== --- user/dfr/xenhvm/6/sys/conf/files Tue Dec 9 17:47:00 2008 (r185802) +++ user/dfr/xenhvm/6/sys/conf/files Tue Dec 9 17:47:05 2008 (r185803) @@ -2069,6 +2069,7 @@ dev/xen/netfront/netfront.c optional xen/gnttab.c optional xenhvm xen/features.c optional xenhvm dev/xen/xenpci/evtchn.c optional xenhvm +dev/xen/xenpci/machine_reboot.c optional xenhvm xen/evtchn/evtchn_dev.c optional xenhvm xen/reboot.c optional xenhvm xen/xenbus/xenbus_client.c optional xenhvm Modified: user/dfr/xenhvm/6/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- user/dfr/xenhvm/6/sys/dev/xen/blkfront/blkfront.c Tue Dec 9 17:47:00 2008 (r185802) +++ user/dfr/xenhvm/6/sys/dev/xen/blkfront/blkfront.c Tue Dec 9 17:47:05 2008 (r185803) @@ -377,13 +377,12 @@ blkfront_resume(device_t dev) DPRINTK("blkfront_resume: %s\n", xenbus_get_node(dev)); - blkif_free(info, 1); - + blkif_free(info, info->connected == BLKIF_STATE_CONNECTED); err = talk_to_backend(dev, info); - if (!err) + if (info->connected == BLKIF_STATE_SUSPENDED && !err) blkif_recover(info); - return err; + return (err); } /* Common code used when first setting up, and when resuming. */ @@ -427,7 +426,7 @@ talk_to_backend(device_t dev, struct blk err = xenbus_transaction_end(xbt, 0); if (err) { - if (err == -EAGAIN) + if (err == EAGAIN) goto again; xenbus_dev_fatal(dev, err, "completing transaction"); goto destroy_blkring; Modified: user/dfr/xenhvm/6/sys/dev/xen/console/xencons_ring.c ============================================================================== --- user/dfr/xenhvm/6/sys/dev/xen/console/xencons_ring.c Tue Dec 9 17:47:00 2008 (r185802) +++ user/dfr/xenhvm/6/sys/dev/xen/console/xencons_ring.c Tue Dec 9 17:47:05 2008 (r185803) @@ -26,6 +26,7 @@ __FBSDID("$FreeBSD$"); #include #define console_evtchn console.domU.evtchn +static unsigned int console_irq; extern char *console_page; static inline struct xencons_interface * @@ -118,14 +119,17 @@ xencons_ring_init(void) err = bind_caller_port_to_irqhandler(xen_start_info->console_evtchn, "xencons", xencons_handle_input, NULL, - INTR_TYPE_MISC | INTR_MPSAFE, NULL); + INTR_TYPE_MISC | INTR_MPSAFE, &console_irq); if (err) { return err; } return 0; } -#ifdef notyet + +extern void xencons_suspend(void); +extern void xencons_resume(void); + void xencons_suspend(void) { @@ -133,7 +137,7 @@ xencons_suspend(void) if (!xen_start_info->console_evtchn) return; - unbind_evtchn_from_irqhandler(xen_start_info->console_evtchn, NULL); + unbind_from_irqhandler(console_irq); } void @@ -142,7 +146,7 @@ xencons_resume(void) (void)xencons_ring_init(); } -#endif + /* * Local variables: * mode: C Modified: user/dfr/xenhvm/6/sys/dev/xen/netfront/netfront.c ============================================================================== --- user/dfr/xenhvm/6/sys/dev/xen/netfront/netfront.c Tue Dec 9 17:47:00 2008 (r185802) +++ user/dfr/xenhvm/6/sys/dev/xen/netfront/netfront.c Tue Dec 9 17:47:05 2008 (r185803) @@ -430,13 +430,11 @@ netfront_attach(device_t dev) * leave the device-layer structures intact so that this is transparent to the * rest of the kernel. */ -static int +static int netfront_resume(device_t dev) { struct netfront_info *info = device_get_softc(dev); - - DPRINTK("%s\n", xenbus_get_node(dev)); - + netif_disconnect_backend(info); return (0); } @@ -576,9 +574,6 @@ setup_device(device_t dev, struct netfro if (error) goto fail; -#if 0 - network_connect(info); -#endif error = bind_listening_port_to_irqhandler(xenbus_get_otherend_id(dev), "xn", xn_intr, info, INTR_TYPE_NET | INTR_MPSAFE, &info->irq); @@ -1596,6 +1591,7 @@ network_connect(struct netfront_info *np /* Step 2: Rebuild the RX buffer freelist and the RX ring itself. */ for (requeue_idx = 0, i = 0; i < NET_RX_RING_SIZE; i++) { struct mbuf *m; + u_long pfn; if (np->rx_mbufs[i] == NULL) continue; @@ -1603,15 +1599,16 @@ network_connect(struct netfront_info *np m = np->rx_mbufs[requeue_idx] = xennet_get_rx_mbuf(np, i); ref = np->grant_rx_ref[requeue_idx] = xennet_get_rx_ref(np, i); req = RING_GET_REQUEST(&np->rx, requeue_idx); + pfn = vtophys(mtod(m, vm_offset_t)) >> PAGE_SHIFT; if (!np->copying_receiver) { gnttab_grant_foreign_transfer_ref(ref, xenbus_get_otherend_id(np->xbdev), - vtophys(mtod(m, vm_offset_t))); + pfn); } else { gnttab_grant_foreign_access_ref(ref, xenbus_get_otherend_id(np->xbdev), - vtophys(mtod(m, vm_offset_t)), 0); + PFNTOMFN(pfn), 0); } req->gref = ref; req->id = requeue_idx; @@ -1786,7 +1783,12 @@ static void netif_free(struct netfront_i static void netif_disconnect_backend(struct netfront_info *info) { - xn_stop(info); + XN_RX_LOCK(info); + XN_TX_LOCK(info); + netfront_carrier_off(info); + XN_TX_UNLOCK(info); + XN_RX_UNLOCK(info); + end_access(info->tx_ring_ref, info->tx.sring); end_access(info->rx_ring_ref, info->rx.sring); info->tx_ring_ref = GRANT_INVALID_REF; @@ -1794,12 +1796,8 @@ static void netif_disconnect_backend(str info->tx.sring = NULL; info->rx.sring = NULL; -#if 0 if (info->irq) unbind_from_irqhandler(info->irq); -#else - panic("FIX ME"); -#endif info->irq = 0; } Modified: user/dfr/xenhvm/6/sys/dev/xen/xenpci/evtchn.c ============================================================================== --- user/dfr/xenhvm/6/sys/dev/xen/xenpci/evtchn.c Tue Dec 9 17:47:00 2008 (r185802) +++ user/dfr/xenhvm/6/sys/dev/xen/xenpci/evtchn.c Tue Dec 9 17:47:05 2008 (r185803) @@ -75,6 +75,7 @@ static int evtchn_to_irq[NR_EVENT_CHANNE [0 ... NR_EVENT_CHANNELS-1] = -1 }; static struct mtx irq_alloc_lock; +static device_t xenpci_device; #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) @@ -317,7 +318,7 @@ evtchn_interrupt(void *arg) handler = irq_evtchn[irq].handler; handler_arg = irq_evtchn[irq].arg; if (unlikely(handler == NULL)) { - printk("Xen IRQ%d (port %d) has no handler!\n", + printf("Xen IRQ%d (port %d) has no handler!\n", irq, port); mtx_unlock(&irq_evtchn[irq].lock); continue; @@ -345,8 +346,27 @@ evtchn_interrupt(void *arg) } } -void irq_resume(void) +void +irq_suspend(void) { + struct xenpci_softc *scp = device_get_softc(xenpci_device); + + /* + * Take our interrupt handler out of the list of handlers + * that can handle this irq. + */ + if (scp->intr_cookie != NULL) { + if (BUS_TEARDOWN_INTR(device_get_parent(xenpci_device), + xenpci_device, scp->res_irq, scp->intr_cookie) != 0) + printf("intr teardown failed.. continuing\n"); + scp->intr_cookie = NULL; + } +} + +void +irq_resume(void) +{ + struct xenpci_softc *scp = device_get_softc(xenpci_device); int evtchn, irq; for (evtchn = 0; evtchn < NR_EVENT_CHANNELS; evtchn++) { @@ -356,6 +376,10 @@ void irq_resume(void) for (irq = 0; irq < ARRAY_SIZE(irq_evtchn); irq++) irq_evtchn[irq].evtchn = 0; + + BUS_SETUP_INTR(device_get_parent(xenpci_device), + xenpci_device, scp->res_irq, INTR_TYPE_MISC, + evtchn_interrupt, NULL, &scp->intr_cookie); } int @@ -380,5 +404,7 @@ xenpci_irq_init(device_t device, struct if (error) return (error); + xenpci_device = device; + return (0); } Added: user/dfr/xenhvm/6/sys/dev/xen/xenpci/machine_reboot.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/dfr/xenhvm/6/sys/dev/xen/xenpci/machine_reboot.c Tue Dec 9 17:47:05 2008 (r185803) @@ -0,0 +1,125 @@ +#include +__FBSDID("$FreeBSD: user/dfr/xenhvm/6/sys/xen/evtchn/evtchn.c 184235 2008-10-25 00:25:25Z kmacy $"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + +struct ap_suspend_info { + int do_spin; + atomic_t nr_spinning; +}; + +#ifdef CONFIG_SMP + +/* + * Spinning prevents, for example, APs touching grant table entries while + * the shared grant table is not mapped into the address space imemdiately + * after resume. + */ +static void ap_suspend(void *_info) +{ + struct ap_suspend_info *info = _info; + + BUG_ON(!irqs_disabled()); + + atomic_inc(&info->nr_spinning); + mb(); + + while (info->do_spin) + cpu_relax(); + + mb(); + atomic_dec(&info->nr_spinning); +} + +#define initiate_ap_suspend(i) smp_call_function(ap_suspend, i, 0, 0) + +#else /* !defined(CONFIG_SMP) */ + +#define initiate_ap_suspend(i) 0 + +#endif + +static int bp_suspend(void) +{ + int suspend_cancelled; + + suspend_cancelled = HYPERVISOR_suspend(0); + if (!suspend_cancelled) + xenpci_resume(); + + return suspend_cancelled; +} + +void +xen_suspend() +{ + int suspend_cancelled; + //struct ap_suspend_info info; + + if (DEVICE_SUSPEND(root_bus)) { + printf("xen_suspend: device_suspend failed\n"); + return; + } + + critical_enter(); + + /* Prevent any races with evtchn_interrupt() handler. */ + irq_suspend(); + +#if 0 + info.do_spin = 1; + atomic_set(&info.nr_spinning, 0); + smp_mb(); + + nr_cpus = num_online_cpus() - 1; + + err = initiate_ap_suspend(&info); + if (err < 0) { + critical_exit(); + //xenbus_suspend_cancel(); + return err; + } + + while (atomic_read(&info.nr_spinning) != nr_cpus) + cpu_relax(); +#endif + + disable_intr(); + suspend_cancelled = bp_suspend(); + //resume_notifier(suspend_cancelled); + enable_intr(); + +#if 0 + smp_mb(); + info.do_spin = 0; + while (atomic_read(&info.nr_spinning) != 0) + cpu_relax(); +#endif + + critical_exit(); + + if (!suspend_cancelled) + DEVICE_RESUME(root_bus); +#if 0 + else + xenbus_suspend_cancel(); +#endif +} Modified: user/dfr/xenhvm/6/sys/dev/xen/xenpci/xenpci.c ============================================================================== --- user/dfr/xenhvm/6/sys/dev/xen/xenpci/xenpci.c Tue Dec 9 17:47:00 2008 (r185802) +++ user/dfr/xenhvm/6/sys/dev/xen/xenpci/xenpci.c Tue Dec 9 17:47:05 2008 (r185803) @@ -44,6 +44,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include @@ -63,6 +65,7 @@ __FBSDID("$FreeBSD$"); */ char *hypercall_stubs; shared_info_t *HYPERVISOR_shared_info; +static vm_paddr_t shared_info_pa; /* * The softc is automatically allocated by the parent bus using the @@ -75,7 +78,6 @@ static int xenpci_deallocate_resources(d static int xenpci_allocate_resources(device_t device); static int xenpci_attach(device_t device, struct xenpci_softc *scp); static int xenpci_detach(device_t device, struct xenpci_softc *scp); -static int xenpci_resume(device_t device, struct xenpci_softc *scp); static int xenpci_alloc_space_int(struct xenpci_softc *scp, size_t sz, u_long *pa); @@ -155,9 +157,8 @@ xenpci_pci_detach (device_t device) static int xenpci_pci_resume(device_t device) { - struct xenpci_softc *scp = DEVICE2SOFTC(device); - return (xenpci_resume(device, scp)); + return (bus_generic_resume(device)); } /* @@ -251,7 +252,6 @@ xenpci_attach(device_t device, struct xe { struct xen_add_to_physmap xatp; vm_offset_t shared_va; - vm_paddr_t shared_pa; if (xenpci_allocate_resources(device)) goto errexit; @@ -263,17 +263,17 @@ xenpci_attach(device_t device, struct xe setup_xen_features(); - xenpci_alloc_space_int(scp, PAGE_SIZE, &shared_pa); + xenpci_alloc_space_int(scp, PAGE_SIZE, &shared_info_pa); xatp.domid = DOMID_SELF; xatp.idx = 0; xatp.space = XENMAPSPACE_shared_info; - xatp.gpfn = shared_pa >> PAGE_SHIFT; + xatp.gpfn = shared_info_pa >> PAGE_SHIFT; if (HYPERVISOR_memory_op(XENMEM_add_to_physmap, &xatp)) panic("HYPERVISOR_memory_op failed"); shared_va = kmem_alloc_nofault(kernel_map, PAGE_SIZE); - pmap_kenter(shared_va, shared_pa); + pmap_kenter(shared_va, shared_info_pa); HYPERVISOR_shared_info = (void *) shared_va; /* @@ -316,13 +316,6 @@ xenpci_detach(device_t device, struct xe } static int -xenpci_resume(device_t device, struct xenpci_softc *scp) -{ - - xenpci_resume_hypercall_stubs(device, scp); -} - -static int xenpci_allocate_resources(device_t device) { int error; @@ -412,11 +405,26 @@ xenpci_alloc_space(size_t sz, vm_paddr_t } void -printk(const char *fmt, ...) +xenpci_resume() { - __va_list ap; + device_t device = devclass_get_device(xenpci_devclass, 0); + struct xenpci_softc *scp = DEVICE2SOFTC(device); + struct xen_add_to_physmap xatp; + + xenpci_resume_hypercall_stubs(device, scp); - va_start(ap, fmt); - vprintf(fmt, ap); - va_end(ap); + xatp.domid = DOMID_SELF; + xatp.idx = 0; + xatp.space = XENMAPSPACE_shared_info; + xatp.gpfn = shared_info_pa >> PAGE_SHIFT; + if (HYPERVISOR_memory_op(XENMEM_add_to_physmap, &xatp)) + panic("HYPERVISOR_memory_op failed"); + + pmap_kenter((vm_offset_t) HYPERVISOR_shared_info, shared_info_pa); + + xenpci_set_callback(device); + + gnttab_resume(); + irq_resume(); } + Modified: user/dfr/xenhvm/6/sys/dev/xen/xenpci/xenpcivar.h ============================================================================== --- user/dfr/xenhvm/6/sys/dev/xen/xenpci/xenpcivar.h Tue Dec 9 17:47:00 2008 (r185802) +++ user/dfr/xenhvm/6/sys/dev/xen/xenpci/xenpcivar.h Tue Dec 9 17:47:05 2008 (r185803) @@ -41,3 +41,5 @@ struct xenpci_softc { extern int xenpci_irq_init(device_t device, struct xenpci_softc *scp); extern int xenpci_alloc_space(size_t sz, vm_paddr_t *pa); +extern void xenpci_resume(void); +extern void xen_suspend(void); Modified: user/dfr/xenhvm/6/sys/i386/include/xen/xenvar.h ============================================================================== --- user/dfr/xenhvm/6/sys/i386/include/xen/xenvar.h Tue Dec 9 17:47:00 2008 (r185802) +++ user/dfr/xenhvm/6/sys/i386/include/xen/xenvar.h Tue Dec 9 17:47:05 2008 (r185803) @@ -39,6 +39,8 @@ extern int xendebug_flags; #endif extern xen_pfn_t *xen_phys_machine; +extern xen_pfn_t *xen_pfn_to_mfn_frame_list[16]; +extern xen_pfn_t *xen_pfn_to_mfn_frame_list_list; #if 0 #define TRACE_ENTER XENPRINTF("(file=%s, line=%d) entered %s\n", __FILE__, __LINE__, __FUNCTION__) Modified: user/dfr/xenhvm/6/sys/i386/xen/clock.c ============================================================================== --- user/dfr/xenhvm/6/sys/i386/xen/clock.c Tue Dec 9 17:47:00 2008 (r185802) +++ user/dfr/xenhvm/6/sys/i386/xen/clock.c Tue Dec 9 17:47:05 2008 (r185803) @@ -131,7 +131,7 @@ static u_char timer2_state = RELEASED; static struct timespec shadow_tv; static uint32_t shadow_tv_version; /* XXX: lazy locking */ static uint64_t processed_system_time; /* stime (ns) at last processing. */ - +static unsigned int time_irq; #ifdef XEN_PRIVILEGED_GUEST static struct mtx clock_lock; @@ -839,23 +839,25 @@ static struct vcpu_set_periodic_timer xe void cpu_initclocks(void) { - int time_irq; xen_set_periodic_tick.period_ns = NS_PER_TICK; HYPERVISOR_vcpu_op(VCPUOP_set_periodic_timer, 0, &xen_set_periodic_tick); - if ((time_irq = bind_virq_to_irqhandler(VIRQ_TIMER, 0, "clk", - (driver_intr_t *)clkintr, INTR_TYPE_CLK | INTR_FAST, - NULL)) < 0) { + if (time_irq) + unbind_from_irqhandler(time_irq); + time_irq = 0; + + if (bind_virq_to_irqhandler(VIRQ_TIMER, 0, "clk", + (driver_intr_t *)clkintr, INTR_TYPE_CLK | INTR_FAST, + &time_irq)) { panic("failed to register clock interrupt\n"); } /* should fast clock be enabled ? */ } - int ap_cpu_initclocks(int cpu) { Modified: user/dfr/xenhvm/6/sys/i386/xen/mp_machdep.c ============================================================================== --- user/dfr/xenhvm/6/sys/i386/xen/mp_machdep.c Tue Dec 9 17:47:00 2008 (r185802) +++ user/dfr/xenhvm/6/sys/i386/xen/mp_machdep.c Tue Dec 9 17:47:05 2008 (r185803) @@ -567,7 +567,7 @@ xen_smp_intr_init(unsigned int cpu) INTR_FAST|INTR_TYPE_TTY|INTR_MPSAFE, &pc->pc_resched_irq); printf("cpu=%d irq=%d vector=%d\n", - cpu, rc, RESCHEDULE_VECTOR); + cpu, pc->pc_resched_irq, RESCHEDULE_VECTOR); sprintf(callfunc_name[cpu], "callfunc%u", cpu); rc = bind_ipi_to_irqhandler(CALL_FUNCTION_VECTOR, cpu, @@ -578,7 +578,7 @@ xen_smp_intr_init(unsigned int cpu) goto fail; printf("cpu=%d irq=%d vector=%d\n", - cpu, rc, CALL_FUNCTION_VECTOR); + cpu, pc->pc_callfunc_irq, CALL_FUNCTION_VECTOR); if ((cpu != 0) && ((rc = ap_cpu_initclocks(cpu)) != 0)) goto fail; Modified: user/dfr/xenhvm/6/sys/i386/xen/xen_machdep.c ============================================================================== --- user/dfr/xenhvm/6/sys/i386/xen/xen_machdep.c Tue Dec 9 17:47:00 2008 (r185802) +++ user/dfr/xenhvm/6/sys/i386/xen/xen_machdep.c Tue Dec 9 17:47:05 2008 (r185803) @@ -88,6 +88,8 @@ start_info_t *xen_start_info; shared_info_t *HYPERVISOR_shared_info; xen_pfn_t *xen_machine_phys = machine_to_phys_mapping; xen_pfn_t *xen_phys_machine; +xen_pfn_t *xen_pfn_to_mfn_frame_list[16]; +xen_pfn_t *xen_pfn_to_mfn_frame_list_list; int preemptable, init_first; extern unsigned int avail_space; @@ -842,6 +844,39 @@ shift_phys_machine(unsigned long *phys_m } #endif /* ADD_ISA_HOLE */ +/* + * Build a directory of the pages that make up our Physical to Machine + * mapping table. The Xen suspend/restore code uses this to find our + * mapping table. + */ +static void +init_frame_list_list(void *arg) +{ + unsigned long nr_pages = xen_start_info->nr_pages; +#define FPP (PAGE_SIZE/sizeof(xen_pfn_t)) + int i, j, k; + + xen_pfn_to_mfn_frame_list_list = malloc(PAGE_SIZE, M_DEVBUF, M_WAITOK); + for (i = 0, j = 0, k = -1; i < nr_pages; + i += FPP, j++) { + if ((j & (FPP - 1)) == 0) { + k++; + xen_pfn_to_mfn_frame_list[k] = + malloc(PAGE_SIZE, M_DEVBUF, M_WAITOK); + xen_pfn_to_mfn_frame_list_list[k] = + VTOMFN(xen_pfn_to_mfn_frame_list[k]); + j = 0; + } + xen_pfn_to_mfn_frame_list[k][j] = + VTOMFN(&xen_phys_machine[i]); + } + + HYPERVISOR_shared_info->arch.max_pfn = nr_pages; + HYPERVISOR_shared_info->arch.pfn_to_mfn_frame_list_list + = VTOMFN(xen_pfn_to_mfn_frame_list_list); +} +SYSINIT(init_fll, SI_SUB_DEVFS, SI_ORDER_ANY, init_frame_list_list, NULL); + extern unsigned long physfree; int pdir, curoffset; @@ -975,7 +1010,7 @@ initvalues(start_info_t *startinfo) IdlePTDnew = (pd_entry_t *)cur_space; cur_space += 4*PAGE_SIZE; bzero(IdlePTDnew, 4*PAGE_SIZE); - for (i = 0; i < 4; i++) + for (i = 0; i < 4; i++) IdlePTDnewma[i] = xpmap_ptom(VTOP((uint8_t *)IdlePTDnew + i*PAGE_SIZE)); /* @@ -1020,8 +1055,6 @@ initvalues(start_info_t *startinfo) PT_UPDATES_FLUSH(); - - memcpy(((uint8_t *)IdlePTDnew) + ((unsigned int)(KERNBASE >> 18)), ((uint8_t *)IdlePTD) + ((KERNBASE >> 18) & PAGE_MASK), l1_pages*sizeof(pt_entry_t)); @@ -1082,14 +1115,12 @@ initvalues(start_info_t *startinfo) printk("#4\n"); - xen_store_ma = (((vm_paddr_t)xen_start_info->store_mfn) << PAGE_SHIFT); PT_SET_MA(xen_store, xen_store_ma | PG_KERNEL); console_page_ma = (((vm_paddr_t)xen_start_info->console.domU.mfn) << PAGE_SHIFT); PT_SET_MA(console_page, console_page_ma | PG_KERNEL); printk("#5\n"); - HYPERVISOR_shared_info->arch.pfn_to_mfn_frame_list_list = (unsigned long)xen_phys_machine; set_iopl.iopl = 1; err = HYPERVISOR_physdev_op(PHYSDEVOP_SET_IOPL, &set_iopl); Modified: user/dfr/xenhvm/6/sys/xen/reboot.c ============================================================================== --- user/dfr/xenhvm/6/sys/xen/reboot.c Tue Dec 9 17:47:00 2008 (r185802) +++ user/dfr/xenhvm/6/sys/xen/reboot.c Tue Dec 9 17:47:05 2008 (r185803) @@ -34,13 +34,34 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #include #include +#include #include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include + +#ifdef XENHVM + +#include + +#else + +static void xen_suspend(void); + +#endif + static void shutdown_handler(struct xenbus_watch *watch, const char **vec, unsigned int len) @@ -91,22 +112,35 @@ shutdown_handler(struct xenbus_watch *wa printf("Ignoring shutdown request: %s\n", str); goto done; } -#ifdef notyet - if (howto == -1) { - do_suspend(NULL); - goto done; - } -#else + if (howto == -1) { - printf("suspend not currently supported\n"); + xen_suspend(); goto done; } -#endif + shutdown_nice(howto); done: free(str, M_DEVBUF); } +#ifndef XENHVM + +/* + * In HV mode, we let acpi take care of halts and reboots. + */ + +static void +xen_shutdown_final(void *arg, int howto) +{ + + if (howto & (RB_HALT | RB_POWEROFF)) + HYPERVISOR_shutdown(SHUTDOWN_poweroff); + else + HYPERVISOR_shutdown(SHUTDOWN_reboot); +} + +#endif + static struct xenbus_watch shutdown_watch = { .node = "control/shutdown", .callback = shutdown_handler @@ -118,80 +152,61 @@ setup_shutdown_watcher(void *unused) if (register_xenbus_watch(&shutdown_watch)) printf("Failed to set shutdown watcher\n"); +#ifndef XENHVM + EVENTHANDLER_REGISTER(shutdown_final, xen_shutdown_final, NULL, + SHUTDOWN_PRI_LAST); +#endif } SYSINIT(shutdown, SI_SUB_PSEUDO, SI_ORDER_ANY, setup_shutdown_watcher, NULL); -#ifdef notyet +#ifndef XENHVM + +extern void xencons_suspend(void); +extern void xencons_resume(void); static void -xen_suspend(void *ignore) +xen_suspend() { int i, j, k, fpp; + unsigned long max_pfn; - extern void time_resume(void); - extern unsigned long max_pfn; - extern unsigned long *pfn_to_mfn_frame_list_list; - extern unsigned long *pfn_to_mfn_frame_list[]; - -#ifdef CONFIG_SMP -#error "do_suspend must be run cpu 0 - need to create separate thread" - cpumask_t prev_online_cpus; - int vcpu_prepare(int vcpu); -#endif - - int err = 0; - - PANIC_IF(smp_processor_id() != 0); - -#if defined(CONFIG_SMP) && !defined(CONFIG_HOTPLUG_CPU) - if (num_online_cpus() > 1) { - printk(KERN_WARNING "Can't suspend SMP guests " - "without CONFIG_HOTPLUG_CPU\n"); - return -EOPNOTSUPP; - } -#endif - - xenbus_suspend(); - -#ifdef CONFIG_SMP - lock_cpu_hotplug(); +#ifdef SMP + cpumask_t map; /* - * Take all other CPUs offline. We hold the hotplug semaphore to - * avoid other processes bringing up CPUs under our feet. + * Bind us to CPU 0 and stop any other VCPUs. */ - cpus_clear(prev_online_cpus); - while (num_online_cpus() > 1) { - for_each_online_cpu(i) { - if (i == 0) - continue; - unlock_cpu_hotplug(); - err = cpu_down(i); - lock_cpu_hotplug(); - if (err != 0) { - printk(KERN_CRIT "Failed to take all CPUs " - "down: %d.\n", err); - goto out_reenable_cpus; - } - cpu_set(i, prev_online_cpus); - } - } -#endif /* CONFIG_SMP */ + mtx_lock_spin(&sched_lock); + sched_bind(curthread, 0); + mtx_unlock_spin(&sched_lock); + KASSERT(PCPU_GET(cpuid) == 0, ("xen_suspend: not running on cpu 0")); + + map = PCPU_GET(other_cpus) & ~stopped_cpus; + if (map) + stop_cpus(map); +#endif - preempt_disable(); + if (DEVICE_SUSPEND(root_bus) != 0) { + printf("xen_suspend: device_suspend failed\n"); + if (map) + restart_cpus(map); + return; + } + local_irq_disable(); - __cli(); - preempt_enable(); -#ifdef SMP - unlock_cpu_hotplug(); -#endif + xencons_suspend(); gnttab_suspend(); - pmap_kremove(HYPERVISOR_shared_info); + max_pfn = HYPERVISOR_shared_info->arch.max_pfn; + + void *shared_info = HYPERVISOR_shared_info; + HYPERVISOR_shared_info = NULL; + pmap_kremove((vm_offset_t) shared_info); + PT_UPDATES_FLUSH(); - xen_start_info->store_mfn = mfn_to_pfn(xen_start_info->store_mfn); - xen_start_info->console.domU.mfn = mfn_to_pfn(xen_start_info->console.domU.mfn); + xen_start_info->store_mfn = MFNTOPFN(xen_start_info->store_mfn); + xen_start_info->console.domU.mfn = MFNTOPFN(xen_start_info->console.domU.mfn); /* * We'll stop somewhere inside this hypercall. When it returns, @@ -199,38 +214,33 @@ xen_suspend(void *ignore) */ HYPERVISOR_suspend(VTOMFN(xen_start_info)); - pmap_kenter_ma(HYPERVISOR_shared_info, xen_start_info->shared_info); - set_fixmap(FIX_SHARED_INFO, xen_start_info->shared_info); + pmap_kenter_ma((vm_offset_t) shared_info, xen_start_info->shared_info); + HYPERVISOR_shared_info = shared_info; -#if 0 - memset(empty_zero_page, 0, PAGE_SIZE); -#endif HYPERVISOR_shared_info->arch.pfn_to_mfn_frame_list_list = - VTOMFN(pfn_to_mfn_frame_list_list); + VTOMFN(xen_pfn_to_mfn_frame_list_list); fpp = PAGE_SIZE/sizeof(unsigned long); for (i = 0, j = 0, k = -1; i < max_pfn; i += fpp, j++) { if ((j % fpp) == 0) { k++; - pfn_to_mfn_frame_list_list[k] = - VTOMFN(pfn_to_mfn_frame_list[k]); + xen_pfn_to_mfn_frame_list_list[k] = + VTOMFN(xen_pfn_to_mfn_frame_list[k]); j = 0; } - pfn_to_mfn_frame_list[k][j] = - VTOMFN(&phys_to_machine_mapping[i]); + xen_pfn_to_mfn_frame_list[k][j] = + VTOMFN(&xen_phys_machine[i]); } HYPERVISOR_shared_info->arch.max_pfn = max_pfn; gnttab_resume(); - irq_resume(); - - time_resume(); - - __sti(); - + cpu_initclocks(); + local_irq_enable(); xencons_resume(); + printf("UP\n"); + #ifdef CONFIG_SMP for_each_cpu(i) vcpu_prepare(i); @@ -240,21 +250,13 @@ xen_suspend(void *ignore) * Only resume xenbus /after/ we've prepared our VCPUs; otherwise * the VCPU hotplug callback can race with our vcpu_prepare */ - xenbus_resume(); + DEVICE_RESUME(root_bus); -#ifdef CONFIG_SMP - out_reenable_cpus: - for_each_cpu_mask(i, prev_online_cpus) { - j = cpu_up(i); - if ((j != 0) && !cpu_online(i)) { - printk(KERN_CRIT "Failed to bring cpu " - "%d back up (%d).\n", - i, j); - err = j; - } - } +#ifdef SMP + sched_unbind(curthread); + if (map) + restart_cpus(map); #endif - return err; } -#endif /* notyet */ +#endif Modified: user/dfr/xenhvm/6/sys/xen/xenbus/xenbus_probe.c ============================================================================== --- user/dfr/xenhvm/6/sys/xen/xenbus/xenbus_probe.c Tue Dec 9 17:47:00 2008 (r185802) +++ user/dfr/xenhvm/6/sys/xen/xenbus/xenbus_probe.c Tue Dec 9 17:47:05 2008 (r185803) @@ -389,28 +389,90 @@ xenbus_attach(device_t dev) return (0); } -static void +static int xenbus_suspend(device_t dev) { + int error; + DPRINTK(""); - panic("implement me"); -#if 0 - bus_for_each_dev(&xenbus_frontend.bus, NULL, NULL, suspend_dev); - bus_for_each_dev(&xenbus_backend.bus, NULL, NULL, suspend_dev); -#endif + + error = bus_generic_suspend(dev); + if (error) + return (error); + xs_suspend(); + + return (0); } -static void +static int xenbus_resume(device_t dev) { + device_t *kids; + struct xenbus_device_ivars *ivars; + int i, count, error; + char *statepath; + xb_init_comms(); xs_resume(); - panic("implement me"); + + /* + * We must re-examine each device and find the new path for + * its backend. + */ + if (device_get_children(dev, &kids, &count) == 0) { + for (i = 0; i < count; i++) { + if (device_get_state(kids[i]) == DS_NOTPRESENT) + continue; + + ivars = device_get_ivars(kids[i]); + + unregister_xenbus_watch( + &ivars->xd_otherend_watch); + ivars->xd_state = XenbusStateInitialising; + + /* + * Find the new backend details and + * re-register our watch. + */ + free(ivars->xd_otherend_path, M_DEVBUF); + error = xenbus_gather(XBT_NIL, ivars->xd_node, + "backend-id", "%i", &ivars->xd_otherend_id, + "backend", NULL, &ivars->xd_otherend_path, + NULL); + if (error) + return (error); + + DEVICE_RESUME(kids[i]); + + statepath = malloc(strlen(ivars->xd_otherend_path) + + strlen("/state") + 1, M_DEVBUF, M_WAITOK); + sprintf(statepath, "%s/state", ivars->xd_otherend_path); + + free(ivars->xd_otherend_watch.node, M_DEVBUF); + ivars->xd_otherend_watch.node = statepath; + register_xenbus_watch( + &ivars->xd_otherend_watch); + #if 0 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Wed Dec 10 00:54:22 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33C371065670; Wed, 10 Dec 2008 00:54:22 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F66F8FC26; Wed, 10 Dec 2008 00:54:22 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBA0sLYk007334; Wed, 10 Dec 2008 00:54:21 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBA0sL3P007331; Wed, 10 Dec 2008 00:54:21 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812100054.mBA0sL3P007331@svn.freebsd.org> From: Kip Macy Date: Wed, 10 Dec 2008 00:54:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185815 - in user/kmacy/head_arpv2/sys: netinet netinet6 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2008 00:54:22 -0000 Author: kmacy Date: Wed Dec 10 00:54:21 2008 New Revision: 185815 URL: http://svn.freebsd.org/changeset/base/185815 Log: - add missed radix node head lock acquisition when calling - only acquire llentry lock exclusively when lookup fails - fix lle lookup Modified: user/kmacy/head_arpv2/sys/netinet/if_ether.c user/kmacy/head_arpv2/sys/netinet/in.c user/kmacy/head_arpv2/sys/netinet6/nd6_rtr.c Modified: user/kmacy/head_arpv2/sys/netinet/if_ether.c ============================================================================== --- user/kmacy/head_arpv2/sys/netinet/if_ether.c Wed Dec 10 00:08:25 2008 (r185814) +++ user/kmacy/head_arpv2/sys/netinet/if_ether.c Wed Dec 10 00:54:21 2008 (r185815) @@ -256,7 +256,7 @@ arpresolve(struct ifnet *ifp, struct rte INIT_VNET_INET(ifp->if_vnet); struct llentry *la = 0; u_int flags; - int error; + int error, renew; log(LOG_DEBUG, "arpesolve called\n"); *lle = NULL; @@ -275,12 +275,12 @@ arpresolve(struct ifnet *ifp, struct rte } flags = (ifp->if_flags & (IFF_NOARP | IFF_STATICARP)) ? 0 : LLE_CREATE; - flags |= (m ? LLE_EXCLUSIVE : 0); /* XXXXX * Since this function returns an llentry, the * lock is held by the caller. */ +retry: la = lla_lookup(LLTABLE(ifp), flags, dst); if (la == NULL) { if (flags & LLE_CREATE) @@ -325,17 +325,27 @@ arpresolve(struct ifnet *ifp, struct rte error = EINVAL; goto done; } + + renew = (la->la_asked == 0 || la->la_expire != time_uptime); /* * There is an arptab entry, but no ethernet address * response yet. Replace the held mbuf with this * latest one. */ if (m) { + if ((flags & LLE_EXCLUSIVE) == 0) { + flags |= LLE_EXCLUSIVE; + LLE_RUNLOCK(la); + goto retry; + } if (la->la_hold) m_freem(la->la_hold); la->la_hold = m; - if (!(la->la_asked == 0 || la->la_expire != time_uptime)) + if (renew == 0) { + flags &= ~LLE_EXCLUSIVE; LLE_DOWNGRADE(la); + } + } /* * Return EWOULDBLOCK if we have tried less than arp_maxtries. It @@ -349,7 +359,7 @@ arpresolve(struct ifnet *ifp, struct rte error = (rt0->rt_flags & RTF_GATEWAY) ? EHOSTDOWN : EHOSTUNREACH; - if (la->la_asked == 0 || la->la_expire != time_uptime) { + if (renew) { log(LOG_DEBUG, "arpresolve: kicking off new resolve expire=%ld\n", la->la_expire); @@ -364,7 +374,10 @@ arpresolve(struct ifnet *ifp, struct rte } done: - LLE_RUNLOCK(la); + if (flags & LLE_EXCLUSIVE) + LLE_WUNLOCK(la); + else + LLE_RUNLOCK(la); return (error); } Modified: user/kmacy/head_arpv2/sys/netinet/in.c ============================================================================== --- user/kmacy/head_arpv2/sys/netinet/in.c Wed Dec 10 00:08:25 2008 (r185814) +++ user/kmacy/head_arpv2/sys/netinet/in.c Wed Dec 10 00:54:21 2008 (r185815) @@ -1109,16 +1109,7 @@ in_lltable_lookup(struct lltable *llt, u if (bcmp(L3_ADDR(lle), l3addr, sizeof(struct sockaddr_in)) == 0) break; } - - if ((lle != NULL) && (flags & LLE_DELETE)) { - LLE_WLOCK(lle); - lle->la_flags = LLE_DELETED; - LLE_WUNLOCK(lle); -#ifdef INVARIANTS - log(LOG_INFO, "ifaddr cache = %p is deleted\n", lle); -#endif - lle = NULL; - } else { + if (lle == NULL) { #ifdef INVARIANTS if (flags & LLE_DELETE) log(LOG_INFO, "interface address is missing from cache = %p in delete\n", lle); @@ -1148,7 +1139,15 @@ in_lltable_lookup(struct lltable *llt, u lle->lle_tbl = llt; lle->lle_head = lleh; LIST_INSERT_HEAD(lleh, lle, lle_next); - } + } else if (flags & LLE_DELETE) { + LLE_WLOCK(lle); + lle->la_flags = LLE_DELETED; + LLE_WUNLOCK(lle); +#ifdef INVARIANTS + log(LOG_INFO, "ifaddr cache = %p is deleted\n", lle); +#endif + lle = NULL; + } if (lle) { if (flags & LLE_EXCLUSIVE) LLE_WLOCK(lle); Modified: user/kmacy/head_arpv2/sys/netinet6/nd6_rtr.c ============================================================================== --- user/kmacy/head_arpv2/sys/netinet6/nd6_rtr.c Wed Dec 10 00:08:25 2008 (r185814) +++ user/kmacy/head_arpv2/sys/netinet6/nd6_rtr.c Wed Dec 10 00:54:21 2008 (r185815) @@ -476,10 +476,8 @@ defrouter_addreq(struct nd_defrouter *ne (struct sockaddr *)&gate, (struct sockaddr *)&mask, RTF_GATEWAY, &newrt); if (newrt) { - RT_LOCK(newrt); nd6_rtmsg(RTM_ADD, newrt); /* tell user process */ - RT_REMREF(newrt); - RT_UNLOCK(newrt); + RTFREE(newrt); } if (error == 0) new->installed = 1; @@ -1549,6 +1547,7 @@ nd6_prefix_onlink(struct nd_prefix *pr) struct nd_prefix *opr; u_long rtflags; int error = 0; + struct radix_node_head *rnh; struct rtentry *rt = NULL; char ip6buf[INET6_ADDRSTRLEN]; struct sockaddr_dl null_sdl = {sizeof(null_sdl), AF_LINK}; @@ -1632,6 +1631,8 @@ nd6_prefix_onlink(struct nd_prefix *pr) ifa->ifa_addr, (struct sockaddr *)&mask6, rtflags, &rt); if (error == 0) { if (rt != NULL) /* this should be non NULL, though */ { + rnh = V_rt_tables[rt->rt_fibnum][AF_INET6]; + RADIX_NODE_HEAD_LOCK(rnh); RT_LOCK(rt); if (!rt_setgate(rt, rt_key(rt), (struct sockaddr *)&null_sdl)) { ((struct sockaddr_dl *)rt->rt_gateway)->sdl_type = @@ -1639,6 +1640,7 @@ nd6_prefix_onlink(struct nd_prefix *pr) ((struct sockaddr_dl *)rt->rt_gateway)->sdl_index = rt->rt_ifp->if_index; } + RADIX_NODE_HEAD_UNLOCK(rnh); nd6_rtmsg(RTM_ADD, rt); RT_UNLOCK(rt); } From owner-svn-src-user@FreeBSD.ORG Wed Dec 10 01:20:58 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48AF21065675; Wed, 10 Dec 2008 01:20:58 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 311EC8FC1B; Wed, 10 Dec 2008 01:20:58 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBA1KwbX007920; Wed, 10 Dec 2008 01:20:58 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBA1KvUH007906; Wed, 10 Dec 2008 01:20:57 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812100120.mBA1KvUH007906@svn.freebsd.org> From: Kip Macy Date: Wed, 10 Dec 2008 01:20:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185817 - in user/kmacy/head_arpv2: . gnu/usr.bin/cc/libiberty gnu/usr.bin/sort include kerberos5/include lib/bind/bind lib/libarchive lib/libarchive/test lib/libc/string lib/libmagic l... X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2008 01:20:58 -0000 Author: kmacy Date: Wed Dec 10 01:20:57 2008 New Revision: 185817 URL: http://svn.freebsd.org/changeset/base/185817 Log: IFC 185786:185816 Added: user/kmacy/head_arpv2/lib/libarchive/test/test_compat_bzip2.c user/kmacy/head_arpv2/lib/libarchive/test/test_compat_bzip2_1.tbz.uu user/kmacy/head_arpv2/lib/libarchive/test/test_compat_bzip2_2.tbz.uu user/kmacy/head_arpv2/lib/libarchive/test/test_compat_gzip.c user/kmacy/head_arpv2/lib/libarchive/test/test_compat_gzip_1.tgz.uu user/kmacy/head_arpv2/lib/libarchive/test/test_compat_gzip_2.tgz.uu user/kmacy/head_arpv2/lib/libarchive/test/test_fuzz.c user/kmacy/head_arpv2/lib/libarchive/test/test_fuzz_1.iso.uu user/kmacy/head_arpv2/lib/libc/string/strndup.c user/kmacy/head_arpv2/lib/libutil/kinfo_getfile.3 user/kmacy/head_arpv2/lib/libutil/kinfo_getvmmap.3 user/kmacy/head_arpv2/share/man/man4/man4.powerpc/pmu.4 user/kmacy/head_arpv2/tools/test/pthread_vfork/ user/kmacy/head_arpv2/tools/test/pthread_vfork/pthread_vfork_test.c user/kmacy/head_arpv2/tools/tools/ath/Makefile.inc user/kmacy/head_arpv2/tools/tools/ath/athkey/ user/kmacy/head_arpv2/tools/tools/ath/athkey/Makefile user/kmacy/head_arpv2/tools/tools/ath/athkey/athkey.c user/kmacy/head_arpv2/tools/tools/ath/athpow/ user/kmacy/head_arpv2/tools/tools/ath/athpow/Makefile user/kmacy/head_arpv2/tools/tools/ath/athpow/athpow.c user/kmacy/head_arpv2/tools/tools/ath/athprom/ user/kmacy/head_arpv2/tools/tools/ath/athprom/Makefile user/kmacy/head_arpv2/tools/tools/ath/athprom/athprom.c user/kmacy/head_arpv2/tools/tools/ath/athprom/eeprom-14 user/kmacy/head_arpv2/tools/tools/ath/athprom/eeprom-3 user/kmacy/head_arpv2/tools/tools/ath/athprom/eeprom-4 user/kmacy/head_arpv2/tools/tools/ath/athprom/eeprom-5 user/kmacy/head_arpv2/tools/tools/ath/athregs/ user/kmacy/head_arpv2/tools/tools/ath/athregs/Makefile user/kmacy/head_arpv2/tools/tools/ath/athregs/dumpregs.c user/kmacy/head_arpv2/tools/tools/ath/athregs/dumpregs.h user/kmacy/head_arpv2/tools/tools/ath/athregs/dumpregs_5210.c user/kmacy/head_arpv2/tools/tools/ath/athregs/dumpregs_5211.c user/kmacy/head_arpv2/tools/tools/ath/athregs/dumpregs_5212.c user/kmacy/head_arpv2/tools/tools/ath/athregs/dumpregs_5416.c user/kmacy/head_arpv2/tools/tools/ath/common/ user/kmacy/head_arpv2/tools/tools/ath/common/ah_osdep.h user/kmacy/head_arpv2/tools/tools/ath/common/diag.h Modified: user/kmacy/head_arpv2/UPDATING user/kmacy/head_arpv2/gnu/usr.bin/cc/libiberty/config.h user/kmacy/head_arpv2/gnu/usr.bin/sort/config.h user/kmacy/head_arpv2/include/string.h user/kmacy/head_arpv2/kerberos5/include/config.h user/kmacy/head_arpv2/lib/bind/bind/port_after.h user/kmacy/head_arpv2/lib/libarchive/archive.h user/kmacy/head_arpv2/lib/libarchive/archive_check_magic.c user/kmacy/head_arpv2/lib/libarchive/archive_endian.h user/kmacy/head_arpv2/lib/libarchive/archive_entry.h user/kmacy/head_arpv2/lib/libarchive/archive_platform.h user/kmacy/head_arpv2/lib/libarchive/archive_private.h user/kmacy/head_arpv2/lib/libarchive/archive_read.c user/kmacy/head_arpv2/lib/libarchive/archive_read_private.h user/kmacy/head_arpv2/lib/libarchive/archive_read_support_compression_all.c user/kmacy/head_arpv2/lib/libarchive/archive_read_support_compression_bzip2.c user/kmacy/head_arpv2/lib/libarchive/archive_read_support_compression_compress.c user/kmacy/head_arpv2/lib/libarchive/archive_read_support_compression_gzip.c user/kmacy/head_arpv2/lib/libarchive/archive_read_support_compression_none.c user/kmacy/head_arpv2/lib/libarchive/archive_read_support_compression_program.c user/kmacy/head_arpv2/lib/libarchive/archive_read_support_format_ar.c user/kmacy/head_arpv2/lib/libarchive/archive_read_support_format_cpio.c user/kmacy/head_arpv2/lib/libarchive/archive_read_support_format_empty.c user/kmacy/head_arpv2/lib/libarchive/archive_read_support_format_iso9660.c user/kmacy/head_arpv2/lib/libarchive/archive_read_support_format_mtree.c user/kmacy/head_arpv2/lib/libarchive/archive_read_support_format_tar.c user/kmacy/head_arpv2/lib/libarchive/archive_read_support_format_zip.c user/kmacy/head_arpv2/lib/libarchive/archive_string.c user/kmacy/head_arpv2/lib/libarchive/archive_string.h user/kmacy/head_arpv2/lib/libarchive/archive_write_disk.c user/kmacy/head_arpv2/lib/libarchive/test/Makefile user/kmacy/head_arpv2/lib/libarchive/test/main.c user/kmacy/head_arpv2/lib/libarchive/test/test_read_format_cpio_bin_bz2.c user/kmacy/head_arpv2/lib/libarchive/test/test_read_format_gtar_sparse.c user/kmacy/head_arpv2/lib/libarchive/test/test_read_pax_truncated.c user/kmacy/head_arpv2/lib/libarchive/test/test_write_disk_perms.c user/kmacy/head_arpv2/lib/libarchive/test/test_write_format_cpio.c user/kmacy/head_arpv2/lib/libc/string/Makefile.inc user/kmacy/head_arpv2/lib/libc/string/Symbol.map user/kmacy/head_arpv2/lib/libc/string/strdup.3 user/kmacy/head_arpv2/lib/libc/string/strsep.3 user/kmacy/head_arpv2/lib/libmagic/config.h user/kmacy/head_arpv2/lib/libpmc/pmc.core.3 user/kmacy/head_arpv2/lib/libstand/bootp.c user/kmacy/head_arpv2/lib/libthr/thread/thr_rtld.c user/kmacy/head_arpv2/lib/libutil/Makefile user/kmacy/head_arpv2/share/man/man4/man4.powerpc/Makefile user/kmacy/head_arpv2/share/man/man7/ports.7 user/kmacy/head_arpv2/sys/dev/bge/if_bge.c user/kmacy/head_arpv2/sys/net/if.c user/kmacy/head_arpv2/sys/net/route.c user/kmacy/head_arpv2/sys/netinet/in_pcb.h user/kmacy/head_arpv2/sys/netinet/tcp_input.c user/kmacy/head_arpv2/tools/tools/ath/Makefile user/kmacy/head_arpv2/tools/tools/ath/athdebug/Makefile user/kmacy/head_arpv2/tools/tools/ath/athstats/Makefile user/kmacy/head_arpv2/usr.bin/cpio/Makefile user/kmacy/head_arpv2/usr.bin/cpio/cmdline.c user/kmacy/head_arpv2/usr.bin/cpio/config_freebsd.h user/kmacy/head_arpv2/usr.bin/cpio/cpio.c user/kmacy/head_arpv2/usr.bin/cpio/cpio.h user/kmacy/head_arpv2/usr.bin/cpio/cpio_platform.h user/kmacy/head_arpv2/usr.bin/file/config.h user/kmacy/head_arpv2/usr.bin/tar/Makefile user/kmacy/head_arpv2/usr.bin/tar/bsdtar.1 user/kmacy/head_arpv2/usr.bin/tar/bsdtar.h user/kmacy/head_arpv2/usr.bin/tar/bsdtar_platform.h user/kmacy/head_arpv2/usr.bin/wc/wc.1 user/kmacy/head_arpv2/usr.bin/wc/wc.c user/kmacy/head_arpv2/usr.sbin/fifolog/lib/fifolog_int.c user/kmacy/head_arpv2/usr.sbin/fifolog/lib/fifolog_reader.c user/kmacy/head_arpv2/usr.sbin/syslogd/syslogd.8 Modified: user/kmacy/head_arpv2/UPDATING ============================================================================== --- user/kmacy/head_arpv2/UPDATING Wed Dec 10 01:16:41 2008 (r185816) +++ user/kmacy/head_arpv2/UPDATING Wed Dec 10 01:20:57 2008 (r185817) @@ -38,11 +38,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. and thereby the code size); consult ath_hal(4) for details. 20081121: - __FreeBSD_version 800054 adds memory barriers to - , new interfaces to ifnet to facilitate + __FreeBSD_version 800054 adds memory barriers to + , new interfaces to ifnet to facilitate multiple hardware transmit queues for cards that support them, and a lock-less ring-buffer implementation to - enable drivers to more efficiently manage queueing of + enable drivers to more efficiently manage queueing of packets. 20081117: @@ -287,11 +287,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. be recompiled; this includes the hal and xorg-server ports. 20070928: - The caching daemon (cached) was renamed to nscd. nscd.conf - configuration file should be used instead of cached.conf and - nscd_enable, nscd_pidfile and nscd_flags options should be used - instead of cached_enable, cached_pidfile and cached_flags in - rc.conf. + The caching daemon (cached) was renamed to nscd. nscd.conf + configuration file should be used instead of cached.conf and + nscd_enable, nscd_pidfile and nscd_flags options should be used + instead of cached_enable, cached_pidfile and cached_flags in + rc.conf. 20070921: The getfacl(1) utility now prints owning user and group name @@ -299,7 +299,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. This is the same behavior as getfacl(1) on Solaris and Linux. 20070704: - The new IPsec code is now compiled in using the IPSEC option. The + The new IPsec code is now compiled in using the IPSEC option. The IPSEC option now requires "device crypto" be defined in your kernel configuration. The FAST_IPSEC kernel option is now deprecated. @@ -602,10 +602,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. If you have such a file, you need old utility to decrypt it. 20060709: - The interface version of the i4b kernel part has changed. So - after updating the kernel sources and compiling a new kernel, - the i4b user space tools in "/usr/src/usr.sbin/i4b" must also - be rebuilt, and vice versa. + The interface version of the i4b kernel part has changed. So + after updating the kernel sources and compiling a new kernel, + the i4b user space tools in "/usr/src/usr.sbin/i4b" must also + be rebuilt, and vice versa. 20060627: The XBOX kernel now defaults to the nfe(4) driver instead of @@ -1071,7 +1071,7 @@ COMMON ITEMS: - + To upgrade in-place from 5.x-stable to current Modified: user/kmacy/head_arpv2/gnu/usr.bin/cc/libiberty/config.h ============================================================================== --- user/kmacy/head_arpv2/gnu/usr.bin/cc/libiberty/config.h Wed Dec 10 01:16:41 2008 (r185816) +++ user/kmacy/head_arpv2/gnu/usr.bin/cc/libiberty/config.h Wed Dec 10 01:20:57 2008 (r185817) @@ -235,7 +235,7 @@ #define HAVE_STRNCASECMP 1 /* Define to 1 if you have the `strndup' function. */ -/* #undef HAVE_STRNDUP */ +#define HAVE_STRNDUP 1 /* Define to 1 if you have the `strrchr' function. */ #define HAVE_STRRCHR 1 Modified: user/kmacy/head_arpv2/gnu/usr.bin/sort/config.h ============================================================================== --- user/kmacy/head_arpv2/gnu/usr.bin/sort/config.h Wed Dec 10 01:16:41 2008 (r185816) +++ user/kmacy/head_arpv2/gnu/usr.bin/sort/config.h Wed Dec 10 01:20:57 2008 (r185817) @@ -759,7 +759,7 @@ #define HAVE_STRNCASECMP 1 /* Define to 1 if you have the `strndup' function. */ -/* #undef HAVE_STRNDUP */ +#define HAVE_STRNDUP 1 /* Define to 1 if you have the `strpbrk' function. */ #define HAVE_STRPBRK 1 Modified: user/kmacy/head_arpv2/include/string.h ============================================================================== --- user/kmacy/head_arpv2/include/string.h Wed Dec 10 01:16:41 2008 (r185816) +++ user/kmacy/head_arpv2/include/string.h Wed Dec 10 01:20:57 2008 (r185817) @@ -96,6 +96,7 @@ char *strncat(char * __restrict, const c int strncmp(const char *, const char *, size_t) __pure; char *strncpy(char * __restrict, const char * __restrict, size_t); #if __BSD_VISIBLE +char *strndup(const char *, size_t); char *strnstr(const char *, const char *, size_t) __pure; #endif char *strpbrk(const char *, const char *) __pure; Modified: user/kmacy/head_arpv2/kerberos5/include/config.h ============================================================================== --- user/kmacy/head_arpv2/kerberos5/include/config.h Wed Dec 10 01:16:41 2008 (r185816) +++ user/kmacy/head_arpv2/kerberos5/include/config.h Wed Dec 10 01:20:57 2008 (r185817) @@ -785,7 +785,7 @@ static /**/const char *const rcsid[] = { #define HAVE_STRNCASECMP 1 /* Define if you have the function `strndup'. */ -/* #undef HAVE_STRNDUP */ +#define HAVE_STRNDUP 1 /* Define if you have the function `strnlen'. */ /* #undef HAVE_STRNLEN */ Modified: user/kmacy/head_arpv2/lib/bind/bind/port_after.h ============================================================================== --- user/kmacy/head_arpv2/lib/bind/bind/port_after.h Wed Dec 10 01:16:41 2008 (r185816) +++ user/kmacy/head_arpv2/lib/bind/bind/port_after.h Wed Dec 10 01:20:57 2008 (r185817) @@ -30,7 +30,7 @@ #undef HAS_IN_ADDR6 #define HAVE_SOCKADDR_STORAGE 1 #undef NEED_GETTIMEOFDAY -#undef HAVE_STRNDUP +#define HAVE_STRNDUP 1 #undef USE_FIONBIO_IOCTL #undef USE_SYSERROR_LIST #undef INNETGR_ARGS Modified: user/kmacy/head_arpv2/lib/libarchive/archive.h ============================================================================== --- user/kmacy/head_arpv2/lib/libarchive/archive.h Wed Dec 10 01:16:41 2008 (r185816) +++ user/kmacy/head_arpv2/lib/libarchive/archive.h Wed Dec 10 01:20:57 2008 (r185817) @@ -82,7 +82,6 @@ # define __LA_DECL #endif - #ifdef __cplusplus extern "C" { #endif @@ -114,13 +113,13 @@ extern "C" { * (ARCHIVE_API_VERSION * 1000000 + ARCHIVE_API_FEATURE * 1000) * #endif */ -#define ARCHIVE_VERSION_NUMBER 2005005 +#define ARCHIVE_VERSION_NUMBER 2005903 __LA_DECL int archive_version_number(void); /* * Textual name/version of the library, useful for version displays. */ -#define ARCHIVE_VERSION_STRING "libarchive 2.5.5" +#define ARCHIVE_VERSION_STRING "libarchive 2.5.903a" __LA_DECL const char * archive_version_string(void); #if ARCHIVE_VERSION_NUMBER < 3000000 @@ -185,20 +184,37 @@ struct archive_entry; */ /* Returns pointer and size of next block of data from archive. */ -typedef __LA_SSIZE_T archive_read_callback(struct archive *, void *_client_data, - const void **_buffer); +typedef __LA_SSIZE_T archive_read_callback(struct archive *, + void *_client_data, const void **_buffer); + /* Skips at most request bytes from archive and returns the skipped amount */ #if ARCHIVE_VERSION_NUMBER < 2000000 -typedef __LA_SSIZE_T archive_skip_callback(struct archive *, void *_client_data, - size_t request); +/* Libarchive 1.0 used ssize_t for the return, which is only 32 bits + * on most 32-bit platforms; not large enough. */ +typedef __LA_SSIZE_T archive_skip_callback(struct archive *, + void *_client_data, size_t request); +#elif ARCHIVE_VERSION_NUMBER < 3000000 +/* Libarchive 2.0 used off_t here, but that is a bad idea on Linux and a + * few other platforms where off_t varies with build settings. */ +typedef off_t archive_skip_callback(struct archive *, + void *_client_data, off_t request); #else -typedef off_t archive_skip_callback(struct archive *, void *_client_data, - off_t request); +/* Libarchive 3.0 uses int64_t here, which is actually guaranteed to be + * 64 bits on every platform. */ +typedef __LA_INT64_T archive_skip_callback(struct archive *, + void *_client_data, __LA_INT64_T request); #endif + /* Returns size actually written, zero on EOF, -1 on error. */ -typedef __LA_SSIZE_T archive_write_callback(struct archive *, void *_client_data, - const void *_buffer, size_t _length); +typedef __LA_SSIZE_T archive_write_callback(struct archive *, + void *_client_data, + const void *_buffer, size_t _length); + +#if ARCHIVE_VERSION_NUMBER < 3000000 +/* Open callback is actually never needed; remove it in libarchive 3.0. */ typedef int archive_open_callback(struct archive *, void *_client_data); +#endif + typedef int archive_close_callback(struct archive *, void *_client_data); /* @@ -209,6 +225,7 @@ typedef int archive_close_callback(struc #define ARCHIVE_COMPRESSION_BZIP2 2 #define ARCHIVE_COMPRESSION_COMPRESS 3 #define ARCHIVE_COMPRESSION_PROGRAM 4 +#define ARCHIVE_COMPRESSION_LZMA 5 /* * Codes returned by archive_format. @@ -333,15 +350,23 @@ __LA_DECL int archive_read_next_header __LA_DECL __LA_INT64_T archive_read_header_position(struct archive *); /* Read data from the body of an entry. Similar to read(2). */ -__LA_DECL __LA_SSIZE_T archive_read_data(struct archive *, void *, size_t); +__LA_DECL __LA_SSIZE_T archive_read_data(struct archive *, + void *, size_t); + /* * A zero-copy version of archive_read_data that also exposes the file offset * of each returned block. Note that the client has no way to specify * the desired size of the block. The API does guarantee that offsets will * be strictly increasing and that returned blocks will not overlap. */ +#if ARCHIVE_VERSION_NUMBER < 3000000 +__LA_DECL int archive_read_data_block(struct archive *a, + const void **buff, size_t *size, off_t *offset); +#else __LA_DECL int archive_read_data_block(struct archive *a, - const void **buff, size_t *size, off_t *offset); + const void **buff, size_t *size, + __LA_INT64_T *offset); +#endif /*- * Some convenience functions that are built on archive_read_data: @@ -350,8 +375,8 @@ __LA_DECL int archive_read_data_block( * 'into_fd': writes data to specified filedes */ __LA_DECL int archive_read_data_skip(struct archive *); -__LA_DECL int archive_read_data_into_buffer(struct archive *, void *buffer, - __LA_SSIZE_T len); +__LA_DECL int archive_read_data_into_buffer(struct archive *, + void *buffer, __LA_SSIZE_T len); __LA_DECL int archive_read_data_into_fd(struct archive *, int fd); /*- @@ -414,12 +439,11 @@ __LA_DECL void archive_read_extract_set __LA_DECL int archive_read_close(struct archive *); /* Release all resources and destroy the object. */ /* Note that archive_read_finish will call archive_read_close for you. */ -#if ARCHIVE_VERSION_NUMBER >= 2000000 -__LA_DECL int archive_read_finish(struct archive *); -#else -/* Temporarily allow library to compile with either 1.x or 2.0 API. */ +#if ARCHIVE_VERSION_NUMBER < 2000000 /* Erroneously declared to return void in libarchive 1.x */ __LA_DECL void archive_read_finish(struct archive *); +#else +__LA_DECL int archive_read_finish(struct archive *); #endif /*- @@ -491,22 +515,36 @@ __LA_DECL int archive_write_open_memor */ __LA_DECL int archive_write_header(struct archive *, struct archive_entry *); -#if ARCHIVE_VERSION_NUMBER >= 2000000 -__LA_DECL __LA_SSIZE_T archive_write_data(struct archive *, const void *, size_t); -#else -/* Temporarily allow library to compile with either 1.x or 2.0 API. */ +#if ARCHIVE_VERSION_NUMBER < 2000000 /* This was erroneously declared to return "int" in libarchive 1.x. */ -__LA_DECL int archive_write_data(struct archive *, const void *, size_t); +__LA_DECL int archive_write_data(struct archive *, + const void *, size_t); +#else +/* Libarchive 2.0 and later return ssize_t here. */ +__LA_DECL __LA_SSIZE_T archive_write_data(struct archive *, + const void *, size_t); +#endif + +#if ARCHIVE_VERSION_NUMBER < 3000000 +/* Libarchive 1.x and 2.x use off_t for the argument, but that's not + * stable on Linux. */ +__LA_DECL __LA_SSIZE_T archive_write_data_block(struct archive *, + const void *, size_t, off_t); +#else +/* Libarchive 3.0 uses explicit int64_t to ensure consistent 64-bit support. */ +__LA_DECL __LA_SSIZE_T archive_write_data_block(struct archive *, + const void *, size_t, __LA_INT64_T); #endif -__LA_DECL __LA_SSIZE_T archive_write_data_block(struct archive *, const void *, size_t, off_t); __LA_DECL int archive_write_finish_entry(struct archive *); __LA_DECL int archive_write_close(struct archive *); -#if ARCHIVE_VERSION_NUMBER >= 2000000 -__LA_DECL int archive_write_finish(struct archive *); -#else -/* Temporarily allow library to compile with either 1.x or 2.0 API. */ +#if ARCHIVE_VERSION_NUMBER < 2000000 /* Return value was incorrect in libarchive 1.x. */ __LA_DECL void archive_write_finish(struct archive *); +#else +/* Libarchive 2.x and later returns an error if this fails. */ +/* It can fail if the archive wasn't already closed, in which case + * archive_write_finish() will implicitly call archive_write_close(). */ +__LA_DECL int archive_write_finish(struct archive *); #endif /*- @@ -589,5 +627,9 @@ __LA_DECL void archive_copy_error(stru /* This is meaningless outside of this header. */ #undef __LA_DECL +#undef __LA_GID_T +#undef __LA_INT64_T +#undef __LA_SSIZE_T +#undef __LA_UID_T #endif /* !ARCHIVE_H_INCLUDED */ Modified: user/kmacy/head_arpv2/lib/libarchive/archive_check_magic.c ============================================================================== --- user/kmacy/head_arpv2/lib/libarchive/archive_check_magic.c Wed Dec 10 01:16:41 2008 (r185816) +++ user/kmacy/head_arpv2/lib/libarchive/archive_check_magic.c Wed Dec 10 01:20:57 2008 (r185817) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); static void errmsg(const char *m) { - write(STDERR_FILENO, m, strlen(m)); + write(2, m, strlen(m)); } static void Modified: user/kmacy/head_arpv2/lib/libarchive/archive_endian.h ============================================================================== --- user/kmacy/head_arpv2/lib/libarchive/archive_endian.h Wed Dec 10 01:16:41 2008 (r185816) +++ user/kmacy/head_arpv2/lib/libarchive/archive_endian.h Wed Dec 10 01:20:57 2008 (r185817) @@ -35,14 +35,14 @@ #define ARCHIVE_ENDIAN_H_INCLUDED -/* Watcom C++ doesn't support 'inline' in C code. (For any version?) */ -#if defined( __WATCOMC__ ) - #define inline -#endif - -/* Visual C++ 6.0 doesn't support 'inline' in C code. (Does VC7? VC8?) */ -#if defined(_MSC_VER) - #define inline +/* + * Disabling inline keyword for compilers known to choke on it: + * - Watcom C++ in C code. (For any version?) + * - SGI MIPSpro + * - Microsoft Visual C++ 6.0 (supposedly newer versions too) + */ +#if defined(__WATCOMC__) || defined(__sgi) || defined(_MSC_VER) +#define inline #endif /* Alignment-agnostic encode/decode bytestream to/from little/big endian. */ Modified: user/kmacy/head_arpv2/lib/libarchive/archive_entry.h ============================================================================== --- user/kmacy/head_arpv2/lib/libarchive/archive_entry.h Wed Dec 10 01:16:41 2008 (r185816) +++ user/kmacy/head_arpv2/lib/libarchive/archive_entry.h Wed Dec 10 01:20:57 2008 (r185817) @@ -441,7 +441,7 @@ __LA_DECL int archive_entry_xattr_next(s * Note that archive_entry_size() is reset to zero if the file * body should not be written to the archive. Pay attention! */ -__LA_DECL struct archive_entry_linkresolver; +struct archive_entry_linkresolver; /* * There are three different strategies for marking hardlinks. Modified: user/kmacy/head_arpv2/lib/libarchive/archive_platform.h ============================================================================== --- user/kmacy/head_arpv2/lib/libarchive/archive_platform.h Wed Dec 10 01:16:41 2008 (r185816) +++ user/kmacy/head_arpv2/lib/libarchive/archive_platform.h Wed Dec 10 01:20:57 2008 (r185817) @@ -39,10 +39,7 @@ /* archive.h and archive_entry.h require this. */ #define __LIBARCHIVE_BUILD 1 -#ifdef _WIN32 -#include "config_windows.h" -#include "archive_windows.h" -#elif defined(PLATFORM_CONFIG_H) +#if defined(PLATFORM_CONFIG_H) /* Use hand-built config.h in environments that need it. */ #include PLATFORM_CONFIG_H #elif defined(HAVE_CONFIG_H) Modified: user/kmacy/head_arpv2/lib/libarchive/archive_private.h ============================================================================== --- user/kmacy/head_arpv2/lib/libarchive/archive_private.h Wed Dec 10 01:16:41 2008 (r185816) +++ user/kmacy/head_arpv2/lib/libarchive/archive_private.h Wed Dec 10 01:20:57 2008 (r185817) @@ -31,15 +31,22 @@ #include "archive.h" #include "archive_string.h" +#if defined(__GNUC__) && (__GNUC__ > 2 || \ + (__GNUC__ == 2 && __GNUC_MINOR__ >= 5)) +#define __LA_DEAD __attribute__((__noreturn__)) +#else +#define __LA_DEAD +#endif + #define ARCHIVE_WRITE_MAGIC (0xb0c5c0deU) #define ARCHIVE_READ_MAGIC (0xdeb0c5U) -#define ARCHIVE_WRITE_DISK_MAGIC (0xc001b0c5U) +#define ARCHIVE_WRITE_DISK_MAGIC (0xc001b0c5U) #define ARCHIVE_STATE_ANY 0xFFFFU #define ARCHIVE_STATE_NEW 1U #define ARCHIVE_STATE_HEADER 2U #define ARCHIVE_STATE_DATA 4U -#define ARCHIVE_STATE_DATA_END 8U +#define ARCHIVE_STATE_DATA_END 8U #define ARCHIVE_STATE_EOF 0x10U #define ARCHIVE_STATE_CLOSED 0x20U #define ARCHIVE_STATE_FATAL 0x8000U @@ -92,7 +99,7 @@ struct archive { void __archive_check_magic(struct archive *, unsigned int magic, unsigned int state, const char *func); -void __archive_errx(int retvalue, const char *msg) __dead2; +void __archive_errx(int retvalue, const char *msg) __LA_DEAD; #define err_combine(a,b) ((a) < (b) ? (a) : (b)) Modified: user/kmacy/head_arpv2/lib/libarchive/archive_read.c ============================================================================== --- user/kmacy/head_arpv2/lib/libarchive/archive_read.c Wed Dec 10 01:16:41 2008 (r185816) +++ user/kmacy/head_arpv2/lib/libarchive/archive_read.c Wed Dec 10 01:20:57 2008 (r185817) @@ -53,9 +53,10 @@ __FBSDID("$FreeBSD$"); #include "archive_private.h" #include "archive_read_private.h" -static void choose_decompressor(struct archive_read *, const void*, size_t); +#define minimum(a, b) (a < b ? a : b) + +static int build_stream(struct archive_read *); static int choose_format(struct archive_read *); -static off_t dummy_skip(struct archive_read *, off_t); /* * Allocate, initialize and return a struct archive object. @@ -74,8 +75,15 @@ archive_read_new(void) a->archive.state = ARCHIVE_STATE_NEW; a->entry = archive_entry_new(); - /* We always support uncompressed archives. */ - archive_read_support_compression_none(&a->archive); + /* Initialize reblocking logic. */ + a->buffer_size = 64 * 1024; /* 64k */ + a->buffer = (char *)malloc(a->buffer_size); + a->next = a->buffer; + if (a->buffer == NULL) { + archive_entry_free(a->entry); + free(a); + return (NULL); + } return (&a->archive); } @@ -108,6 +116,33 @@ archive_read_open(struct archive *a, voi client_reader, NULL, client_closer); } +static ssize_t +client_read_proxy(struct archive_read_source *self, const void **buff) +{ + return (self->archive->client.reader)((struct archive *)self->archive, + self->data, buff); +} + +static int64_t +client_skip_proxy(struct archive_read_source *self, int64_t request) +{ + return (self->archive->client.skipper)((struct archive *)self->archive, + self->data, request); +} + +static int +client_close_proxy(struct archive_read_source *self) +{ + int r = ARCHIVE_OK; + + if (self->archive->client.closer != NULL) + r = (self->archive->client.closer)((struct archive *)self->archive, + self->data); + free(self); + return (r); +} + + int archive_read_open2(struct archive *_a, void *client_data, archive_open_callback *client_opener, @@ -116,28 +151,15 @@ archive_read_open2(struct archive *_a, v archive_close_callback *client_closer) { struct archive_read *a = (struct archive_read *)_a; - const void *buffer; - ssize_t bytes_read; int e; - __archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW, "archive_read_open"); + __archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW, + "archive_read_open"); if (client_reader == NULL) __archive_errx(1, "No reader function provided to archive_read_open"); - /* - * Set these NULL initially. If the open or initial read fails, - * we'll leave them NULL to indicate that the file is invalid. - * (In particular, this helps ensure that the closer doesn't - * get called more than once.) - */ - a->client_opener = NULL; - a->client_reader = NULL; - a->client_skipper = NULL; - a->client_closer = NULL; - a->client_data = NULL; - /* Open data source. */ if (client_opener != NULL) { e =(client_opener)(&a->archive, client_data); @@ -149,129 +171,103 @@ archive_read_open2(struct archive *_a, v } } - /* Read first block now for compress format detection. */ - bytes_read = (client_reader)(&a->archive, client_data, &buffer); - - if (bytes_read < 0) { - /* If the first read fails, close before returning error. */ - if (client_closer) - (client_closer)(&a->archive, client_data); - /* client_reader should have already set error information. */ - return (ARCHIVE_FATAL); - } + /* Save the client functions and mock up the initial source. */ + a->client.opener = client_opener; /* Do we need to remember this? */ + a->client.reader = client_reader; + a->client.skipper = client_skipper; + a->client.closer = client_closer; + a->client.data = client_data; - /* Now that the client callbacks have worked, remember them. */ - a->client_opener = client_opener; /* Do we need to remember this? */ - a->client_reader = client_reader; - a->client_skipper = client_skipper; - a->client_closer = client_closer; - a->client_data = client_data; - - /* Select a decompression routine. */ - choose_decompressor(a, buffer, (size_t)bytes_read); - if (a->decompressor == NULL) - return (ARCHIVE_FATAL); + { + struct archive_read_source *source; - /* Initialize decompression routine with the first block of data. */ - e = (a->decompressor->init)(a, buffer, (size_t)bytes_read); + source = calloc(1, sizeof(*source)); + if (source == NULL) + return (ARCHIVE_FATAL); + source->reader = NULL; + source->upstream = NULL; + source->archive = a; + source->data = client_data; + source->read = client_read_proxy; + source->skip = client_skip_proxy; + source->close = client_close_proxy; + a->source = source; + } + + /* In case there's no filter. */ + a->archive.compression_code = ARCHIVE_COMPRESSION_NONE; + a->archive.compression_name = "none"; + /* Build out the input pipeline. */ + e = build_stream(a); if (e == ARCHIVE_OK) a->archive.state = ARCHIVE_STATE_HEADER; - /* - * If the decompressor didn't register a skip function, provide a - * dummy compression-layer skip function. - */ - if (a->decompressor->skip == NULL) - a->decompressor->skip = dummy_skip; - return (e); } /* - * Allow each registered decompression routine to bid on whether it - * wants to handle this stream. Return index of winning bidder. + * Allow each registered stream transform to bid on whether + * it wants to handle this stream. Repeat until we've finished + * building the pipeline. */ -static void -choose_decompressor(struct archive_read *a, - const void *buffer, size_t bytes_read) +static int +build_stream(struct archive_read *a) { - int decompression_slots, i, bid, best_bid; - struct decompressor_t *decompressor, *best_decompressor; + int number_readers, i, bid, best_bid; + struct archive_reader *reader, *best_reader; + struct archive_read_source *source; + const void *block; + ssize_t bytes_read; - decompression_slots = sizeof(a->decompressors) / - sizeof(a->decompressors[0]); + /* Read first block now for compress format detection. */ + bytes_read = (a->source->read)(a->source, &block); + if (bytes_read < 0) { + /* If the first read fails, close before returning error. */ + if (a->source->close != NULL) { + (a->source->close)(a->source); + a->source = NULL; + } + /* source->read should have already set error information. */ + return (ARCHIVE_FATAL); + } + + number_readers = sizeof(a->readers) / sizeof(a->readers[0]); best_bid = 0; - a->decompressor = NULL; - best_decompressor = NULL; + best_reader = NULL; - decompressor = a->decompressors; - for (i = 0; i < decompression_slots; i++) { - if (decompressor->bid) { - bid = (decompressor->bid)(buffer, bytes_read); - if (bid > best_bid || best_decompressor == NULL) { + reader = a->readers; + for (i = 0, reader = a->readers; i < number_readers; i++, reader++) { + if (reader->bid != NULL) { + bid = (reader->bid)(reader, block, bytes_read); + if (bid > best_bid) { best_bid = bid; - best_decompressor = decompressor; + best_reader = reader; } } - decompressor ++; } /* - * There were no bidders; this is a serious programmer error - * and demands a quick and definitive abort. - */ - if (best_decompressor == NULL) - __archive_errx(1, "No decompressors were registered; you " - "must call at least one " - "archive_read_support_compression_XXX function in order " - "to successfully read an archive."); - - /* - * There were bidders, but no non-zero bids; this means we can't - * support this stream. + * If we have a winner, it becomes the next stage in the pipeline. */ - if (best_bid < 1) { - archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, - "Unrecognized archive format"); - return; - } - - /* Record the best decompressor for this stream. */ - a->decompressor = best_decompressor; -} - -/* - * Dummy skip function, for use if the compression layer doesn't provide - * one: This code just reads data and discards it. - */ -static off_t -dummy_skip(struct archive_read * a, off_t request) -{ - const void * dummy_buffer; - ssize_t bytes_read; - off_t bytes_skipped; - - for (bytes_skipped = 0; request > 0;) { - bytes_read = (a->decompressor->read_ahead)(a, &dummy_buffer, 1); - if (bytes_read < 0) - return (bytes_read); - if (bytes_read == 0) { - /* Premature EOF. */ - archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, - "Truncated input file (need to skip %jd bytes)", - (intmax_t)request); + if (best_reader != NULL) { + source = (best_reader->init)(a, best_reader, a->source, + block, bytes_read); + if (source == NULL) return (ARCHIVE_FATAL); - } - if (bytes_read > request) - bytes_read = (ssize_t)request; - (a->decompressor->consume)(a, (size_t)bytes_read); - request -= bytes_read; - bytes_skipped += bytes_read; + /* Record the best decompressor for this stream. */ + a->source = source; + /* Recurse to get next pipeline stage. */ + return (build_stream(a)); } - return (bytes_skipped); + /* Save first block of data. */ + a->client_buff = block; + a->client_total = bytes_read; + a->client_next = a->client_buff; + a->client_avail = a->client_total; + return (ARCHIVE_OK); } /* @@ -598,23 +594,24 @@ archive_read_close(struct archive *_a) /* TODO: Clean up the formatters. */ - /* Clean up the decompressors. */ - n = sizeof(a->decompressors)/sizeof(a->decompressors[0]); + /* Clean up the stream pipeline. */ + if (a->source != NULL) { + r1 = (a->source->close)(a->source); + if (r1 < r) + r = r1; + a->source = NULL; + } + + /* Release the reader objects. */ + n = sizeof(a->readers)/sizeof(a->readers[0]); for (i = 0; i < n; i++) { - if (a->decompressors[i].finish != NULL) { - r1 = (a->decompressors[i].finish)(a); + if (a->readers[i].free != NULL) { + r1 = (a->readers[i].free)(&a->readers[i]); if (r1 < r) r = r1; } } - /* Close the client stream. */ - if (a->client_closer != NULL) { - r1 = ((a->client_closer)(&a->archive, a->client_data)); - if (r1 < r) - r = r1; - } - return (r); } @@ -651,6 +648,7 @@ archive_read_finish(struct archive *_a) if (a->entry) archive_entry_free(a->entry); a->archive.magic = 0; + free(a->buffer); free(a); #if ARCHIVE_API_VERSION > 1 return (r); @@ -700,40 +698,350 @@ __archive_read_register_format(struct ar * Used internally by decompression routines to register their bid and * initialization functions. */ -struct decompressor_t * -__archive_read_register_compression(struct archive_read *a, - int (*bid)(const void *, size_t), - int (*init)(struct archive_read *, const void *, size_t)) +struct archive_reader * +__archive_read_get_reader(struct archive_read *a) { int i, number_slots; __archive_check_magic(&a->archive, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW, - "__archive_read_register_compression"); + "__archive_read_get_reader"); - number_slots = sizeof(a->decompressors) / sizeof(a->decompressors[0]); + number_slots = sizeof(a->readers) / sizeof(a->readers[0]); for (i = 0; i < number_slots; i++) { - if (a->decompressors[i].bid == bid) - return (a->decompressors + i); - if (a->decompressors[i].bid == NULL) { - a->decompressors[i].bid = bid; - a->decompressors[i].init = init; - return (a->decompressors + i); - } + if (a->readers[i].bid == NULL) + return (a->readers + i); } __archive_errx(1, "Not enough slots for compression registration"); return (NULL); /* Never actually executed. */ } -/* used internally to simplify read-ahead */ +/* + * The next three functions comprise the peek/consume internal I/O + * system used by archive format readers. This system allows fairly + * flexible read-ahead and allows the I/O code to operate in a + * zero-copy manner most of the time. + * + * In the ideal case, block providers give the I/O code blocks of data + * and __archive_read_ahead() just returns pointers directly into + * those blocks. Then __archive_read_consume() just bumps those + * pointers. Only if your request would span blocks does the I/O + * layer use a copy buffer to provide you with a contiguous block of + * data. The __archive_read_skip() is an optimization; it scans ahead + * very quickly (it usually translates into a seek() operation if + * you're reading uncompressed disk files). + * + * A couple of useful idioms: + * * "I just want some data." Ask for 1 byte and pay attention to + * the "number of bytes available" from __archive_read_ahead(). + * You can consume more than you asked for; you just can't consume + * more than is available right now. If you consume everything that's + * immediately available, the next read_ahead() call will pull + * the next block. + * * "I want to output a large block of data." As above, ask for 1 byte, + * emit all that's available (up to whatever limit you have), then + * repeat until you're done. + * * "I want to peek ahead by a large amount." Ask for 4k or so, then + * double and repeat until you get an error or have enough. Note + * that the I/O layer will likely end up expanding its copy buffer + * to fit your request, so use this technique cautiously. This + * technique is used, for example, by some of the format tasting + * code that has uncertain look-ahead needs. + * + * TODO: Someday, provide a more generic __archive_read_seek() for + * those cases where it's useful. This is tricky because there are lots + * of cases where seek() is not available (reading gzip data from a + * network socket, for instance), so there needs to be a good way to + * communicate whether seek() is available and users of that interface + * need to use non-seeking strategies whenever seek() is not available. + */ + +/* + * Looks ahead in the input stream: + * * If 'avail' pointer is provided, that returns number of bytes available + * in the current buffer, which may be much larger than requested. + * * If end-of-file, *avail gets set to zero. + * * If error, *avail gets error code. + * * If request can be met, returns pointer to data, returns NULL + * if request is not met. + * + * Note: If you just want "some data", ask for 1 byte and pay attention + * to *avail, which will have the actual amount available. If you + * know exactly how many bytes you need, just ask for that and treat + * a NULL return as an error. + * + * Important: This does NOT move the file pointer. See + * __archive_read_consume() below. + */ + +/* + * This is tricky. We need to provide our clients with pointers to + * contiguous blocks of memory but we want to avoid copying whenever + * possible. + * + * Mostly, this code returns pointers directly into the block of data + * provided by the client_read routine. It can do this unless the + * request would split across blocks. In that case, we have to copy + * into an internal buffer to combine reads. + */ const void * -__archive_read_ahead(struct archive_read *a, size_t len) +__archive_read_ahead(struct archive_read *a, size_t min, ssize_t *avail) { - const void *h; + ssize_t bytes_read; + size_t tocopy; - if ((a->decompressor->read_ahead)(a, &h, len) < (ssize_t)len) + if (a->fatal) { + if (avail) + *avail = ARCHIVE_FATAL; return (NULL); - return (h); + } + + /* + * Keep pulling more data until we can satisfy the request. + */ + for (;;) { + + /* + * If we can satisfy from the copy buffer, we're done. + */ + if (a->avail >= min) { + if (avail != NULL) + *avail = a->avail; + return (a->next); + } + + /* + * We can satisfy directly from client buffer if everything + * currently in the copy buffer is still in the client buffer. + */ + if (a->client_total >= a->client_avail + a->avail + && a->client_avail + a->avail >= min) { + /* "Roll back" to client buffer. */ + a->client_avail += a->avail; + a->client_next -= a->avail; + /* Copy buffer is now empty. */ + a->avail = 0; + a->next = a->buffer; + /* Return data from client buffer. */ + if (avail != NULL) + *avail = a->client_avail; + return (a->client_next); + } + + /* Move data forward in copy buffer if necessary. */ + if (a->next > a->buffer && + a->next + min > a->buffer + a->buffer_size) { + if (a->avail > 0) + memmove(a->buffer, a->next, a->avail); + a->next = a->buffer; + } + + /* If we've used up the client data, get more. */ + if (a->client_avail <= 0) { + if (a->end_of_file) { + if (avail != NULL) + *avail = 0; + return (NULL); + } + bytes_read = (a->source->read)(a->source, + &a->client_buff); + if (bytes_read < 0) { /* Read error. */ + a->client_total = a->client_avail = 0; + a->client_next = a->client_buff = NULL; + a->fatal = 1; + if (avail != NULL) + *avail = ARCHIVE_FATAL; + return (NULL); + } + if (bytes_read == 0) { /* Premature end-of-file. */ + a->client_total = a->client_avail = 0; + a->client_next = a->client_buff = NULL; + a->end_of_file = 1; + /* Return whatever we do have. */ + if (avail != NULL) + *avail = a->avail; + return (NULL); + } + a->archive.raw_position += bytes_read; + a->client_total = bytes_read; + a->client_avail = a->client_total; + a->client_next = a->client_buff; + } + else + { + /* + * We can't satisfy the request from the copy + * buffer or the existing client data, so we + * need to copy more client data over to the + * copy buffer. + */ + + /* Ensure the buffer is big enough. */ + if (min > a->buffer_size) { + size_t s, t; + char *p; + + /* Double the buffer; watch for overflow. */ + s = t = a->buffer_size; + while (s < min) { + t *= 2; + if (t <= s) { /* Integer overflow! */ + archive_set_error(&a->archive, + ENOMEM, + "Unable to allocate copy buffer"); + a->fatal = 1; + if (avail != NULL) + *avail = ARCHIVE_FATAL; + return (NULL); + } + s = t; + } + /* Now s >= min, so allocate a new buffer. */ + p = (char *)malloc(s); + if (p == NULL) { + archive_set_error(&a->archive, ENOMEM, + "Unable to allocate copy buffer"); + a->fatal = 1; + if (avail != NULL) + *avail = ARCHIVE_FATAL; + return (NULL); + } + /* Move data into newly-enlarged buffer. */ + if (a->avail > 0) + memmove(p, a->next, a->avail); + free(a->buffer); + a->next = a->buffer = p; + a->buffer_size = s; + } + + /* We can add client data to copy buffer. */ + /* First estimate: copy to fill rest of buffer. */ + tocopy = (a->buffer + a->buffer_size) + - (a->next + a->avail); + /* Don't waste time buffering more than we need to. */ + if (tocopy + a->avail > min) + tocopy = min - a->avail; + /* Don't copy more than is available. */ + if (tocopy > a->client_avail) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Wed Dec 10 02:04:45 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B5F51065675; Wed, 10 Dec 2008 02:04:45 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F3B98FC08; Wed, 10 Dec 2008 02:04:45 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBA24j0g008810; Wed, 10 Dec 2008 02:04:45 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBA24j0u008809; Wed, 10 Dec 2008 02:04:45 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <200812100204.mBA24j0u008809@svn.freebsd.org> From: Qing Li Date: Wed, 10 Dec 2008 02:04:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185818 - user/qingli X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2008 02:04:45 -0000 Author: qingli Date: Wed Dec 10 02:04:45 2008 New Revision: 185818 URL: http://svn.freebsd.org/changeset/base/185818 Log: Creating a personal branch for various feature work. Added: user/qingli/ From owner-svn-src-user@FreeBSD.ORG Wed Dec 10 02:18:56 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 454E3106564A; Wed, 10 Dec 2008 02:18:56 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 212248FC13; Wed, 10 Dec 2008 02:18:56 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBA2IujC009172; Wed, 10 Dec 2008 02:18:56 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBA2ItWZ009169; Wed, 10 Dec 2008 02:18:55 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812100218.mBA2ItWZ009169@svn.freebsd.org> From: Kip Macy Date: Wed, 10 Dec 2008 02:18:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185821 - user/kmacy/head_arpv2/sys/dev/jme X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2008 02:18:56 -0000 Author: kmacy Date: Wed Dec 10 02:18:55 2008 New Revision: 185821 URL: http://svn.freebsd.org/changeset/base/185821 Log: revert to HEAD version Modified: user/kmacy/head_arpv2/sys/dev/jme/if_jme.c user/kmacy/head_arpv2/sys/dev/jme/if_jmereg.h user/kmacy/head_arpv2/sys/dev/jme/if_jmevar.h Modified: user/kmacy/head_arpv2/sys/dev/jme/if_jme.c ============================================================================== --- user/kmacy/head_arpv2/sys/dev/jme/if_jme.c Wed Dec 10 02:10:44 2008 (r185820) +++ user/kmacy/head_arpv2/sys/dev/jme/if_jme.c Wed Dec 10 02:18:55 2008 (r185821) @@ -150,6 +150,9 @@ static void jme_init_ssb(struct jme_soft static int jme_newbuf(struct jme_softc *, struct jme_rxdesc *); static void jme_set_vlan(struct jme_softc *); static void jme_set_filter(struct jme_softc *); +static void jme_stats_clear(struct jme_softc *); +static void jme_stats_save(struct jme_softc *); +static void jme_stats_update(struct jme_softc *); static int sysctl_int_range(SYSCTL_HANDLER_ARGS, int, int); static int sysctl_hw_jme_tx_coal_to(SYSCTL_HANDLER_ARGS); static int sysctl_hw_jme_tx_coal_pkt(SYSCTL_HANDLER_ARGS); @@ -651,6 +654,14 @@ jme_attach(device_t dev) goto fail; } + if (CHIPMODE_REVFM(sc->jme_chip_rev) >= 2) { + if ((sc->jme_rev & DEVICEID_JMC2XX_MASK) == DEVICEID_JMC260 && + CHIPMODE_REVFM(sc->jme_chip_rev) == 2) + sc->jme_flags |= JME_FLAG_DMA32BIT; + sc->jme_flags |= JME_FLAG_TXCLK; + sc->jme_flags |= JME_FLAG_HWMIB; + } + /* Reset the ethernet controller. */ jme_reset(sc); @@ -880,35 +891,41 @@ jme_detach(device_t dev) return (0); } +#define JME_SYSCTL_STAT_ADD32(c, h, n, p, d) \ + SYSCTL_ADD_UINT(c, h, OID_AUTO, n, CTLFLAG_RD, p, 0, d) + static void jme_sysctl_node(struct jme_softc *sc) { + struct sysctl_ctx_list *ctx; + struct sysctl_oid_list *child, *parent; + struct sysctl_oid *tree; + struct jme_hw_stats *stats; int error; - SYSCTL_ADD_PROC(device_get_sysctl_ctx(sc->jme_dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(sc->jme_dev)), OID_AUTO, - "tx_coal_to", CTLTYPE_INT | CTLFLAG_RW, &sc->jme_tx_coal_to, - 0, sysctl_hw_jme_tx_coal_to, "I", "jme tx coalescing timeout"); - - SYSCTL_ADD_PROC(device_get_sysctl_ctx(sc->jme_dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(sc->jme_dev)), OID_AUTO, - "tx_coal_pkt", CTLTYPE_INT | CTLFLAG_RW, &sc->jme_tx_coal_pkt, - 0, sysctl_hw_jme_tx_coal_pkt, "I", "jme tx coalescing packet"); - - SYSCTL_ADD_PROC(device_get_sysctl_ctx(sc->jme_dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(sc->jme_dev)), OID_AUTO, - "rx_coal_to", CTLTYPE_INT | CTLFLAG_RW, &sc->jme_rx_coal_to, - 0, sysctl_hw_jme_rx_coal_to, "I", "jme rx coalescing timeout"); - - SYSCTL_ADD_PROC(device_get_sysctl_ctx(sc->jme_dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(sc->jme_dev)), OID_AUTO, - "rx_coal_pkt", CTLTYPE_INT | CTLFLAG_RW, &sc->jme_rx_coal_pkt, - 0, sysctl_hw_jme_rx_coal_pkt, "I", "jme rx coalescing packet"); - - SYSCTL_ADD_PROC(device_get_sysctl_ctx(sc->jme_dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(sc->jme_dev)), OID_AUTO, - "process_limit", CTLTYPE_INT | CTLFLAG_RW, &sc->jme_process_limit, - 0, sysctl_hw_jme_proc_limit, "I", + stats = &sc->jme_stats; + ctx = device_get_sysctl_ctx(sc->jme_dev); + child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->jme_dev)); + + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "tx_coal_to", + CTLTYPE_INT | CTLFLAG_RW, &sc->jme_tx_coal_to, 0, + sysctl_hw_jme_tx_coal_to, "I", "jme tx coalescing timeout"); + + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "tx_coal_pkt", + CTLTYPE_INT | CTLFLAG_RW, &sc->jme_tx_coal_pkt, 0, + sysctl_hw_jme_tx_coal_pkt, "I", "jme tx coalescing packet"); + + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rx_coal_to", + CTLTYPE_INT | CTLFLAG_RW, &sc->jme_rx_coal_to, 0, + sysctl_hw_jme_rx_coal_to, "I", "jme rx coalescing timeout"); + + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rx_coal_pkt", + CTLTYPE_INT | CTLFLAG_RW, &sc->jme_rx_coal_pkt, 0, + sysctl_hw_jme_rx_coal_pkt, "I", "jme rx coalescing packet"); + + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "process_limit", + CTLTYPE_INT | CTLFLAG_RW, &sc->jme_process_limit, 0, + sysctl_hw_jme_proc_limit, "I", "max number of Rx events to process"); /* Pull in device tunables. */ @@ -977,8 +994,43 @@ jme_sysctl_node(struct jme_softc *sc) sc->jme_rx_coal_pkt = PCCRX_COAL_PKT_DEFAULT; } } + + if ((sc->jme_flags & JME_FLAG_HWMIB) == 0) + return; + + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, + NULL, "JME statistics"); + parent = SYSCTL_CHILDREN(tree); + + /* Rx statistics. */ + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", CTLFLAG_RD, + NULL, "Rx MAC statistics"); + child = SYSCTL_CHILDREN(tree); + JME_SYSCTL_STAT_ADD32(ctx, child, "good_frames", + &stats->rx_good_frames, "Good frames"); + JME_SYSCTL_STAT_ADD32(ctx, child, "crc_errs", + &stats->rx_crc_errs, "CRC errors"); + JME_SYSCTL_STAT_ADD32(ctx, child, "mii_errs", + &stats->rx_mii_errs, "MII errors"); + JME_SYSCTL_STAT_ADD32(ctx, child, "fifo_oflows", + &stats->rx_fifo_oflows, "FIFO overflows"); + JME_SYSCTL_STAT_ADD32(ctx, child, "desc_empty", + &stats->rx_desc_empty, "Descriptor empty"); + JME_SYSCTL_STAT_ADD32(ctx, child, "bad_frames", + &stats->rx_bad_frames, "Bad frames"); + + /* Tx statistics. */ + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", CTLFLAG_RD, + NULL, "Tx MAC statistics"); + child = SYSCTL_CHILDREN(tree); + JME_SYSCTL_STAT_ADD32(ctx, child, "good_frames", + &stats->tx_good_frames, "Good frames"); + JME_SYSCTL_STAT_ADD32(ctx, child, "bad_frames", + &stats->tx_bad_frames, "Bad frames"); } +#undef JME_SYSCTL_STAT_ADD32 + struct jme_dmamap_arg { bus_addr_t jme_busaddr; }; @@ -1007,6 +1059,8 @@ jme_dma_alloc(struct jme_softc *sc) int error, i; lowaddr = BUS_SPACE_MAXADDR; + if ((sc->jme_flags & JME_FLAG_DMA32BIT) != 0) + lowaddr = BUS_SPACE_MAXADDR_32BIT; again: /* Create parent ring tag. */ @@ -1106,25 +1160,32 @@ again: } sc->jme_rdata.jme_rx_ring_paddr = ctx.jme_busaddr; - /* Tx/Rx descriptor queue should reside within 4GB boundary. */ - tx_ring_end = sc->jme_rdata.jme_tx_ring_paddr + JME_TX_RING_SIZE; - rx_ring_end = sc->jme_rdata.jme_rx_ring_paddr + JME_RX_RING_SIZE; - if ((JME_ADDR_HI(tx_ring_end) != - JME_ADDR_HI(sc->jme_rdata.jme_tx_ring_paddr)) || - (JME_ADDR_HI(rx_ring_end) != - JME_ADDR_HI(sc->jme_rdata.jme_rx_ring_paddr))) { - device_printf(sc->jme_dev, "4GB boundary crossed, " - "switching to 32bit DMA address mode.\n"); - jme_dma_free(sc); - /* Limit DMA address space to 32bit and try again. */ - lowaddr = BUS_SPACE_MAXADDR_32BIT; - goto again; + if (lowaddr != BUS_SPACE_MAXADDR_32BIT) { + /* Tx/Rx descriptor queue should reside within 4GB boundary. */ + tx_ring_end = sc->jme_rdata.jme_tx_ring_paddr + + JME_TX_RING_SIZE; + rx_ring_end = sc->jme_rdata.jme_rx_ring_paddr + + JME_RX_RING_SIZE; + if ((JME_ADDR_HI(tx_ring_end) != + JME_ADDR_HI(sc->jme_rdata.jme_tx_ring_paddr)) || + (JME_ADDR_HI(rx_ring_end) != + JME_ADDR_HI(sc->jme_rdata.jme_rx_ring_paddr))) { + device_printf(sc->jme_dev, "4GB boundary crossed, " + "switching to 32bit DMA address mode.\n"); + jme_dma_free(sc); + /* Limit DMA address space to 32bit and try again. */ + lowaddr = BUS_SPACE_MAXADDR_32BIT; + goto again; + } } + lowaddr = BUS_SPACE_MAXADDR; + if ((sc->jme_flags & JME_FLAG_DMA32BIT) != 0) + lowaddr = BUS_SPACE_MAXADDR_32BIT; /* Create parent buffer tag. */ error = bus_dma_tag_create(bus_get_dma_tag(sc->jme_dev),/* parent */ 1, 0, /* algnmnt, boundary */ - BUS_SPACE_MAXADDR, /* lowaddr */ + lowaddr, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ @@ -1445,6 +1506,11 @@ jme_setwol(struct jme_softc *sc) JME_LOCK_ASSERT(sc); if (pci_find_extcap(sc->jme_dev, PCIY_PMG, &pmc) != 0) { + /* Remove Tx MAC/offload clock to save more power. */ + if ((sc->jme_flags & JME_FLAG_TXCLK) != 0) + CSR_WRITE_4(sc, JME_GHC, CSR_READ_4(sc, JME_GHC) & + ~(GHC_TX_OFFLD_CLK_100 | GHC_TX_MAC_CLK_100 | + GHC_TX_OFFLD_CLK_1000 | GHC_TX_MAC_CLK_1000)); /* No PME capability, PHY power down. */ jme_miibus_writereg(sc->jme_dev, sc->jme_phyaddr, MII_BMCR, BMCR_PDOWN); @@ -1466,7 +1532,11 @@ jme_setwol(struct jme_softc *sc) CSR_WRITE_4(sc, JME_PMCS, pmcs); CSR_WRITE_4(sc, JME_GPREG0, gpr); - + /* Remove Tx MAC/offload clock to save more power. */ + if ((sc->jme_flags & JME_FLAG_TXCLK) != 0) + CSR_WRITE_4(sc, JME_GHC, CSR_READ_4(sc, JME_GHC) & + ~(GHC_TX_OFFLD_CLK_100 | GHC_TX_MAC_CLK_100 | + GHC_TX_OFFLD_CLK_1000 | GHC_TX_MAC_CLK_1000)); /* Request PME. */ pmstat = pci_read_config(sc->jme_dev, pmc + PCIR_POWER_STATUS, 2); pmstat &= ~(PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE); @@ -1941,6 +2011,7 @@ jme_mac_config(struct jme_softc *sc) { struct mii_data *mii; uint32_t ghc, gpreg, rxmac, txmac, txpause; + uint32_t txclk; JME_LOCK_ASSERT(sc); @@ -1950,6 +2021,7 @@ jme_mac_config(struct jme_softc *sc) DELAY(10); CSR_WRITE_4(sc, JME_GHC, 0); ghc = 0; + txclk = 0; rxmac = CSR_READ_4(sc, JME_RXMAC); rxmac &= ~RXMAC_FC_ENB; txmac = CSR_READ_4(sc, JME_TXMAC); @@ -1982,14 +2054,17 @@ jme_mac_config(struct jme_softc *sc) switch (IFM_SUBTYPE(mii->mii_media_active)) { case IFM_10_T: ghc |= GHC_SPEED_10; + txclk |= GHC_TX_OFFLD_CLK_100 | GHC_TX_MAC_CLK_100; break; case IFM_100_TX: ghc |= GHC_SPEED_100; + txclk |= GHC_TX_OFFLD_CLK_100 | GHC_TX_MAC_CLK_100; break; case IFM_1000_T: if ((sc->jme_flags & JME_FLAG_FASTETH) != 0) break; ghc |= GHC_SPEED_1000; + txclk |= GHC_TX_OFFLD_CLK_1000 | GHC_TX_MAC_CLK_1000; if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) == 0) txmac |= TXMAC_CARRIER_EXT | TXMAC_FRAME_BURST; break; @@ -2019,6 +2094,8 @@ jme_mac_config(struct jme_softc *sc) 0x1B, 0x0004); } } + if ((sc->jme_flags & JME_FLAG_TXCLK) != 0) + ghc |= txclk; CSR_WRITE_4(sc, JME_GHC, ghc); CSR_WRITE_4(sc, JME_RXMAC, rxmac); CSR_WRITE_4(sc, JME_TXMAC, txmac); @@ -2132,6 +2209,7 @@ jme_link_task(void *arg, int pending) /* Program MAC with resolved speed/duplex/flow-control. */ if ((sc->jme_flags & JME_FLAG_LINK) != 0) { jme_mac_config(sc); + jme_stats_clear(sc); CSR_WRITE_4(sc, JME_RXCSR, sc->jme_rxcsr); CSR_WRITE_4(sc, JME_TXCSR, sc->jme_txcsr); @@ -2521,6 +2599,7 @@ jme_tick(void *arg) * faster and limit the maximum delay to a hz. */ jme_txeof(sc); + jme_stats_update(sc); jme_watchdog(sc); callout_reset(&sc->jme_tick_ch, hz, jme_tick, sc); } @@ -2637,13 +2716,19 @@ jme_init_locked(struct jme_softc *sc) * decrease FIFO threshold to reduce the FIFO overruns for * frames larger than 4000 bytes. * For best performance of standard MTU sized frames use - * maximum allowable FIFO threshold, 128QW. + * maximum allowable FIFO threshold, 128QW. Note these do + * not hold on chip full mask verion >=2. For these + * controllers 64QW and 128QW are not valid value. */ - if ((ifp->if_mtu + ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN + - ETHER_CRC_LEN) > JME_RX_FIFO_SIZE) + if (CHIPMODE_REVFM(sc->jme_chip_rev) >= 2) sc->jme_rxcsr |= RXCSR_FIFO_THRESH_16QW; - else - sc->jme_rxcsr |= RXCSR_FIFO_THRESH_128QW; + else { + if ((ifp->if_mtu + ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN + + ETHER_CRC_LEN) > JME_RX_FIFO_SIZE) + sc->jme_rxcsr |= RXCSR_FIFO_THRESH_16QW; + else + sc->jme_rxcsr |= RXCSR_FIFO_THRESH_128QW; + } sc->jme_rxcsr |= sc->jme_rx_dma_size | RXCSR_RXQ_N_SEL(RXCSR_RXQ0); sc->jme_rxcsr |= RXCSR_DESC_RT_CNT(RXCSR_DESC_RT_CNT_DEFAULT); sc->jme_rxcsr |= RXCSR_DESC_RT_GAP_256 & RXCSR_DESC_RT_GAP_MASK; @@ -2824,6 +2909,8 @@ jme_stop(struct jme_softc *sc) txd->tx_ndesc = 0; } } + jme_stats_update(sc); + jme_stats_save(sc); } static void @@ -3055,6 +3142,76 @@ jme_set_filter(struct jme_softc *sc) CSR_WRITE_4(sc, JME_RXMAC, rxcfg); } +static void +jme_stats_clear(struct jme_softc *sc) +{ + + JME_LOCK_ASSERT(sc); + + if ((sc->jme_flags & JME_FLAG_HWMIB) == 0) + return; + + /* Disable and clear counters. */ + CSR_WRITE_4(sc, JME_STATCSR, 0xFFFFFFFF); + /* Activate hw counters. */ + CSR_WRITE_4(sc, JME_STATCSR, 0); + CSR_READ_4(sc, JME_STATCSR); + bzero(&sc->jme_stats, sizeof(struct jme_hw_stats)); +} + +static void +jme_stats_save(struct jme_softc *sc) +{ + + JME_LOCK_ASSERT(sc); + + if ((sc->jme_flags & JME_FLAG_HWMIB) == 0) + return; + /* Save current counters. */ + bcopy(&sc->jme_stats, &sc->jme_ostats, sizeof(struct jme_hw_stats)); + /* Disable and clear counters. */ + CSR_WRITE_4(sc, JME_STATCSR, 0xFFFFFFFF); +} + +static void +jme_stats_update(struct jme_softc *sc) +{ + struct jme_hw_stats *stat, *ostat; + uint32_t reg; + + JME_LOCK_ASSERT(sc); + + if ((sc->jme_flags & JME_FLAG_HWMIB) == 0) + return; + stat = &sc->jme_stats; + ostat = &sc->jme_ostats; + stat->tx_good_frames = CSR_READ_4(sc, JME_STAT_TXGOOD); + stat->rx_good_frames = CSR_READ_4(sc, JME_STAT_RXGOOD); + reg = CSR_READ_4(sc, JME_STAT_CRCMII); + stat->rx_crc_errs = (reg & STAT_RX_CRC_ERR_MASK) >> + STAT_RX_CRC_ERR_SHIFT; + stat->rx_mii_errs = (reg & STAT_RX_MII_ERR_MASK) >> + STAT_RX_MII_ERR_SHIFT; + reg = CSR_READ_4(sc, JME_STAT_RXERR); + stat->rx_fifo_oflows = (reg & STAT_RXERR_OFLOW_MASK) >> + STAT_RXERR_OFLOW_SHIFT; + stat->rx_desc_empty = (reg & STAT_RXERR_MPTY_MASK) >> + STAT_RXERR_MPTY_SHIFT; + reg = CSR_READ_4(sc, JME_STAT_FAIL); + stat->rx_bad_frames = (reg & STAT_FAIL_RX_MASK) >> STAT_FAIL_RX_SHIFT; + stat->tx_bad_frames = (reg & STAT_FAIL_TX_MASK) >> STAT_FAIL_TX_SHIFT; + + /* Account for previous counters. */ + stat->rx_good_frames += ostat->rx_good_frames; + stat->rx_crc_errs += ostat->rx_crc_errs; + stat->rx_mii_errs += ostat->rx_mii_errs; + stat->rx_fifo_oflows += ostat->rx_fifo_oflows; + stat->rx_desc_empty += ostat->rx_desc_empty; + stat->rx_bad_frames += ostat->rx_bad_frames; + stat->tx_good_frames += ostat->tx_good_frames; + stat->tx_bad_frames += ostat->tx_bad_frames; +} + static int sysctl_int_range(SYSCTL_HANDLER_ARGS, int low, int high) { Modified: user/kmacy/head_arpv2/sys/dev/jme/if_jmereg.h ============================================================================== --- user/kmacy/head_arpv2/sys/dev/jme/if_jmereg.h Wed Dec 10 02:10:44 2008 (r185820) +++ user/kmacy/head_arpv2/sys/dev/jme/if_jmereg.h Wed Dec 10 02:18:55 2008 (r185821) @@ -240,8 +240,8 @@ #define RXCSR_FIFO_FTHRESH_MASK 0x30000000 #define RXCSR_FIFO_THRESH_16QW 0x00000000 #define RXCSR_FIFO_THRESH_32QW 0x04000000 -#define RXCSR_FIFO_THRESH_64QW 0x08000000 -#define RXCSR_FIFO_THRESH_128QW 0x0C000000 +#define RXCSR_FIFO_THRESH_64QW 0x08000000 /* JMC250/JMC260 REVFM < 2 */ +#define RXCSR_FIFO_THRESH_128QW 0x0C000000 /* JMC250/JMC260 REVFM < 2 */ #define RXCSR_FIFO_THRESH_MASK 0x0C000000 #define RXCSR_DMA_SIZE_16 0x00000000 #define RXCSR_DMA_SIZE_32 0x01000000 @@ -358,6 +358,16 @@ #define JME_GHC 0x0054 #define GHC_LOOPBACK 0x80000000 #define GHC_RESET 0x40000000 +#define GHC_RX_DMA_PWR_DIS 0x04000000 /* JMC250 REVFM >= 2 */ +#define GHC_FIFO_RD_PWR_DIS 0x02000000 /* JMC250 REVFM >= 2 */ +#define GHC_FIFO_WR_PWR_DIS 0x01000000 /* JMC250 REVFM >= 2 */ +#define GHC_TX_OFFLD_CLK_100 0x00800000 /* JMC250/JMC260 REVFM >= 2 */ +#define GHC_TX_OFFLD_CLK_1000 0x00400000 /* JMC250/JMC260 REVFM >= 2 */ +#define GHC_TX_OFFLD_CLK_DIS 0x00000000 /* JMC250/JMC260 REVFM >= 2 */ +#define GHC_TX_MAC_CLK_100 0x00200000 /* JMC250/JMC260 REVFM >= 2 */ +#define GHC_TX_MAC_CLK_1000 0x00100000 /* JMC250/JMC260 REVFM >= 2 */ +#define GHC_TX_MAC_CLK_DIS 0x00000000 /* JMC250/JMC260 REVFM >= 2 */ +#define GHC_AUTO_PHY_STAT_DIS 0x00000080 /* JMC250/JMC260 REVFM >= 2 */ #define GHC_FULL_DUPLEX 0x00000040 #define GHC_SPEED_UNKNOWN 0x00000000 #define GHC_SPEED_10 0x00000010 @@ -794,6 +804,10 @@ #define CHIPMODE_MODE_128P_MAC 0x00000003 #define CHIPMODE_MODE_128P_DBG 0x00000002 #define CHIPMODE_MODE_128P_PHY 0x00000000 +/* Chip full mask revision. */ +#define CHIPMODE_REVFM(x) ((x) & 0x0F) +/* Chip ECO revision. */ +#define CHIPMODE_REVECO(x) (((x) >> 4) & 0x0F) /* Shadow status base address high/low. */ #define JME_SHBASE_ADDR_HI 0x0848 Modified: user/kmacy/head_arpv2/sys/dev/jme/if_jmevar.h ============================================================================== --- user/kmacy/head_arpv2/sys/dev/jme/if_jmevar.h Wed Dec 10 02:10:44 2008 (r185820) +++ user/kmacy/head_arpv2/sys/dev/jme/if_jmevar.h Wed Dec 10 02:18:55 2008 (r185821) @@ -193,6 +193,8 @@ struct jme_softc { #define JME_FLAG_PMCAP 0x0020 #define JME_FLAG_FASTETH 0x0040 #define JME_FLAG_NOJUMBO 0x0080 +#define JME_FLAG_TXCLK 0x0100 +#define JME_FLAG_DMA32BIT 0x0200 #define JME_FLAG_HWMIB 0x0400 #define JME_FLAG_DETACH 0x4000 #define JME_FLAG_LINK 0x8000 From owner-svn-src-user@FreeBSD.ORG Wed Dec 10 02:20:58 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3B72106564A; Wed, 10 Dec 2008 02:20:58 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B756F8FC25; Wed, 10 Dec 2008 02:20:58 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBA2Kwr6009311; Wed, 10 Dec 2008 02:20:58 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBA2KwmI009310; Wed, 10 Dec 2008 02:20:58 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <200812100220.mBA2KwmI009310@svn.freebsd.org> From: Qing Li Date: Wed, 10 Dec 2008 02:20:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185822 - user/qingli/l2l3-rewrite X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2008 02:20:59 -0000 Author: qingli Date: Wed Dec 10 02:20:58 2008 New Revision: 185822 URL: http://svn.freebsd.org/changeset/base/185822 Log: make a copy of head for the L2/L3 (arp-v2) rewrite work Added: user/qingli/l2l3-rewrite/ - copied from r185821, head/ From owner-svn-src-user@FreeBSD.ORG Wed Dec 10 02:21:08 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DEE11065740; Wed, 10 Dec 2008 02:21:08 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7AEEB8FC18; Wed, 10 Dec 2008 02:21:08 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBA2L89W009364; Wed, 10 Dec 2008 02:21:08 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBA2L8RA009363; Wed, 10 Dec 2008 02:21:08 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812100221.mBA2L8RA009363@svn.freebsd.org> From: Kip Macy Date: Wed, 10 Dec 2008 02:21:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185823 - user/kmacy/head_arpv2/sys/net X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2008 02:21:08 -0000 Author: kmacy Date: Wed Dec 10 02:21:08 2008 New Revision: 185823 URL: http://svn.freebsd.org/changeset/base/185823 Log: merge fix for loopback connections Modified: user/kmacy/head_arpv2/sys/net/if_ethersubr.c Modified: user/kmacy/head_arpv2/sys/net/if_ethersubr.c ============================================================================== --- user/kmacy/head_arpv2/sys/net/if_ethersubr.c Wed Dec 10 02:20:58 2008 (r185822) +++ user/kmacy/head_arpv2/sys/net/if_ethersubr.c Wed Dec 10 02:21:08 2008 (r185823) @@ -290,8 +290,16 @@ ether_output(struct ifnet *ifp, struct m senderr(EAFNOSUPPORT); } - if (lle && (lle->la_flags & LLE_IFADDR) && useloopback) + if (lle && (lle->la_flags & LLE_IFADDR) && useloopback) { + int csum_flags = 0; + if (m->m_pkthdr.csum_flags & CSUM_IP) + csum_flags |= (CSUM_IP_CHECKED|CSUM_IP_VALID); + if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) + csum_flags |= (CSUM_DATA_VALID|CSUM_PSEUDO_HDR); + m->m_pkthdr.csum_flags |= csum_flags; + m->m_pkthdr.csum_data = 0xffff; return (if_simloop(ifp, m, dst->sa_family, 0)); + } /* * Add local net header. If no space in first mbuf, From owner-svn-src-user@FreeBSD.ORG Wed Dec 10 02:24:51 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 346C81065679; Wed, 10 Dec 2008 02:24:51 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 20CDE8FC12; Wed, 10 Dec 2008 02:24:51 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBA2Oovw009745; Wed, 10 Dec 2008 02:24:50 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBA2OoeW009744; Wed, 10 Dec 2008 02:24:50 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812100224.mBA2OoeW009744@svn.freebsd.org> From: Kip Macy Date: Wed, 10 Dec 2008 02:24:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185824 - user/kmacy/head_arpv2/sys/netinet X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2008 02:24:51 -0000 Author: kmacy Date: Wed Dec 10 02:24:50 2008 New Revision: 185824 URL: http://svn.freebsd.org/changeset/base/185824 Log: remove unused rt_expire define Modified: user/kmacy/head_arpv2/sys/netinet/if_ether.c Modified: user/kmacy/head_arpv2/sys/netinet/if_ether.c ============================================================================== --- user/kmacy/head_arpv2/sys/netinet/if_ether.c Wed Dec 10 02:21:08 2008 (r185823) +++ user/kmacy/head_arpv2/sys/netinet/if_ether.c Wed Dec 10 02:24:50 2008 (r185824) @@ -96,8 +96,6 @@ static int arp_proxyall; SYSCTL_V_INT(V_NET, vnet_inet, _net_link_ether_inet, OID_AUTO, max_age, CTLFLAG_RW, arpt_keep, 0, "ARP entry lifetime in seconds"); -#define rt_expire rt_rmx.rmx_expire - static struct ifqueue arpintrq; SYSCTL_V_INT(V_NET, vnet_inet, _net_link_ether_inet, OID_AUTO, maxtries, From owner-svn-src-user@FreeBSD.ORG Wed Dec 10 02:59:09 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CDE021065697; Wed, 10 Dec 2008 02:59:09 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA4E58FC33; Wed, 10 Dec 2008 02:59:09 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBA2x9HF011183; Wed, 10 Dec 2008 02:59:09 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBA2x9oS011182; Wed, 10 Dec 2008 02:59:09 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812100259.mBA2x9oS011182@svn.freebsd.org> From: Kip Macy Date: Wed, 10 Dec 2008 02:59:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185826 - user/kmacy/head_arpv2/sys/netinet X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2008 02:59:09 -0000 Author: kmacy Date: Wed Dec 10 02:59:09 2008 New Revision: 185826 URL: http://svn.freebsd.org/changeset/base/185826 Log: only downgrade if we hold the lock exclusively Modified: user/kmacy/head_arpv2/sys/netinet/if_ether.c Modified: user/kmacy/head_arpv2/sys/netinet/if_ether.c ============================================================================== --- user/kmacy/head_arpv2/sys/netinet/if_ether.c Wed Dec 10 02:32:06 2008 (r185825) +++ user/kmacy/head_arpv2/sys/netinet/if_ether.c Wed Dec 10 02:59:09 2008 (r185826) @@ -339,7 +339,7 @@ retry: if (la->la_hold) m_freem(la->la_hold); la->la_hold = m; - if (renew == 0) { + if (renew == 0 && (flags & LLE_EXCLUSIVE)) { flags &= ~LLE_EXCLUSIVE; LLE_DOWNGRADE(la); } From owner-svn-src-user@FreeBSD.ORG Wed Dec 10 03:04:17 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 539911065670; Wed, 10 Dec 2008 03:04:17 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3FEBC8FC1D; Wed, 10 Dec 2008 03:04:17 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBA34HAa011441; Wed, 10 Dec 2008 03:04:17 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBA34HBO011440; Wed, 10 Dec 2008 03:04:17 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812100304.mBA34HBO011440@svn.freebsd.org> From: Kip Macy Date: Wed, 10 Dec 2008 03:04:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185827 - user/kmacy/head_arpv2/sys/net X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2008 03:04:17 -0000 Author: kmacy Date: Wed Dec 10 03:04:16 2008 New Revision: 185827 URL: http://svn.freebsd.org/changeset/base/185827 Log: - ifp lookup only needs to be protected with an rlock - lock lle exclusively for LLE_CREATE - don't hold LLE_LOCK across arprequest - only hold IF_AFDATA_LOCK across lookup Modified: user/kmacy/head_arpv2/sys/net/if_llatbl.c Modified: user/kmacy/head_arpv2/sys/net/if_llatbl.c ============================================================================== --- user/kmacy/head_arpv2/sys/net/if_llatbl.c Wed Dec 10 02:59:09 2008 (r185826) +++ user/kmacy/head_arpv2/sys/net/if_llatbl.c Wed Dec 10 03:04:16 2008 (r185827) @@ -188,7 +188,8 @@ lla_rt_output(struct rt_msghdr *rtm, str struct ifnet *ifp; struct lltable *llt; struct llentry *lle; - u_int flags = 0; + u_int laflags = 0, flags = 0; + int error = 0; if (dl == NULL || dl->sdl_family != AF_LINK) { log(LOG_INFO, "%s: invalid dl\n", __func__); @@ -240,17 +241,21 @@ lla_rt_output(struct rt_msghdr *rtm, str * XXXXXXXX: * REVISE this approach if possible. */ - IFNET_WLOCK(); + IFNET_RLOCK(); SLIST_FOREACH(llt, &lltables, llt_link) { if (llt->llt_af == dst->sa_family && llt->llt_ifp == ifp) break; } - IFNET_WUNLOCK(); + IFNET_RUNLOCK(); KASSERT(llt != NULL, ("Yep, ugly hacks are bad\n")); + if (flags && LLE_CREATE) + flags |= LLE_EXCLUSIVE; + IF_AFDATA_LOCK(ifp); lle = lla_lookup(llt, flags, dst); + IF_AFDATA_UNLOCK(ifp); if (lle != NULL) { if (flags & LLE_CREATE) { /* qing: if we delay the delete, then if a subsequent @@ -270,31 +275,32 @@ lla_rt_output(struct rt_msghdr *rtm, str /* * "arp" and "ndp" always sets the (RTF_STATIC | RTF_HOST) flags */ + if (rtm->rtm_rmx.rmx_expire == 0) { lle->la_flags |= LLE_STATIC; lle->la_expire = 0; } else lle->la_expire = rtm->rtm_rmx.rmx_expire; + laflags = lle->la_flags; + LLE_WUNLOCK(lle); #ifdef INET /* gratuious ARP */ - if ((lle->la_flags & LLE_PUB) && + if ((laflags & LLE_PUB) && dst->sa_family == AF_INET) { arprequest(ifp, &((struct sockaddr_in *)dst)->sin_addr, &((struct sockaddr_in *)dst)->sin_addr, - ((lle->la_flags & LLE_PROXY) ? + ((laflags & LLE_PROXY) ? (u_char *)IF_LLADDR(ifp) : (u_char *)LLADDR(dl))); } #endif - } + } else + LLE_RUNLOCK(lle); } else { - if (flags & LLE_DELETE) { - IF_AFDATA_UNLOCK(ifp); - return EINVAL; - } + if (flags & LLE_DELETE) + error = EINVAL; } - IF_AFDATA_UNLOCK(ifp); - return 0; + return (error); } From owner-svn-src-user@FreeBSD.ORG Wed Dec 10 03:16:31 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2783E1065670; Wed, 10 Dec 2008 03:16:31 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 137DA8FC1B; Wed, 10 Dec 2008 03:16:31 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBA3GUO2011860; Wed, 10 Dec 2008 03:16:30 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBA3GU0p011859; Wed, 10 Dec 2008 03:16:30 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812100316.mBA3GU0p011859@svn.freebsd.org> From: Kip Macy Date: Wed, 10 Dec 2008 03:16:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185828 - user/kmacy/head_arpv2/sys/netinet6 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2008 03:16:31 -0000 Author: kmacy Date: Wed Dec 10 03:16:30 2008 New Revision: 185828 URL: http://svn.freebsd.org/changeset/base/185828 Log: rt might be null do not dereference blindly Modified: user/kmacy/head_arpv2/sys/netinet6/nd6.c Modified: user/kmacy/head_arpv2/sys/netinet6/nd6.c ============================================================================== --- user/kmacy/head_arpv2/sys/netinet6/nd6.c Wed Dec 10 03:04:16 2008 (r185827) +++ user/kmacy/head_arpv2/sys/netinet6/nd6.c Wed Dec 10 03:16:30 2008 (r185828) @@ -1110,11 +1110,12 @@ nd6_nud_hint(struct rtentry *rt, struct { INIT_VNET_INET6(curvnet); struct llentry *ln; - struct ifnet *ifp = rt->rt_ifp; + struct ifnet *ifp; - if (dst6 == NULL) + if ((dst6 == NULL) || (rt == NULL)) return; + ifp = rt->rt_ifp; IF_AFDATA_LOCK(ifp); ln = nd6_lookup(dst6, ND6_EXCLUSIVE, NULL); IF_AFDATA_UNLOCK(ifp); From owner-svn-src-user@FreeBSD.ORG Wed Dec 10 03:17:01 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77FBC106564A; Wed, 10 Dec 2008 03:17:01 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 642DE8FC1A; Wed, 10 Dec 2008 03:17:01 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBA3H1fL011904; Wed, 10 Dec 2008 03:17:01 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBA3H1k4011903; Wed, 10 Dec 2008 03:17:01 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812100317.mBA3H1k4011903@svn.freebsd.org> From: Kip Macy Date: Wed, 10 Dec 2008 03:17:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185829 - user/kmacy/head_arpv2/sys/netinet6 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2008 03:17:01 -0000 Author: kmacy Date: Wed Dec 10 03:17:01 2008 New Revision: 185829 URL: http://svn.freebsd.org/changeset/base/185829 Log: nd6_output doesn't need to be protected by the IF_AFDATA_LOCK Modified: user/kmacy/head_arpv2/sys/netinet6/ip6_output.c Modified: user/kmacy/head_arpv2/sys/netinet6/ip6_output.c ============================================================================== --- user/kmacy/head_arpv2/sys/netinet6/ip6_output.c Wed Dec 10 03:16:30 2008 (r185828) +++ user/kmacy/head_arpv2/sys/netinet6/ip6_output.c Wed Dec 10 03:17:01 2008 (r185829) @@ -949,9 +949,7 @@ passout: ia6->ia_ifa.if_opackets++; ia6->ia_ifa.if_obytes += m->m_pkthdr.len; } - IF_AFDATA_LOCK(ifp); error = nd6_output(ifp, origifp, m, dst, ro->ro_rt); - IF_AFDATA_UNLOCK(ifp); goto done; } From owner-svn-src-user@FreeBSD.ORG Wed Dec 10 03:17:27 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A27741065680; Wed, 10 Dec 2008 03:17:27 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E9FC8FC12; Wed, 10 Dec 2008 03:17:27 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBA3HRu7011951; Wed, 10 Dec 2008 03:17:27 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBA3HRi8011950; Wed, 10 Dec 2008 03:17:27 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812100317.mBA3HRi8011950@svn.freebsd.org> From: Kip Macy Date: Wed, 10 Dec 2008 03:17:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185830 - user/kmacy/head_arpv2/sys/netinet6 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2008 03:17:27 -0000 Author: kmacy Date: Wed Dec 10 03:17:27 2008 New Revision: 185830 URL: http://svn.freebsd.org/changeset/base/185830 Log: if_output doesn't need to be protected by the IF_AFDATA_LOCK Modified: user/kmacy/head_arpv2/sys/netinet6/ip6_mroute.c Modified: user/kmacy/head_arpv2/sys/netinet6/ip6_mroute.c ============================================================================== --- user/kmacy/head_arpv2/sys/netinet6/ip6_mroute.c Wed Dec 10 03:17:01 2008 (r185829) +++ user/kmacy/head_arpv2/sys/netinet6/ip6_mroute.c Wed Dec 10 03:17:27 2008 (r185830) @@ -1612,10 +1612,8 @@ phyint_send(struct ip6_hdr *ip6, struct * We just call if_output instead of nd6_output here, since * we need no ND for a multicast forwarded packet...right? */ - IF_AFDATA_LOCK(ifp); error = (*ifp->if_output)(ifp, mb_copy, (struct sockaddr *)&ro.ro_dst, NULL); - IF_AFDATA_UNLOCK(ifp); #ifdef MRT6DEBUG if (V_mrt6debug & DEBUG_XMIT) log(LOG_DEBUG, "phyint_send on mif %d err %d\n", From owner-svn-src-user@FreeBSD.ORG Wed Dec 10 03:30:38 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C04B1065672; Wed, 10 Dec 2008 03:30:38 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 576D98FC08; Wed, 10 Dec 2008 03:30:38 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBA3UcSu012266; Wed, 10 Dec 2008 03:30:38 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBA3UcpB012261; Wed, 10 Dec 2008 03:30:38 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812100330.mBA3UcpB012261@svn.freebsd.org> From: Kip Macy Date: Wed, 10 Dec 2008 03:30:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185831 - user/kmacy/head_arpv2/sys/netinet6 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2008 03:30:38 -0000 Author: kmacy Date: Wed Dec 10 03:30:37 2008 New Revision: 185831 URL: http://svn.freebsd.org/changeset/base/185831 Log: fix IF_AFDATA_LOCK recursion in nd6_cache_lladdr Modified: user/kmacy/head_arpv2/sys/netinet6/icmp6.c user/kmacy/head_arpv2/sys/netinet6/ip6_output.c user/kmacy/head_arpv2/sys/netinet6/nd6.c user/kmacy/head_arpv2/sys/netinet6/nd6_nbr.c user/kmacy/head_arpv2/sys/netinet6/nd6_rtr.c Modified: user/kmacy/head_arpv2/sys/netinet6/icmp6.c ============================================================================== --- user/kmacy/head_arpv2/sys/netinet6/icmp6.c Wed Dec 10 03:17:27 2008 (r185830) +++ user/kmacy/head_arpv2/sys/netinet6/icmp6.c Wed Dec 10 03:30:37 2008 (r185831) @@ -2397,10 +2397,8 @@ icmp6_redirect_input(struct mbuf *m, int } /* RFC 2461 8.3 */ - IF_AFDATA_LOCK(ifp); nd6_cache_lladdr(ifp, &redtgt6, lladdr, lladdrlen, ND_REDIRECT, is_onlink ? ND_REDIRECT_ONLINK : ND_REDIRECT_ROUTER); - IF_AFDATA_UNLOCK(ifp); if (!is_onlink) { /* better router case. perform rtredirect. */ /* perform rtredirect */ Modified: user/kmacy/head_arpv2/sys/netinet6/ip6_output.c ============================================================================== --- user/kmacy/head_arpv2/sys/netinet6/ip6_output.c Wed Dec 10 03:17:27 2008 (r185830) +++ user/kmacy/head_arpv2/sys/netinet6/ip6_output.c Wed Dec 10 03:30:37 2008 (r185831) @@ -1088,9 +1088,7 @@ sendorfree: ia->ia_ifa.if_opackets++; ia->ia_ifa.if_obytes += m->m_pkthdr.len; } - IF_AFDATA_LOCK(ifp); error = nd6_output(ifp, origifp, m, dst, ro->ro_rt); - IF_AFDATA_UNLOCK(ifp); } else m_freem(m); } Modified: user/kmacy/head_arpv2/sys/netinet6/nd6.c ============================================================================== --- user/kmacy/head_arpv2/sys/netinet6/nd6.c Wed Dec 10 03:17:27 2008 (r185830) +++ user/kmacy/head_arpv2/sys/netinet6/nd6.c Wed Dec 10 03:30:37 2008 (r185831) @@ -1400,7 +1400,7 @@ nd6_cache_lladdr(struct ifnet *ifp, stru int flags = 0; int newstate = 0; - IF_AFDATA_LOCK_ASSERT(ifp); + IF_AFDATA_UNLOCK_ASSERT(ifp); if (ifp == NULL) panic("ifp == NULL in nd6_cache_lladdr"); @@ -1421,9 +1421,13 @@ nd6_cache_lladdr(struct ifnet *ifp, stru * description on it in NS section (RFC 2461 7.2.3). */ flags |= lladdr ? ND6_EXCLUSIVE : 0; + IF_AFDATA_LOCK(ifp); ln = nd6_lookup(from, flags, ifp); + if (ln) + IF_AFDATA_UNLOCK(ifp); if (ln == NULL) { ln = nd6_lookup(from, flags |ND6_CREATE, ifp); + IF_AFDATA_UNLOCK(ifp); is_newentry = 1; } else { /* do nothing if static ndp is set */ Modified: user/kmacy/head_arpv2/sys/netinet6/nd6_nbr.c ============================================================================== --- user/kmacy/head_arpv2/sys/netinet6/nd6_nbr.c Wed Dec 10 03:17:27 2008 (r185830) +++ user/kmacy/head_arpv2/sys/netinet6/nd6_nbr.c Wed Dec 10 03:30:37 2008 (r185831) @@ -346,10 +346,8 @@ nd6_ns_input(struct mbuf *m, int off, in goto freeit; } - IF_AFDATA_LOCK(ifp); nd6_cache_lladdr(ifp, &saddr6, lladdr, lladdrlen, ND_NEIGHBOR_SOLICIT, 0); - IF_AFDATA_UNLOCK(ifp); nd6_na_output(ifp, &saddr6, &taddr6, ((anycast || proxy || !tlladdr) ? 0 : ND_NA_FLAG_OVERRIDE) | Modified: user/kmacy/head_arpv2/sys/netinet6/nd6_rtr.c ============================================================================== --- user/kmacy/head_arpv2/sys/netinet6/nd6_rtr.c Wed Dec 10 03:17:27 2008 (r185830) +++ user/kmacy/head_arpv2/sys/netinet6/nd6_rtr.c Wed Dec 10 03:30:37 2008 (r185831) @@ -184,9 +184,7 @@ nd6_rs_input(struct mbuf *m, int off, in goto bad; } - IF_AFDATA_LOCK(ifp); nd6_cache_lladdr(ifp, &saddr6, lladdr, lladdrlen, ND_ROUTER_SOLICIT, 0); - IF_AFDATA_UNLOCK(ifp); freeit: m_freem(m); @@ -409,10 +407,8 @@ nd6_ra_input(struct mbuf *m, int off, in goto bad; } - IF_AFDATA_LOCK(ifp); nd6_cache_lladdr(ifp, &saddr6, lladdr, lladdrlen, ND_ROUTER_ADVERT, 0); - IF_AFDATA_UNLOCK(ifp); /* * Installing a link-layer address might change the state of the From owner-svn-src-user@FreeBSD.ORG Wed Dec 10 03:47:22 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CC7B106564A; Wed, 10 Dec 2008 03:47:22 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 685E28FC14; Wed, 10 Dec 2008 03:47:22 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBA3lMuJ012872; Wed, 10 Dec 2008 03:47:22 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBA3lLoV012870; Wed, 10 Dec 2008 03:47:21 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812100347.mBA3lLoV012870@svn.freebsd.org> From: Kip Macy Date: Wed, 10 Dec 2008 03:47:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185832 - user/kmacy/head_arpv2/sys/netinet6 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2008 03:47:22 -0000 Author: kmacy Date: Wed Dec 10 03:47:21 2008 New Revision: 185832 URL: http://svn.freebsd.org/changeset/base/185832 Log: - fix case where flags was not passed to lla_lookup - use exclusive flag to determine whether or not to wunlock rather than the condition that determined the use of the exclusive flag Modified: user/kmacy/head_arpv2/sys/netinet6/nd6.c user/kmacy/head_arpv2/sys/netinet6/nd6.h Modified: user/kmacy/head_arpv2/sys/netinet6/nd6.c ============================================================================== --- user/kmacy/head_arpv2/sys/netinet6/nd6.c Wed Dec 10 03:30:37 2008 (r185831) +++ user/kmacy/head_arpv2/sys/netinet6/nd6.c Wed Dec 10 03:47:21 2008 (r185832) @@ -1618,7 +1618,7 @@ nd6_cache_lladdr(struct ifnet *ifp, stru done: if (ln) { - if (lladdr) + if (flags & ND6_EXCLUSIVE) LLE_WUNLOCK(ln); else LLE_RUNLOCK(ln); @@ -1697,7 +1697,7 @@ nd6_output(struct ifnet *ifp, struct ifn */ flags = m ? LLE_EXCLUSIVE : 0; IF_AFDATA_LOCK(rt->rt_ifp); - ln = lla_lookup(LLTABLE6(ifp), 0, (struct sockaddr *)dst); + ln = lla_lookup(LLTABLE6(ifp), flags, (struct sockaddr *)dst); IF_AFDATA_UNLOCK(rt->rt_ifp); if ((ln == NULL) && nd6_is_addr_neighbor(dst, ifp)) { /* @@ -1782,21 +1782,22 @@ nd6_output(struct ifnet *ifp, struct ifn ln->la_hold = m; } + if (flags & LLE_EXCLUSIVE) + LLE_WUNLOCK(ln); + else + LLE_RUNLOCK(ln); + /* * If there has been no NS for the neighbor after entering the * INCOMPLETE state, send the first solicitation. */ if (!ND6_LLINFO_PERMANENT(ln) && ln->la_asked == 0) { ln->la_asked++; + nd6_llinfo_settimer(ln, (long)ND_IFINFO(ifp)->retrans * hz / 1000); nd6_ns_output(ifp, NULL, &dst->sin6_addr, ln, 0); } - if (m0) - LLE_WUNLOCK(ln); - else - LLE_RUNLOCK(ln); - return (0); sendpkt: @@ -1806,7 +1807,7 @@ nd6_output(struct ifnet *ifp, struct ifn goto bad; } if (ln) { - if (m0) + if (flags & LLE_EXCLUSIVE) LLE_WUNLOCK(ln); else LLE_RUNLOCK(ln); @@ -1824,7 +1825,7 @@ nd6_output(struct ifnet *ifp, struct ifn bad: if (ln) { - if (m0) + if (flags & LLE_EXCLUSIVE) LLE_WUNLOCK(ln); else LLE_RUNLOCK(ln); Modified: user/kmacy/head_arpv2/sys/netinet6/nd6.h ============================================================================== --- user/kmacy/head_arpv2/sys/netinet6/nd6.h Wed Dec 10 03:30:37 2008 (r185831) +++ user/kmacy/head_arpv2/sys/netinet6/nd6.h Wed Dec 10 03:47:21 2008 (r185832) @@ -85,8 +85,8 @@ struct nd_ifinfo { */ #define ND6_IFF_DONT_SET_IFROUTE 0x10 -#define ND6_CREATE 0x1 -#define ND6_EXCLUSIVE 0x2 +#define ND6_CREATE LLE_CREATE +#define ND6_EXCLUSIVE LLE_EXCLUSIVE #ifdef _KERNEL #define ND_IFINFO(ifp) \ From owner-svn-src-user@FreeBSD.ORG Wed Dec 10 04:05:47 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 492391065670; Wed, 10 Dec 2008 04:05:47 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 34CE48FC14; Wed, 10 Dec 2008 04:05:47 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBA45lI9014306; Wed, 10 Dec 2008 04:05:47 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBA45lhW014305; Wed, 10 Dec 2008 04:05:47 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812100405.mBA45lhW014305@svn.freebsd.org> From: Kip Macy Date: Wed, 10 Dec 2008 04:05:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185833 - user/kmacy/head_arpv2/sys/netinet6 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2008 04:05:47 -0000 Author: kmacy Date: Wed Dec 10 04:05:46 2008 New Revision: 185833 URL: http://svn.freebsd.org/changeset/base/185833 Log: add missed lle unlock Modified: user/kmacy/head_arpv2/sys/netinet6/ip6_input.c Modified: user/kmacy/head_arpv2/sys/netinet6/ip6_input.c ============================================================================== --- user/kmacy/head_arpv2/sys/netinet6/ip6_input.c Wed Dec 10 03:47:21 2008 (r185832) +++ user/kmacy/head_arpv2/sys/netinet6/ip6_input.c Wed Dec 10 04:05:46 2008 (r185833) @@ -561,6 +561,7 @@ passin: LLE_RUNLOCK(lle); goto hbhcheck; } + LLE_RUNLOCK(lle); if (ip6_forward_rt.ro_rt != NULL && (ip6_forward_rt.ro_rt->rt_flags & RTF_UP) != 0 && From owner-svn-src-user@FreeBSD.ORG Wed Dec 10 04:06:55 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56103106564A; Wed, 10 Dec 2008 04:06:55 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 422C18FC08; Wed, 10 Dec 2008 04:06:55 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBA46tH7014444; Wed, 10 Dec 2008 04:06:55 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBA46tx6014443; Wed, 10 Dec 2008 04:06:55 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812100406.mBA46tx6014443@svn.freebsd.org> From: Kip Macy Date: Wed, 10 Dec 2008 04:06:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185834 - user/kmacy/head_arpv2/sys/netinet6 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2008 04:06:55 -0000 Author: kmacy Date: Wed Dec 10 04:06:54 2008 New Revision: 185834 URL: http://svn.freebsd.org/changeset/base/185834 Log: - acquire the IF_AFDATA_LOCK ind nd6_storelladdr - drop the lle lock before return Modified: user/kmacy/head_arpv2/sys/netinet6/nd6.c Modified: user/kmacy/head_arpv2/sys/netinet6/nd6.c ============================================================================== --- user/kmacy/head_arpv2/sys/netinet6/nd6.c Wed Dec 10 04:05:46 2008 (r185833) +++ user/kmacy/head_arpv2/sys/netinet6/nd6.c Wed Dec 10 04:06:54 2008 (r185834) @@ -1872,7 +1872,8 @@ nd6_need_cache(struct ifnet *ifp) } /* - * the caller of this function needs to lock the interface table + * the callers of this function need to be re-worked to drop + * the lle lock, drop here for now */ int nd6_storelladdr(struct ifnet *ifp, struct rtentry *rt0, struct mbuf *m, @@ -1919,8 +1920,12 @@ nd6_storelladdr(struct ifnet *ifp, struc /* * the entry should have been created in nd6_store_lladdr */ + IF_AFDATA_LOCK(ifp); ln = lla_lookup(LLTABLE6(ifp), 0, dst); + IF_AFDATA_LOCK(ifp); if ((ln == NULL) || !(ln->la_flags & LLE_VALID)) { + if (ln) + LLE_RUNLOCK(ln); /* this could happen, if we could not allocate memory */ m_freem(m); return (1); @@ -1928,6 +1933,10 @@ nd6_storelladdr(struct ifnet *ifp, struc bcopy(&ln->ll_addr, desten, ifp->if_addrlen); *lle = ln; + LLE_RUNLOCK(ln); + /* + * A *small* use after free race exists here + */ return (0); } From owner-svn-src-user@FreeBSD.ORG Wed Dec 10 04:07:51 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9276B1065670; Wed, 10 Dec 2008 04:07:51 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E6588FC18; Wed, 10 Dec 2008 04:07:51 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBA47pQb014562; Wed, 10 Dec 2008 04:07:51 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBA47pMX014561; Wed, 10 Dec 2008 04:07:51 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812100407.mBA47pMX014561@svn.freebsd.org> From: Kip Macy Date: Wed, 10 Dec 2008 04:07:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185835 - user/kmacy/head_arpv2/sys/netinet6 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2008 04:07:51 -0000 Author: kmacy Date: Wed Dec 10 04:07:51 2008 New Revision: 185835 URL: http://svn.freebsd.org/changeset/base/185835 Log: else clause only contains LLE_DELETE check change to else if Modified: user/kmacy/head_arpv2/sys/netinet6/in6.c Modified: user/kmacy/head_arpv2/sys/netinet6/in6.c ============================================================================== --- user/kmacy/head_arpv2/sys/netinet6/in6.c Wed Dec 10 04:06:54 2008 (r185834) +++ user/kmacy/head_arpv2/sys/netinet6/in6.c Wed Dec 10 04:07:51 2008 (r185835) @@ -2214,16 +2214,14 @@ in6_lltable_lookup(struct lltable *llt, lle->lle_tbl = llt; lle->lle_head = lleh; LIST_INSERT_HEAD(lleh, lle, lle_next); - } else { - if (flags & LLE_DELETE) { - LLE_WLOCK(lle); - lle->la_flags = LLE_DELETED; - LLE_WUNLOCK(lle); + } else if (flags & LLE_DELETE) { + LLE_WLOCK(lle); + lle->la_flags = LLE_DELETED; + LLE_WUNLOCK(lle); #ifdef INVARIANTS - log(LOG_INFO, "ifaddr cache = %p is deleted\n", lle); -#endif - lle = NULL; - } + log(LOG_INFO, "ifaddr cache = %p is deleted\n", lle); +#endif + lle = NULL; } if (lle) { if (flags & LLE_EXCLUSIVE) From owner-svn-src-user@FreeBSD.ORG Wed Dec 10 04:31:05 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50E85106564A; Wed, 10 Dec 2008 04:31:05 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C8518FC08; Wed, 10 Dec 2008 04:31:05 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBA4V55n016347; Wed, 10 Dec 2008 04:31:05 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBA4V5HT016346; Wed, 10 Dec 2008 04:31:05 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812100431.mBA4V5HT016346@svn.freebsd.org> From: Kip Macy Date: Wed, 10 Dec 2008 04:31:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185836 - user/kmacy/head_arpv2/sys/netinet6 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2008 04:31:05 -0000 Author: kmacy Date: Wed Dec 10 04:31:04 2008 New Revision: 185836 URL: http://svn.freebsd.org/changeset/base/185836 Log: call IF_AFDATA_UNLOCK after lla_lookup Modified: user/kmacy/head_arpv2/sys/netinet6/nd6.c Modified: user/kmacy/head_arpv2/sys/netinet6/nd6.c ============================================================================== --- user/kmacy/head_arpv2/sys/netinet6/nd6.c Wed Dec 10 04:07:51 2008 (r185835) +++ user/kmacy/head_arpv2/sys/netinet6/nd6.c Wed Dec 10 04:31:04 2008 (r185836) @@ -1882,6 +1882,7 @@ nd6_storelladdr(struct ifnet *ifp, struc struct llentry *ln; *lle = NULL; + IF_AFDATA_UNLOCK_ASSERT(ifp); if (m->m_flags & M_MCAST) { int i; @@ -1922,7 +1923,7 @@ nd6_storelladdr(struct ifnet *ifp, struc */ IF_AFDATA_LOCK(ifp); ln = lla_lookup(LLTABLE6(ifp), 0, dst); - IF_AFDATA_LOCK(ifp); + IF_AFDATA_UNLOCK(ifp); if ((ln == NULL) || !(ln->la_flags & LLE_VALID)) { if (ln) LLE_RUNLOCK(ln); From owner-svn-src-user@FreeBSD.ORG Wed Dec 10 05:25:13 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8FEEF106564A; Wed, 10 Dec 2008 05:25:13 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B45B8FC17; Wed, 10 Dec 2008 05:25:13 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBA5PD7v019289; Wed, 10 Dec 2008 05:25:13 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBA5PDsu019288; Wed, 10 Dec 2008 05:25:13 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812100525.mBA5PDsu019288@svn.freebsd.org> From: Kip Macy Date: Wed, 10 Dec 2008 05:25:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185837 - user/kmacy/head_arpv2/sys/netinet6 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2008 05:25:13 -0000 Author: kmacy Date: Wed Dec 10 05:25:13 2008 New Revision: 185837 URL: http://svn.freebsd.org/changeset/base/185837 Log: remove local vinet6.h change Modified: user/kmacy/head_arpv2/sys/netinet6/vinet6.h Modified: user/kmacy/head_arpv2/sys/netinet6/vinet6.h ============================================================================== --- user/kmacy/head_arpv2/sys/netinet6/vinet6.h Wed Dec 10 04:31:04 2008 (r185836) +++ user/kmacy/head_arpv2/sys/netinet6/vinet6.h Wed Dec 10 05:25:13 2008 (r185837) @@ -38,7 +38,6 @@ #include #include -#include #include #include @@ -78,7 +77,6 @@ struct vnet_inet6 { int _nd6_inuse; int _nd6_allocated; - struct llentry _llinfo_nd6; struct nd_drhead _nd_defrouter; struct nd_prhead _nd_prefix; struct ifnet * _nd6_defifp; From owner-svn-src-user@FreeBSD.ORG Wed Dec 10 05:50:07 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBD621065670; Wed, 10 Dec 2008 05:50:07 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B744A8FC18; Wed, 10 Dec 2008 05:50:07 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBA5o7dI019867; Wed, 10 Dec 2008 05:50:07 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBA5o7Q3019866; Wed, 10 Dec 2008 05:50:07 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812100550.mBA5o7Q3019866@svn.freebsd.org> From: Kip Macy Date: Wed, 10 Dec 2008 05:50:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185838 - user/kmacy/head_arpv2/sys/netinet6 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2008 05:50:07 -0000 Author: kmacy Date: Wed Dec 10 05:50:07 2008 New Revision: 185838 URL: http://svn.freebsd.org/changeset/base/185838 Log: inform rtrequest that we already hold the radix node head lock Modified: user/kmacy/head_arpv2/sys/netinet6/in6_rmx.c Modified: user/kmacy/head_arpv2/sys/netinet6/in6_rmx.c ============================================================================== --- user/kmacy/head_arpv2/sys/netinet6/in6_rmx.c Wed Dec 10 05:25:13 2008 (r185837) +++ user/kmacy/head_arpv2/sys/netinet6/in6_rmx.c Wed Dec 10 05:50:07 2008 (r185838) @@ -307,7 +307,7 @@ in6_rtqkill(struct radix_node *rn, void err = rtrequest(RTM_DELETE, (struct sockaddr *)rt_key(rt), rt->rt_gateway, rt_mask(rt), - rt->rt_flags, 0); + rt->rt_flags|RTF_RNH_LOCKED, 0); if (err) { log(LOG_WARNING, "in6_rtqkill: error %d", err); } else { From owner-svn-src-user@FreeBSD.ORG Wed Dec 10 06:17:47 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AF251065673 for ; Wed, 10 Dec 2008 06:17:47 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.231]) by mx1.freebsd.org (Postfix) with ESMTP id 070D38FC12 for ; Wed, 10 Dec 2008 06:17:46 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so270953rvf.43 for ; Tue, 09 Dec 2008 22:17:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=vuST4t7jakwz272Fuj34yXFGnpoliresqzN2xxTJqRU=; b=JewyqDLGDMk/CmY5+1Sf5uqr9Xa3+tXEHLMxBZsPEizZyfc/Fs79FlxJ7rV3bq8U++ Yg3fIN0Lz2DhopDUl7cLV2AdYmv3XEcbUzgzRZV/U6QljHeUuPFBHtkGSNEm1/8q6Jx0 Z6w3Ke/zrZZUMMejHLfMRXifFGlqaQWvvHL4Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=sx2nBTiIU6OY8MXrkI1ZOAZJVmFA5l0mHKgHPeeF+TcnlSR6ED4HPsqk1lCU9LEhbW T4kkhFpAp+tKbHb4dMYetrlCyvTytxCiob6zWVeVQunzayckj5rp369CJT7WBlurdYWw 1xMtrXci0LzYKPOmNzCriG8TcCLRKG9eHEV2g= Received: by 10.140.139.3 with SMTP id m3mr467418rvd.270.1228889866721; Tue, 09 Dec 2008 22:17:46 -0800 (PST) Received: by 10.141.142.3 with HTTP; Tue, 9 Dec 2008 22:17:46 -0800 (PST) Message-ID: <3c1674c90812092217l28103c3boa4bfbbb4b94a070d@mail.gmail.com> Date: Tue, 9 Dec 2008 22:17:46 -0800 From: "Kip Macy" Sender: mat.macy@gmail.com To: "Andrew Gallatin" In-Reply-To: <200812091456.mB9Eudoo093567@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200812091456.mB9Eudoo093567@svn.freebsd.org> X-Google-Sender-Auth: 106c700365cd5a19 Cc: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: Re: svn commit: r185794 - in user/kmacy/HEAD_fast_multi_xmit/sys: net netinet6 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2008 06:17:47 -0000 Thanks for the initiative, I've been busy with ARPv2. -Kip On Tue, Dec 9, 2008 at 6:56 AM, Andrew Gallatin wrote: > Author: gallatin > Date: Tue Dec 9 14:56:39 2008 > New Revision: 185794 > URL: http://svn.freebsd.org/changeset/base/185794 > > Log: > Fix compilation errors by including sys/lock.h prior > to sys/rwlock.h > > Modified: > user/kmacy/HEAD_fast_multi_xmit/sys/net/rtsock.c > user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/in6_rmx.c > user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/nd6_rtr.c > > Modified: user/kmacy/HEAD_fast_multi_xmit/sys/net/rtsock.c > ============================================================================== > --- user/kmacy/HEAD_fast_multi_xmit/sys/net/rtsock.c Tue Dec 9 11:05:59 2008 (r185793) > +++ user/kmacy/HEAD_fast_multi_xmit/sys/net/rtsock.c Tue Dec 9 14:56:39 2008 (r185794) > @@ -43,6 +43,7 @@ > #include > #include > #include > +#include > #include > #include > #include > > Modified: user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/in6_rmx.c > ============================================================================== > --- user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/in6_rmx.c Tue Dec 9 11:05:59 2008 (r185793) > +++ user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/in6_rmx.c Tue Dec 9 14:56:39 2008 (r185794) > @@ -83,6 +83,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > > Modified: user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/nd6_rtr.c > ============================================================================== > --- user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/nd6_rtr.c Tue Dec 9 11:05:59 2008 (r185793) > +++ user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/nd6_rtr.c Tue Dec 9 14:56:39 2008 (r185794) > @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > -- If we desire respect for the law, we must first make the law respectable. - Louis D. Brandeis From owner-svn-src-user@FreeBSD.ORG Wed Dec 10 07:14:53 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 327F21065670; Wed, 10 Dec 2008 07:14:53 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1958B8FC13; Wed, 10 Dec 2008 07:14:53 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBA7Eq6N021666; Wed, 10 Dec 2008 07:14:52 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBA7EqhI021652; Wed, 10 Dec 2008 07:14:52 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812100714.mBA7EqhI021652@svn.freebsd.org> From: Kip Macy Date: Wed, 10 Dec 2008 07:14:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185840 - in user/kmacy/HEAD_fast_multi_xmit: . gnu/usr.bin/cc/libiberty gnu/usr.bin/sort include kerberos5/include lib/bind/bind lib/libarchive lib/libarchive/test lib/libc/stdio lib/l... X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2008 07:14:53 -0000 Author: kmacy Date: Wed Dec 10 07:14:51 2008 New Revision: 185840 URL: http://svn.freebsd.org/changeset/base/185840 Log: IFC 185627:185839 merge latest Added: user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/test/test_compat_bzip2.c user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/test/test_compat_bzip2_1.tbz.uu user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/test/test_compat_bzip2_2.tbz.uu user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/test/test_compat_gzip.c user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/test/test_compat_gzip_1.tgz.uu user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/test/test_compat_gzip_2.tgz.uu user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/test/test_fuzz.c user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/test/test_fuzz_1.iso.uu user/kmacy/HEAD_fast_multi_xmit/lib/libc/string/strndup.c user/kmacy/HEAD_fast_multi_xmit/lib/libutil/kinfo_getfile.3 user/kmacy/HEAD_fast_multi_xmit/lib/libutil/kinfo_getvmmap.3 user/kmacy/HEAD_fast_multi_xmit/share/man/man4/man4.powerpc/pmu.4 user/kmacy/HEAD_fast_multi_xmit/tools/test/pthread_vfork/ user/kmacy/HEAD_fast_multi_xmit/tools/test/pthread_vfork/pthread_vfork_test.c user/kmacy/HEAD_fast_multi_xmit/tools/tools/ath/Makefile.inc user/kmacy/HEAD_fast_multi_xmit/tools/tools/ath/athkey/ user/kmacy/HEAD_fast_multi_xmit/tools/tools/ath/athkey/Makefile user/kmacy/HEAD_fast_multi_xmit/tools/tools/ath/athkey/athkey.c user/kmacy/HEAD_fast_multi_xmit/tools/tools/ath/athpow/ user/kmacy/HEAD_fast_multi_xmit/tools/tools/ath/athpow/Makefile user/kmacy/HEAD_fast_multi_xmit/tools/tools/ath/athpow/athpow.c user/kmacy/HEAD_fast_multi_xmit/tools/tools/ath/athprom/ user/kmacy/HEAD_fast_multi_xmit/tools/tools/ath/athprom/Makefile user/kmacy/HEAD_fast_multi_xmit/tools/tools/ath/athprom/athprom.c user/kmacy/HEAD_fast_multi_xmit/tools/tools/ath/athprom/eeprom-14 user/kmacy/HEAD_fast_multi_xmit/tools/tools/ath/athprom/eeprom-3 user/kmacy/HEAD_fast_multi_xmit/tools/tools/ath/athprom/eeprom-4 user/kmacy/HEAD_fast_multi_xmit/tools/tools/ath/athprom/eeprom-5 user/kmacy/HEAD_fast_multi_xmit/tools/tools/ath/athregs/ user/kmacy/HEAD_fast_multi_xmit/tools/tools/ath/athregs/Makefile user/kmacy/HEAD_fast_multi_xmit/tools/tools/ath/athregs/dumpregs.c user/kmacy/HEAD_fast_multi_xmit/tools/tools/ath/athregs/dumpregs.h user/kmacy/HEAD_fast_multi_xmit/tools/tools/ath/athregs/dumpregs_5210.c user/kmacy/HEAD_fast_multi_xmit/tools/tools/ath/athregs/dumpregs_5211.c user/kmacy/HEAD_fast_multi_xmit/tools/tools/ath/athregs/dumpregs_5212.c user/kmacy/HEAD_fast_multi_xmit/tools/tools/ath/athregs/dumpregs_5416.c user/kmacy/HEAD_fast_multi_xmit/tools/tools/ath/common/ user/kmacy/HEAD_fast_multi_xmit/tools/tools/ath/common/ah_osdep.h user/kmacy/HEAD_fast_multi_xmit/tools/tools/ath/common/diag.h Modified: user/kmacy/HEAD_fast_multi_xmit/UPDATING user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/cc/libiberty/config.h user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/sort/config.h user/kmacy/HEAD_fast_multi_xmit/include/string.h user/kmacy/HEAD_fast_multi_xmit/kerberos5/include/config.h user/kmacy/HEAD_fast_multi_xmit/lib/bind/bind/port_after.h user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive.h user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_check_magic.c user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_endian.h user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_entry.h user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_platform.h user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_private.h user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_read.c user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_read_private.h user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_read_support_compression_all.c user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_read_support_compression_bzip2.c user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_read_support_compression_compress.c user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_read_support_compression_gzip.c user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_read_support_compression_none.c user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_read_support_compression_program.c user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_read_support_format_ar.c user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_read_support_format_cpio.c user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_read_support_format_empty.c user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_read_support_format_iso9660.c user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_read_support_format_mtree.c user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_read_support_format_tar.c user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_read_support_format_zip.c user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_string.c user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_string.h user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_write_disk.c user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/test/Makefile user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/test/main.c user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/test/test_read_format_cpio_bin_bz2.c user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/test/test_read_format_gtar_sparse.c user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/test/test_read_pax_truncated.c user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/test/test_write_disk_perms.c user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/test/test_write_format_cpio.c user/kmacy/HEAD_fast_multi_xmit/lib/libc/stdio/vfprintf.c user/kmacy/HEAD_fast_multi_xmit/lib/libc/string/Makefile.inc user/kmacy/HEAD_fast_multi_xmit/lib/libc/string/Symbol.map user/kmacy/HEAD_fast_multi_xmit/lib/libc/string/strdup.3 user/kmacy/HEAD_fast_multi_xmit/lib/libc/string/strsep.3 user/kmacy/HEAD_fast_multi_xmit/lib/libmagic/config.h user/kmacy/HEAD_fast_multi_xmit/lib/libpmc/pmc.core.3 user/kmacy/HEAD_fast_multi_xmit/lib/libstand/bootp.c user/kmacy/HEAD_fast_multi_xmit/lib/libthr/thread/thr_rtld.c user/kmacy/HEAD_fast_multi_xmit/lib/libutil/Makefile user/kmacy/HEAD_fast_multi_xmit/share/man/man4/man4.powerpc/Makefile user/kmacy/HEAD_fast_multi_xmit/share/man/man7/ports.7 user/kmacy/HEAD_fast_multi_xmit/sys/amd64/amd64/db_trace.c user/kmacy/HEAD_fast_multi_xmit/sys/amd64/amd64/pmap.c user/kmacy/HEAD_fast_multi_xmit/sys/arm/mv/mv_pci.c user/kmacy/HEAD_fast_multi_xmit/sys/arm/mv/orion/std.db88f5xxx user/kmacy/HEAD_fast_multi_xmit/sys/boot/common/loader.8 user/kmacy/HEAD_fast_multi_xmit/sys/boot/forth/support.4th user/kmacy/HEAD_fast_multi_xmit/sys/boot/i386/boot0/boot0.S user/kmacy/HEAD_fast_multi_xmit/sys/boot/i386/btx/btxldr/btxldr.S user/kmacy/HEAD_fast_multi_xmit/sys/boot/zfs/Makefile user/kmacy/HEAD_fast_multi_xmit/sys/compat/linprocfs/linprocfs.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/adb/adb.h user/kmacy/HEAD_fast_multi_xmit/sys/dev/adb/adb_bus.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/adb/adb_kbd.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/adb/adb_mouse.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/adb/adbvar.h user/kmacy/HEAD_fast_multi_xmit/sys/dev/ae/if_ae.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/ath/if_ath.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/ath/if_athvar.h user/kmacy/HEAD_fast_multi_xmit/sys/dev/bge/if_bge.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/cxgb/common/cxgb_t3_hw.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/cxgb/cxgb_main.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/dc/if_dc.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/dc/if_dcreg.h user/kmacy/HEAD_fast_multi_xmit/sys/dev/e1000/if_em.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/fxp/if_fxp.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/mmc/mmc.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/mmc/mmcsd.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/pccbb/pccbb.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/pccbb/pccbb_pci.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/re/if_re.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/sdhci/sdhci.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/sis/if_sis.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/sis/if_sisreg.h user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb/if_ural.c user/kmacy/HEAD_fast_multi_xmit/sys/fs/procfs/procfs_map.c user/kmacy/HEAD_fast_multi_xmit/sys/geom/geom_subr.c user/kmacy/HEAD_fast_multi_xmit/sys/geom/journal/g_journal.c user/kmacy/HEAD_fast_multi_xmit/sys/geom/journal/g_journal.h user/kmacy/HEAD_fast_multi_xmit/sys/i386/include/atomic.h user/kmacy/HEAD_fast_multi_xmit/sys/kern/kern_exec.c user/kmacy/HEAD_fast_multi_xmit/sys/kern/kern_exit.c user/kmacy/HEAD_fast_multi_xmit/sys/kern/kern_fork.c user/kmacy/HEAD_fast_multi_xmit/sys/kern/kern_linker.c user/kmacy/HEAD_fast_multi_xmit/sys/kern/kern_module.c user/kmacy/HEAD_fast_multi_xmit/sys/kern/kern_proc.c user/kmacy/HEAD_fast_multi_xmit/sys/kern/kern_rwlock.c user/kmacy/HEAD_fast_multi_xmit/sys/kern/subr_param.c user/kmacy/HEAD_fast_multi_xmit/sys/libkern/iconv.c user/kmacy/HEAD_fast_multi_xmit/sys/net/if.c user/kmacy/HEAD_fast_multi_xmit/sys/net/route.c user/kmacy/HEAD_fast_multi_xmit/sys/net/rtsock.c user/kmacy/HEAD_fast_multi_xmit/sys/netgraph/ng_mppc.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/if_ether.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/in_pcb.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/in_pcb.h user/kmacy/HEAD_fast_multi_xmit/sys/netinet/ip_carp.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/sctp.h user/kmacy/HEAD_fast_multi_xmit/sys/netinet/sctp_asconf.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/sctp_asconf.h user/kmacy/HEAD_fast_multi_xmit/sys/netinet/sctp_auth.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/sctp_auth.h user/kmacy/HEAD_fast_multi_xmit/sys/netinet/sctp_constants.h user/kmacy/HEAD_fast_multi_xmit/sys/netinet/sctp_header.h user/kmacy/HEAD_fast_multi_xmit/sys/netinet/sctp_indata.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/sctp_indata.h user/kmacy/HEAD_fast_multi_xmit/sys/netinet/sctp_input.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/sctp_os_bsd.h user/kmacy/HEAD_fast_multi_xmit/sys/netinet/sctp_output.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/sctp_output.h user/kmacy/HEAD_fast_multi_xmit/sys/netinet/sctp_pcb.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/sctp_pcb.h user/kmacy/HEAD_fast_multi_xmit/sys/netinet/sctp_structs.h user/kmacy/HEAD_fast_multi_xmit/sys/netinet/sctp_sysctl.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/sctp_sysctl.h user/kmacy/HEAD_fast_multi_xmit/sys/netinet/sctp_timer.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/sctp_uio.h user/kmacy/HEAD_fast_multi_xmit/sys/netinet/sctp_usrreq.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/sctp_var.h user/kmacy/HEAD_fast_multi_xmit/sys/netinet/sctputil.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/sctputil.h user/kmacy/HEAD_fast_multi_xmit/sys/netinet/tcp_input.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/in6_rmx.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/nd6_rtr.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/sctp6_usrreq.c user/kmacy/HEAD_fast_multi_xmit/sys/pci/if_rlreg.h user/kmacy/HEAD_fast_multi_xmit/sys/powerpc/conf/NOTES user/kmacy/HEAD_fast_multi_xmit/sys/powerpc/powermac/cuda.c user/kmacy/HEAD_fast_multi_xmit/sys/powerpc/powermac/cudavar.h user/kmacy/HEAD_fast_multi_xmit/sys/powerpc/powermac/macgpio.c user/kmacy/HEAD_fast_multi_xmit/sys/powerpc/powermac/macgpiovar.h user/kmacy/HEAD_fast_multi_xmit/sys/powerpc/powermac/pmu.c user/kmacy/HEAD_fast_multi_xmit/sys/powerpc/powermac/pmuvar.h user/kmacy/HEAD_fast_multi_xmit/sys/sys/module.h user/kmacy/HEAD_fast_multi_xmit/sys/sys/proc.h user/kmacy/HEAD_fast_multi_xmit/sys/sys/rwlock.h user/kmacy/HEAD_fast_multi_xmit/sys/ufs/ufs/ufs_quota.c user/kmacy/HEAD_fast_multi_xmit/tools/tools/ath/Makefile user/kmacy/HEAD_fast_multi_xmit/tools/tools/ath/athdebug/Makefile user/kmacy/HEAD_fast_multi_xmit/tools/tools/ath/athstats/Makefile user/kmacy/HEAD_fast_multi_xmit/usr.bin/cpio/Makefile user/kmacy/HEAD_fast_multi_xmit/usr.bin/cpio/cmdline.c user/kmacy/HEAD_fast_multi_xmit/usr.bin/cpio/config_freebsd.h user/kmacy/HEAD_fast_multi_xmit/usr.bin/cpio/cpio.c user/kmacy/HEAD_fast_multi_xmit/usr.bin/cpio/cpio.h user/kmacy/HEAD_fast_multi_xmit/usr.bin/cpio/cpio_platform.h user/kmacy/HEAD_fast_multi_xmit/usr.bin/file/config.h user/kmacy/HEAD_fast_multi_xmit/usr.bin/fstat/Makefile user/kmacy/HEAD_fast_multi_xmit/usr.bin/fstat/fstat.c user/kmacy/HEAD_fast_multi_xmit/usr.bin/tar/Makefile user/kmacy/HEAD_fast_multi_xmit/usr.bin/tar/bsdtar.1 user/kmacy/HEAD_fast_multi_xmit/usr.bin/tar/bsdtar.h user/kmacy/HEAD_fast_multi_xmit/usr.bin/tar/bsdtar_platform.h user/kmacy/HEAD_fast_multi_xmit/usr.bin/wc/wc.1 user/kmacy/HEAD_fast_multi_xmit/usr.bin/wc/wc.c user/kmacy/HEAD_fast_multi_xmit/usr.sbin/fifolog/lib/fifolog_int.c user/kmacy/HEAD_fast_multi_xmit/usr.sbin/fifolog/lib/fifolog_reader.c user/kmacy/HEAD_fast_multi_xmit/usr.sbin/syslogd/syslogd.8 Modified: user/kmacy/HEAD_fast_multi_xmit/UPDATING ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/UPDATING Wed Dec 10 06:01:27 2008 (r185839) +++ user/kmacy/HEAD_fast_multi_xmit/UPDATING Wed Dec 10 07:14:51 2008 (r185840) @@ -38,11 +38,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. and thereby the code size); consult ath_hal(4) for details. 20081121: - __FreeBSD_version 800054 adds memory barriers to - , new interfaces to ifnet to facilitate + __FreeBSD_version 800054 adds memory barriers to + , new interfaces to ifnet to facilitate multiple hardware transmit queues for cards that support them, and a lock-less ring-buffer implementation to - enable drivers to more efficiently manage queueing of + enable drivers to more efficiently manage queueing of packets. 20081117: @@ -287,11 +287,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. be recompiled; this includes the hal and xorg-server ports. 20070928: - The caching daemon (cached) was renamed to nscd. nscd.conf - configuration file should be used instead of cached.conf and - nscd_enable, nscd_pidfile and nscd_flags options should be used - instead of cached_enable, cached_pidfile and cached_flags in - rc.conf. + The caching daemon (cached) was renamed to nscd. nscd.conf + configuration file should be used instead of cached.conf and + nscd_enable, nscd_pidfile and nscd_flags options should be used + instead of cached_enable, cached_pidfile and cached_flags in + rc.conf. 20070921: The getfacl(1) utility now prints owning user and group name @@ -299,7 +299,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. This is the same behavior as getfacl(1) on Solaris and Linux. 20070704: - The new IPsec code is now compiled in using the IPSEC option. The + The new IPsec code is now compiled in using the IPSEC option. The IPSEC option now requires "device crypto" be defined in your kernel configuration. The FAST_IPSEC kernel option is now deprecated. @@ -602,10 +602,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. If you have such a file, you need old utility to decrypt it. 20060709: - The interface version of the i4b kernel part has changed. So - after updating the kernel sources and compiling a new kernel, - the i4b user space tools in "/usr/src/usr.sbin/i4b" must also - be rebuilt, and vice versa. + The interface version of the i4b kernel part has changed. So + after updating the kernel sources and compiling a new kernel, + the i4b user space tools in "/usr/src/usr.sbin/i4b" must also + be rebuilt, and vice versa. 20060627: The XBOX kernel now defaults to the nfe(4) driver instead of @@ -1071,7 +1071,7 @@ COMMON ITEMS: - + To upgrade in-place from 5.x-stable to current Modified: user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/cc/libiberty/config.h ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/cc/libiberty/config.h Wed Dec 10 06:01:27 2008 (r185839) +++ user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/cc/libiberty/config.h Wed Dec 10 07:14:51 2008 (r185840) @@ -235,7 +235,7 @@ #define HAVE_STRNCASECMP 1 /* Define to 1 if you have the `strndup' function. */ -/* #undef HAVE_STRNDUP */ +#define HAVE_STRNDUP 1 /* Define to 1 if you have the `strrchr' function. */ #define HAVE_STRRCHR 1 Modified: user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/sort/config.h ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/sort/config.h Wed Dec 10 06:01:27 2008 (r185839) +++ user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/sort/config.h Wed Dec 10 07:14:51 2008 (r185840) @@ -759,7 +759,7 @@ #define HAVE_STRNCASECMP 1 /* Define to 1 if you have the `strndup' function. */ -/* #undef HAVE_STRNDUP */ +#define HAVE_STRNDUP 1 /* Define to 1 if you have the `strpbrk' function. */ #define HAVE_STRPBRK 1 Modified: user/kmacy/HEAD_fast_multi_xmit/include/string.h ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/include/string.h Wed Dec 10 06:01:27 2008 (r185839) +++ user/kmacy/HEAD_fast_multi_xmit/include/string.h Wed Dec 10 07:14:51 2008 (r185840) @@ -96,6 +96,7 @@ char *strncat(char * __restrict, const c int strncmp(const char *, const char *, size_t) __pure; char *strncpy(char * __restrict, const char * __restrict, size_t); #if __BSD_VISIBLE +char *strndup(const char *, size_t); char *strnstr(const char *, const char *, size_t) __pure; #endif char *strpbrk(const char *, const char *) __pure; Modified: user/kmacy/HEAD_fast_multi_xmit/kerberos5/include/config.h ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/kerberos5/include/config.h Wed Dec 10 06:01:27 2008 (r185839) +++ user/kmacy/HEAD_fast_multi_xmit/kerberos5/include/config.h Wed Dec 10 07:14:51 2008 (r185840) @@ -785,7 +785,7 @@ static /**/const char *const rcsid[] = { #define HAVE_STRNCASECMP 1 /* Define if you have the function `strndup'. */ -/* #undef HAVE_STRNDUP */ +#define HAVE_STRNDUP 1 /* Define if you have the function `strnlen'. */ /* #undef HAVE_STRNLEN */ Modified: user/kmacy/HEAD_fast_multi_xmit/lib/bind/bind/port_after.h ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/lib/bind/bind/port_after.h Wed Dec 10 06:01:27 2008 (r185839) +++ user/kmacy/HEAD_fast_multi_xmit/lib/bind/bind/port_after.h Wed Dec 10 07:14:51 2008 (r185840) @@ -30,7 +30,7 @@ #undef HAS_IN_ADDR6 #define HAVE_SOCKADDR_STORAGE 1 #undef NEED_GETTIMEOFDAY -#undef HAVE_STRNDUP +#define HAVE_STRNDUP 1 #undef USE_FIONBIO_IOCTL #undef USE_SYSERROR_LIST #undef INNETGR_ARGS Modified: user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive.h ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive.h Wed Dec 10 06:01:27 2008 (r185839) +++ user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive.h Wed Dec 10 07:14:51 2008 (r185840) @@ -82,7 +82,6 @@ # define __LA_DECL #endif - #ifdef __cplusplus extern "C" { #endif @@ -114,13 +113,13 @@ extern "C" { * (ARCHIVE_API_VERSION * 1000000 + ARCHIVE_API_FEATURE * 1000) * #endif */ -#define ARCHIVE_VERSION_NUMBER 2005005 +#define ARCHIVE_VERSION_NUMBER 2005903 __LA_DECL int archive_version_number(void); /* * Textual name/version of the library, useful for version displays. */ -#define ARCHIVE_VERSION_STRING "libarchive 2.5.5" +#define ARCHIVE_VERSION_STRING "libarchive 2.5.903a" __LA_DECL const char * archive_version_string(void); #if ARCHIVE_VERSION_NUMBER < 3000000 @@ -185,20 +184,37 @@ struct archive_entry; */ /* Returns pointer and size of next block of data from archive. */ -typedef __LA_SSIZE_T archive_read_callback(struct archive *, void *_client_data, - const void **_buffer); +typedef __LA_SSIZE_T archive_read_callback(struct archive *, + void *_client_data, const void **_buffer); + /* Skips at most request bytes from archive and returns the skipped amount */ #if ARCHIVE_VERSION_NUMBER < 2000000 -typedef __LA_SSIZE_T archive_skip_callback(struct archive *, void *_client_data, - size_t request); +/* Libarchive 1.0 used ssize_t for the return, which is only 32 bits + * on most 32-bit platforms; not large enough. */ +typedef __LA_SSIZE_T archive_skip_callback(struct archive *, + void *_client_data, size_t request); +#elif ARCHIVE_VERSION_NUMBER < 3000000 +/* Libarchive 2.0 used off_t here, but that is a bad idea on Linux and a + * few other platforms where off_t varies with build settings. */ +typedef off_t archive_skip_callback(struct archive *, + void *_client_data, off_t request); #else -typedef off_t archive_skip_callback(struct archive *, void *_client_data, - off_t request); +/* Libarchive 3.0 uses int64_t here, which is actually guaranteed to be + * 64 bits on every platform. */ +typedef __LA_INT64_T archive_skip_callback(struct archive *, + void *_client_data, __LA_INT64_T request); #endif + /* Returns size actually written, zero on EOF, -1 on error. */ -typedef __LA_SSIZE_T archive_write_callback(struct archive *, void *_client_data, - const void *_buffer, size_t _length); +typedef __LA_SSIZE_T archive_write_callback(struct archive *, + void *_client_data, + const void *_buffer, size_t _length); + +#if ARCHIVE_VERSION_NUMBER < 3000000 +/* Open callback is actually never needed; remove it in libarchive 3.0. */ typedef int archive_open_callback(struct archive *, void *_client_data); +#endif + typedef int archive_close_callback(struct archive *, void *_client_data); /* @@ -209,6 +225,7 @@ typedef int archive_close_callback(struc #define ARCHIVE_COMPRESSION_BZIP2 2 #define ARCHIVE_COMPRESSION_COMPRESS 3 #define ARCHIVE_COMPRESSION_PROGRAM 4 +#define ARCHIVE_COMPRESSION_LZMA 5 /* * Codes returned by archive_format. @@ -333,15 +350,23 @@ __LA_DECL int archive_read_next_header __LA_DECL __LA_INT64_T archive_read_header_position(struct archive *); /* Read data from the body of an entry. Similar to read(2). */ -__LA_DECL __LA_SSIZE_T archive_read_data(struct archive *, void *, size_t); +__LA_DECL __LA_SSIZE_T archive_read_data(struct archive *, + void *, size_t); + /* * A zero-copy version of archive_read_data that also exposes the file offset * of each returned block. Note that the client has no way to specify * the desired size of the block. The API does guarantee that offsets will * be strictly increasing and that returned blocks will not overlap. */ +#if ARCHIVE_VERSION_NUMBER < 3000000 +__LA_DECL int archive_read_data_block(struct archive *a, + const void **buff, size_t *size, off_t *offset); +#else __LA_DECL int archive_read_data_block(struct archive *a, - const void **buff, size_t *size, off_t *offset); + const void **buff, size_t *size, + __LA_INT64_T *offset); +#endif /*- * Some convenience functions that are built on archive_read_data: @@ -350,8 +375,8 @@ __LA_DECL int archive_read_data_block( * 'into_fd': writes data to specified filedes */ __LA_DECL int archive_read_data_skip(struct archive *); -__LA_DECL int archive_read_data_into_buffer(struct archive *, void *buffer, - __LA_SSIZE_T len); +__LA_DECL int archive_read_data_into_buffer(struct archive *, + void *buffer, __LA_SSIZE_T len); __LA_DECL int archive_read_data_into_fd(struct archive *, int fd); /*- @@ -414,12 +439,11 @@ __LA_DECL void archive_read_extract_set __LA_DECL int archive_read_close(struct archive *); /* Release all resources and destroy the object. */ /* Note that archive_read_finish will call archive_read_close for you. */ -#if ARCHIVE_VERSION_NUMBER >= 2000000 -__LA_DECL int archive_read_finish(struct archive *); -#else -/* Temporarily allow library to compile with either 1.x or 2.0 API. */ +#if ARCHIVE_VERSION_NUMBER < 2000000 /* Erroneously declared to return void in libarchive 1.x */ __LA_DECL void archive_read_finish(struct archive *); +#else +__LA_DECL int archive_read_finish(struct archive *); #endif /*- @@ -491,22 +515,36 @@ __LA_DECL int archive_write_open_memor */ __LA_DECL int archive_write_header(struct archive *, struct archive_entry *); -#if ARCHIVE_VERSION_NUMBER >= 2000000 -__LA_DECL __LA_SSIZE_T archive_write_data(struct archive *, const void *, size_t); -#else -/* Temporarily allow library to compile with either 1.x or 2.0 API. */ +#if ARCHIVE_VERSION_NUMBER < 2000000 /* This was erroneously declared to return "int" in libarchive 1.x. */ -__LA_DECL int archive_write_data(struct archive *, const void *, size_t); +__LA_DECL int archive_write_data(struct archive *, + const void *, size_t); +#else +/* Libarchive 2.0 and later return ssize_t here. */ +__LA_DECL __LA_SSIZE_T archive_write_data(struct archive *, + const void *, size_t); +#endif + +#if ARCHIVE_VERSION_NUMBER < 3000000 +/* Libarchive 1.x and 2.x use off_t for the argument, but that's not + * stable on Linux. */ +__LA_DECL __LA_SSIZE_T archive_write_data_block(struct archive *, + const void *, size_t, off_t); +#else +/* Libarchive 3.0 uses explicit int64_t to ensure consistent 64-bit support. */ +__LA_DECL __LA_SSIZE_T archive_write_data_block(struct archive *, + const void *, size_t, __LA_INT64_T); #endif -__LA_DECL __LA_SSIZE_T archive_write_data_block(struct archive *, const void *, size_t, off_t); __LA_DECL int archive_write_finish_entry(struct archive *); __LA_DECL int archive_write_close(struct archive *); -#if ARCHIVE_VERSION_NUMBER >= 2000000 -__LA_DECL int archive_write_finish(struct archive *); -#else -/* Temporarily allow library to compile with either 1.x or 2.0 API. */ +#if ARCHIVE_VERSION_NUMBER < 2000000 /* Return value was incorrect in libarchive 1.x. */ __LA_DECL void archive_write_finish(struct archive *); +#else +/* Libarchive 2.x and later returns an error if this fails. */ +/* It can fail if the archive wasn't already closed, in which case + * archive_write_finish() will implicitly call archive_write_close(). */ +__LA_DECL int archive_write_finish(struct archive *); #endif /*- @@ -589,5 +627,9 @@ __LA_DECL void archive_copy_error(stru /* This is meaningless outside of this header. */ #undef __LA_DECL +#undef __LA_GID_T +#undef __LA_INT64_T +#undef __LA_SSIZE_T +#undef __LA_UID_T #endif /* !ARCHIVE_H_INCLUDED */ Modified: user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_check_magic.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_check_magic.c Wed Dec 10 06:01:27 2008 (r185839) +++ user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_check_magic.c Wed Dec 10 07:14:51 2008 (r185840) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); static void errmsg(const char *m) { - write(STDERR_FILENO, m, strlen(m)); + write(2, m, strlen(m)); } static void Modified: user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_endian.h ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_endian.h Wed Dec 10 06:01:27 2008 (r185839) +++ user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_endian.h Wed Dec 10 07:14:51 2008 (r185840) @@ -35,14 +35,14 @@ #define ARCHIVE_ENDIAN_H_INCLUDED -/* Watcom C++ doesn't support 'inline' in C code. (For any version?) */ -#if defined( __WATCOMC__ ) - #define inline -#endif - -/* Visual C++ 6.0 doesn't support 'inline' in C code. (Does VC7? VC8?) */ -#if defined(_MSC_VER) - #define inline +/* + * Disabling inline keyword for compilers known to choke on it: + * - Watcom C++ in C code. (For any version?) + * - SGI MIPSpro + * - Microsoft Visual C++ 6.0 (supposedly newer versions too) + */ +#if defined(__WATCOMC__) || defined(__sgi) || defined(_MSC_VER) +#define inline #endif /* Alignment-agnostic encode/decode bytestream to/from little/big endian. */ Modified: user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_entry.h ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_entry.h Wed Dec 10 06:01:27 2008 (r185839) +++ user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_entry.h Wed Dec 10 07:14:51 2008 (r185840) @@ -441,7 +441,7 @@ __LA_DECL int archive_entry_xattr_next(s * Note that archive_entry_size() is reset to zero if the file * body should not be written to the archive. Pay attention! */ -__LA_DECL struct archive_entry_linkresolver; +struct archive_entry_linkresolver; /* * There are three different strategies for marking hardlinks. Modified: user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_platform.h ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_platform.h Wed Dec 10 06:01:27 2008 (r185839) +++ user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_platform.h Wed Dec 10 07:14:51 2008 (r185840) @@ -39,10 +39,7 @@ /* archive.h and archive_entry.h require this. */ #define __LIBARCHIVE_BUILD 1 -#ifdef _WIN32 -#include "config_windows.h" -#include "archive_windows.h" -#elif defined(PLATFORM_CONFIG_H) +#if defined(PLATFORM_CONFIG_H) /* Use hand-built config.h in environments that need it. */ #include PLATFORM_CONFIG_H #elif defined(HAVE_CONFIG_H) Modified: user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_private.h ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_private.h Wed Dec 10 06:01:27 2008 (r185839) +++ user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_private.h Wed Dec 10 07:14:51 2008 (r185840) @@ -31,15 +31,22 @@ #include "archive.h" #include "archive_string.h" +#if defined(__GNUC__) && (__GNUC__ > 2 || \ + (__GNUC__ == 2 && __GNUC_MINOR__ >= 5)) +#define __LA_DEAD __attribute__((__noreturn__)) +#else +#define __LA_DEAD +#endif + #define ARCHIVE_WRITE_MAGIC (0xb0c5c0deU) #define ARCHIVE_READ_MAGIC (0xdeb0c5U) -#define ARCHIVE_WRITE_DISK_MAGIC (0xc001b0c5U) +#define ARCHIVE_WRITE_DISK_MAGIC (0xc001b0c5U) #define ARCHIVE_STATE_ANY 0xFFFFU #define ARCHIVE_STATE_NEW 1U #define ARCHIVE_STATE_HEADER 2U #define ARCHIVE_STATE_DATA 4U -#define ARCHIVE_STATE_DATA_END 8U +#define ARCHIVE_STATE_DATA_END 8U #define ARCHIVE_STATE_EOF 0x10U #define ARCHIVE_STATE_CLOSED 0x20U #define ARCHIVE_STATE_FATAL 0x8000U @@ -92,7 +99,7 @@ struct archive { void __archive_check_magic(struct archive *, unsigned int magic, unsigned int state, const char *func); -void __archive_errx(int retvalue, const char *msg) __dead2; +void __archive_errx(int retvalue, const char *msg) __LA_DEAD; #define err_combine(a,b) ((a) < (b) ? (a) : (b)) Modified: user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_read.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_read.c Wed Dec 10 06:01:27 2008 (r185839) +++ user/kmacy/HEAD_fast_multi_xmit/lib/libarchive/archive_read.c Wed Dec 10 07:14:51 2008 (r185840) @@ -53,9 +53,10 @@ __FBSDID("$FreeBSD$"); #include "archive_private.h" #include "archive_read_private.h" -static void choose_decompressor(struct archive_read *, const void*, size_t); +#define minimum(a, b) (a < b ? a : b) + +static int build_stream(struct archive_read *); static int choose_format(struct archive_read *); -static off_t dummy_skip(struct archive_read *, off_t); /* * Allocate, initialize and return a struct archive object. @@ -74,8 +75,15 @@ archive_read_new(void) a->archive.state = ARCHIVE_STATE_NEW; a->entry = archive_entry_new(); - /* We always support uncompressed archives. */ - archive_read_support_compression_none(&a->archive); + /* Initialize reblocking logic. */ + a->buffer_size = 64 * 1024; /* 64k */ + a->buffer = (char *)malloc(a->buffer_size); + a->next = a->buffer; + if (a->buffer == NULL) { + archive_entry_free(a->entry); + free(a); + return (NULL); + } return (&a->archive); } @@ -108,6 +116,33 @@ archive_read_open(struct archive *a, voi client_reader, NULL, client_closer); } +static ssize_t +client_read_proxy(struct archive_read_source *self, const void **buff) +{ + return (self->archive->client.reader)((struct archive *)self->archive, + self->data, buff); +} + +static int64_t +client_skip_proxy(struct archive_read_source *self, int64_t request) +{ + return (self->archive->client.skipper)((struct archive *)self->archive, + self->data, request); +} + +static int +client_close_proxy(struct archive_read_source *self) +{ + int r = ARCHIVE_OK; + + if (self->archive->client.closer != NULL) + r = (self->archive->client.closer)((struct archive *)self->archive, + self->data); + free(self); + return (r); +} + + int archive_read_open2(struct archive *_a, void *client_data, archive_open_callback *client_opener, @@ -116,28 +151,15 @@ archive_read_open2(struct archive *_a, v archive_close_callback *client_closer) { struct archive_read *a = (struct archive_read *)_a; - const void *buffer; - ssize_t bytes_read; int e; - __archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW, "archive_read_open"); + __archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW, + "archive_read_open"); if (client_reader == NULL) __archive_errx(1, "No reader function provided to archive_read_open"); - /* - * Set these NULL initially. If the open or initial read fails, - * we'll leave them NULL to indicate that the file is invalid. - * (In particular, this helps ensure that the closer doesn't - * get called more than once.) - */ - a->client_opener = NULL; - a->client_reader = NULL; - a->client_skipper = NULL; - a->client_closer = NULL; - a->client_data = NULL; - /* Open data source. */ if (client_opener != NULL) { e =(client_opener)(&a->archive, client_data); @@ -149,129 +171,103 @@ archive_read_open2(struct archive *_a, v } } - /* Read first block now for compress format detection. */ - bytes_read = (client_reader)(&a->archive, client_data, &buffer); - - if (bytes_read < 0) { - /* If the first read fails, close before returning error. */ - if (client_closer) - (client_closer)(&a->archive, client_data); - /* client_reader should have already set error information. */ - return (ARCHIVE_FATAL); - } + /* Save the client functions and mock up the initial source. */ + a->client.opener = client_opener; /* Do we need to remember this? */ + a->client.reader = client_reader; + a->client.skipper = client_skipper; + a->client.closer = client_closer; + a->client.data = client_data; - /* Now that the client callbacks have worked, remember them. */ - a->client_opener = client_opener; /* Do we need to remember this? */ - a->client_reader = client_reader; - a->client_skipper = client_skipper; - a->client_closer = client_closer; - a->client_data = client_data; - - /* Select a decompression routine. */ - choose_decompressor(a, buffer, (size_t)bytes_read); - if (a->decompressor == NULL) - return (ARCHIVE_FATAL); + { + struct archive_read_source *source; - /* Initialize decompression routine with the first block of data. */ - e = (a->decompressor->init)(a, buffer, (size_t)bytes_read); + source = calloc(1, sizeof(*source)); + if (source == NULL) + return (ARCHIVE_FATAL); + source->reader = NULL; + source->upstream = NULL; + source->archive = a; + source->data = client_data; + source->read = client_read_proxy; + source->skip = client_skip_proxy; + source->close = client_close_proxy; + a->source = source; + } + + /* In case there's no filter. */ + a->archive.compression_code = ARCHIVE_COMPRESSION_NONE; + a->archive.compression_name = "none"; + /* Build out the input pipeline. */ + e = build_stream(a); if (e == ARCHIVE_OK) a->archive.state = ARCHIVE_STATE_HEADER; - /* - * If the decompressor didn't register a skip function, provide a - * dummy compression-layer skip function. - */ - if (a->decompressor->skip == NULL) - a->decompressor->skip = dummy_skip; - return (e); } /* - * Allow each registered decompression routine to bid on whether it - * wants to handle this stream. Return index of winning bidder. + * Allow each registered stream transform to bid on whether + * it wants to handle this stream. Repeat until we've finished + * building the pipeline. */ -static void -choose_decompressor(struct archive_read *a, - const void *buffer, size_t bytes_read) +static int +build_stream(struct archive_read *a) { - int decompression_slots, i, bid, best_bid; - struct decompressor_t *decompressor, *best_decompressor; + int number_readers, i, bid, best_bid; + struct archive_reader *reader, *best_reader; + struct archive_read_source *source; + const void *block; + ssize_t bytes_read; - decompression_slots = sizeof(a->decompressors) / - sizeof(a->decompressors[0]); + /* Read first block now for compress format detection. */ + bytes_read = (a->source->read)(a->source, &block); + if (bytes_read < 0) { + /* If the first read fails, close before returning error. */ + if (a->source->close != NULL) { + (a->source->close)(a->source); + a->source = NULL; + } + /* source->read should have already set error information. */ + return (ARCHIVE_FATAL); + } + + number_readers = sizeof(a->readers) / sizeof(a->readers[0]); best_bid = 0; - a->decompressor = NULL; - best_decompressor = NULL; + best_reader = NULL; - decompressor = a->decompressors; - for (i = 0; i < decompression_slots; i++) { - if (decompressor->bid) { - bid = (decompressor->bid)(buffer, bytes_read); - if (bid > best_bid || best_decompressor == NULL) { + reader = a->readers; + for (i = 0, reader = a->readers; i < number_readers; i++, reader++) { + if (reader->bid != NULL) { + bid = (reader->bid)(reader, block, bytes_read); + if (bid > best_bid) { best_bid = bid; - best_decompressor = decompressor; + best_reader = reader; } } - decompressor ++; } /* - * There were no bidders; this is a serious programmer error - * and demands a quick and definitive abort. - */ - if (best_decompressor == NULL) - __archive_errx(1, "No decompressors were registered; you " - "must call at least one " - "archive_read_support_compression_XXX function in order " - "to successfully read an archive."); - - /* - * There were bidders, but no non-zero bids; this means we can't - * support this stream. + * If we have a winner, it becomes the next stage in the pipeline. */ - if (best_bid < 1) { - archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, - "Unrecognized archive format"); - return; - } - - /* Record the best decompressor for this stream. */ - a->decompressor = best_decompressor; -} - -/* - * Dummy skip function, for use if the compression layer doesn't provide - * one: This code just reads data and discards it. - */ -static off_t -dummy_skip(struct archive_read * a, off_t request) -{ - const void * dummy_buffer; - ssize_t bytes_read; - off_t bytes_skipped; - - for (bytes_skipped = 0; request > 0;) { - bytes_read = (a->decompressor->read_ahead)(a, &dummy_buffer, 1); - if (bytes_read < 0) - return (bytes_read); - if (bytes_read == 0) { - /* Premature EOF. */ - archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, - "Truncated input file (need to skip %jd bytes)", - (intmax_t)request); + if (best_reader != NULL) { + source = (best_reader->init)(a, best_reader, a->source, + block, bytes_read); + if (source == NULL) return (ARCHIVE_FATAL); - } - if (bytes_read > request) - bytes_read = (ssize_t)request; - (a->decompressor->consume)(a, (size_t)bytes_read); - request -= bytes_read; - bytes_skipped += bytes_read; + /* Record the best decompressor for this stream. */ + a->source = source; + /* Recurse to get next pipeline stage. */ + return (build_stream(a)); } - return (bytes_skipped); + /* Save first block of data. */ + a->client_buff = block; + a->client_total = bytes_read; + a->client_next = a->client_buff; + a->client_avail = a->client_total; + return (ARCHIVE_OK); } /* @@ -598,23 +594,24 @@ archive_read_close(struct archive *_a) /* TODO: Clean up the formatters. */ - /* Clean up the decompressors. */ - n = sizeof(a->decompressors)/sizeof(a->decompressors[0]); + /* Clean up the stream pipeline. */ + if (a->source != NULL) { + r1 = (a->source->close)(a->source); + if (r1 < r) + r = r1; + a->source = NULL; + } + + /* Release the reader objects. */ + n = sizeof(a->readers)/sizeof(a->readers[0]); for (i = 0; i < n; i++) { - if (a->decompressors[i].finish != NULL) { - r1 = (a->decompressors[i].finish)(a); + if (a->readers[i].free != NULL) { + r1 = (a->readers[i].free)(&a->readers[i]); if (r1 < r) r = r1; } } - /* Close the client stream. */ - if (a->client_closer != NULL) { - r1 = ((a->client_closer)(&a->archive, a->client_data)); - if (r1 < r) - r = r1; - } - return (r); } @@ -651,6 +648,7 @@ archive_read_finish(struct archive *_a) if (a->entry) archive_entry_free(a->entry); a->archive.magic = 0; + free(a->buffer); free(a); #if ARCHIVE_API_VERSION > 1 return (r); @@ -700,40 +698,350 @@ __archive_read_register_format(struct ar * Used internally by decompression routines to register their bid and * initialization functions. */ -struct decompressor_t * -__archive_read_register_compression(struct archive_read *a, - int (*bid)(const void *, size_t), - int (*init)(struct archive_read *, const void *, size_t)) +struct archive_reader * +__archive_read_get_reader(struct archive_read *a) { int i, number_slots; __archive_check_magic(&a->archive, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW, - "__archive_read_register_compression"); + "__archive_read_get_reader"); - number_slots = sizeof(a->decompressors) / sizeof(a->decompressors[0]); + number_slots = sizeof(a->readers) / sizeof(a->readers[0]); for (i = 0; i < number_slots; i++) { - if (a->decompressors[i].bid == bid) - return (a->decompressors + i); - if (a->decompressors[i].bid == NULL) { - a->decompressors[i].bid = bid; - a->decompressors[i].init = init; - return (a->decompressors + i); - } + if (a->readers[i].bid == NULL) + return (a->readers + i); } __archive_errx(1, "Not enough slots for compression registration"); return (NULL); /* Never actually executed. */ } -/* used internally to simplify read-ahead */ +/* + * The next three functions comprise the peek/consume internal I/O + * system used by archive format readers. This system allows fairly + * flexible read-ahead and allows the I/O code to operate in a + * zero-copy manner most of the time. + * + * In the ideal case, block providers give the I/O code blocks of data + * and __archive_read_ahead() just returns pointers directly into + * those blocks. Then __archive_read_consume() just bumps those + * pointers. Only if your request would span blocks does the I/O + * layer use a copy buffer to provide you with a contiguous block of + * data. The __archive_read_skip() is an optimization; it scans ahead + * very quickly (it usually translates into a seek() operation if + * you're reading uncompressed disk files). + * + * A couple of useful idioms: + * * "I just want some data." Ask for 1 byte and pay attention to + * the "number of bytes available" from __archive_read_ahead(). + * You can consume more than you asked for; you just can't consume + * more than is available right now. If you consume everything that's + * immediately available, the next read_ahead() call will pull + * the next block. + * * "I want to output a large block of data." As above, ask for 1 byte, + * emit all that's available (up to whatever limit you have), then + * repeat until you're done. + * * "I want to peek ahead by a large amount." Ask for 4k or so, then + * double and repeat until you get an error or have enough. Note + * that the I/O layer will likely end up expanding its copy buffer + * to fit your request, so use this technique cautiously. This + * technique is used, for example, by some of the format tasting + * code that has uncertain look-ahead needs. + * + * TODO: Someday, provide a more generic __archive_read_seek() for + * those cases where it's useful. This is tricky because there are lots + * of cases where seek() is not available (reading gzip data from a + * network socket, for instance), so there needs to be a good way to + * communicate whether seek() is available and users of that interface + * need to use non-seeking strategies whenever seek() is not available. + */ + +/* + * Looks ahead in the input stream: + * * If 'avail' pointer is provided, that returns number of bytes available + * in the current buffer, which may be much larger than requested. + * * If end-of-file, *avail gets set to zero. + * * If error, *avail gets error code. + * * If request can be met, returns pointer to data, returns NULL + * if request is not met. + * + * Note: If you just want "some data", ask for 1 byte and pay attention + * to *avail, which will have the actual amount available. If you + * know exactly how many bytes you need, just ask for that and treat + * a NULL return as an error. + * + * Important: This does NOT move the file pointer. See + * __archive_read_consume() below. + */ + +/* + * This is tricky. We need to provide our clients with pointers to + * contiguous blocks of memory but we want to avoid copying whenever + * possible. + * + * Mostly, this code returns pointers directly into the block of data + * provided by the client_read routine. It can do this unless the + * request would split across blocks. In that case, we have to copy + * into an internal buffer to combine reads. + */ const void * -__archive_read_ahead(struct archive_read *a, size_t len) +__archive_read_ahead(struct archive_read *a, size_t min, ssize_t *avail) { - const void *h; + ssize_t bytes_read; + size_t tocopy; - if ((a->decompressor->read_ahead)(a, &h, len) < (ssize_t)len) + if (a->fatal) { + if (avail) + *avail = ARCHIVE_FATAL; return (NULL); - return (h); + } + + /* + * Keep pulling more data until we can satisfy the request. + */ + for (;;) { + + /* + * If we can satisfy from the copy buffer, we're done. + */ + if (a->avail >= min) { + if (avail != NULL) + *avail = a->avail; + return (a->next); + } + + /* + * We can satisfy directly from client buffer if everything + * currently in the copy buffer is still in the client buffer. + */ + if (a->client_total >= a->client_avail + a->avail + && a->client_avail + a->avail >= min) { + /* "Roll back" to client buffer. */ + a->client_avail += a->avail; + a->client_next -= a->avail; + /* Copy buffer is now empty. */ + a->avail = 0; + a->next = a->buffer; + /* Return data from client buffer. */ + if (avail != NULL) + *avail = a->client_avail; + return (a->client_next); + } + + /* Move data forward in copy buffer if necessary. */ + if (a->next > a->buffer && + a->next + min > a->buffer + a->buffer_size) { + if (a->avail > 0) + memmove(a->buffer, a->next, a->avail); + a->next = a->buffer; + } + + /* If we've used up the client data, get more. */ + if (a->client_avail <= 0) { + if (a->end_of_file) { + if (avail != NULL) + *avail = 0; + return (NULL); + } + bytes_read = (a->source->read)(a->source, + &a->client_buff); + if (bytes_read < 0) { /* Read error. */ + a->client_total = a->client_avail = 0; + a->client_next = a->client_buff = NULL; + a->fatal = 1; + if (avail != NULL) + *avail = ARCHIVE_FATAL; + return (NULL); + } + if (bytes_read == 0) { /* Premature end-of-file. */ + a->client_total = a->client_avail = 0; + a->client_next = a->client_buff = NULL; + a->end_of_file = 1; + /* Return whatever we do have. */ + if (avail != NULL) + *avail = a->avail; + return (NULL); + } + a->archive.raw_position += bytes_read; + a->client_total = bytes_read; + a->client_avail = a->client_total; + a->client_next = a->client_buff; + } + else + { + /* + * We can't satisfy the request from the copy + * buffer or the existing client data, so we + * need to copy more client data over to the + * copy buffer. + */ + + /* Ensure the buffer is big enough. */ + if (min > a->buffer_size) { + size_t s, t; + char *p; + + /* Double the buffer; watch for overflow. */ + s = t = a->buffer_size; + while (s < min) { + t *= 2; + if (t <= s) { /* Integer overflow! */ + archive_set_error(&a->archive, + ENOMEM, + "Unable to allocate copy buffer"); + a->fatal = 1; + if (avail != NULL) + *avail = ARCHIVE_FATAL; + return (NULL); + } + s = t; + } + /* Now s >= min, so allocate a new buffer. */ + p = (char *)malloc(s); + if (p == NULL) { + archive_set_error(&a->archive, ENOMEM, + "Unable to allocate copy buffer"); + a->fatal = 1; + if (avail != NULL) + *avail = ARCHIVE_FATAL; + return (NULL); + } + /* Move data into newly-enlarged buffer. */ + if (a->avail > 0) + memmove(p, a->next, a->avail); + free(a->buffer); + a->next = a->buffer = p; + a->buffer_size = s; + } + + /* We can add client data to copy buffer. */ + /* First estimate: copy to fill rest of buffer. */ + tocopy = (a->buffer + a->buffer_size) + - (a->next + a->avail); + /* Don't waste time buffering more than we need to. */ + if (tocopy + a->avail > min) + tocopy = min - a->avail; + /* Don't copy more than is available. */ + if (tocopy > a->client_avail) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Wed Dec 10 15:30:45 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 490AD1065670; Wed, 10 Dec 2008 15:30:45 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A4768FC14; Wed, 10 Dec 2008 15:30:45 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBAFUjMg033943; Wed, 10 Dec 2008 15:30:45 GMT (envelope-from dfr@svn.freebsd.org) Received: (from dfr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBAFUjWA033942; Wed, 10 Dec 2008 15:30:45 GMT (envelope-from dfr@svn.freebsd.org) Message-Id: <200812101530.mBAFUjWA033942@svn.freebsd.org> From: Doug Rabson Date: Wed, 10 Dec 2008 15:30:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185861 - in user/dfr/gssapi/7/sys: . modules/cxgb nfsserver X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2008 15:30:45 -0000 Author: dfr Date: Wed Dec 10 15:30:45 2008 New Revision: 185861 URL: http://svn.freebsd.org/changeset/base/185861 Log: MFC: 185860 - stack overflow in fha_assign. Modified: user/dfr/gssapi/7/sys/ (props changed) user/dfr/gssapi/7/sys/modules/cxgb/ (props changed) user/dfr/gssapi/7/sys/nfsserver/nfs_fha.c Modified: user/dfr/gssapi/7/sys/nfsserver/nfs_fha.c ============================================================================== --- user/dfr/gssapi/7/sys/nfsserver/nfs_fha.c Wed Dec 10 14:49:54 2008 (r185860) +++ user/dfr/gssapi/7/sys/nfsserver/nfs_fha.c Wed Dec 10 15:30:45 2008 (r185861) @@ -162,7 +162,7 @@ static void fha_extract_info(struct svc_req *req, struct fha_info *i) { struct mbuf *md = req->rq_args; - fhandle_t fh; + nfsfh_t fh; caddr_t dpos = mtod(md, caddr_t); static u_int64_t random_fh = 0; int error; @@ -205,11 +205,11 @@ fha_extract_info(struct svc_req *req, st goto out; /* Grab the filehandle. */ - error = nfsm_srvmtofh_xx(&fh, v3, &md, &dpos); + error = nfsm_srvmtofh_xx(&fh.fh_generic, v3, &md, &dpos); if (error) goto out; - i->fh = *(const u_int64_t *)(fh.fh_fid.fid_data); + i->fh = *(const u_int64_t *)(fh.fh_generic.fh_fid.fid_data); /* Content ourselves with zero offset for all but reads. */ if (procnum != NFSPROC_READ) From owner-svn-src-user@FreeBSD.ORG Wed Dec 10 15:31:37 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D45F1065676; Wed, 10 Dec 2008 15:31:37 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4EB048FC1F; Wed, 10 Dec 2008 15:31:37 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBAFVbic034004; Wed, 10 Dec 2008 15:31:37 GMT (envelope-from dfr@svn.freebsd.org) Received: (from dfr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBAFVbHg034003; Wed, 10 Dec 2008 15:31:37 GMT (envelope-from dfr@svn.freebsd.org) Message-Id: <200812101531.mBAFVbHg034003@svn.freebsd.org> From: Doug Rabson Date: Wed, 10 Dec 2008 15:31:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185862 - in user/dfr/gssapi/6/sys: . nfsserver X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2008 15:31:37 -0000 Author: dfr Date: Wed Dec 10 15:31:37 2008 New Revision: 185862 URL: http://svn.freebsd.org/changeset/base/185862 Log: MFC: 185860 - stack overflow in fha_assign. Modified: user/dfr/gssapi/6/sys/ (props changed) user/dfr/gssapi/6/sys/nfsserver/nfs_fha.c Modified: user/dfr/gssapi/6/sys/nfsserver/nfs_fha.c ============================================================================== --- user/dfr/gssapi/6/sys/nfsserver/nfs_fha.c Wed Dec 10 15:30:45 2008 (r185861) +++ user/dfr/gssapi/6/sys/nfsserver/nfs_fha.c Wed Dec 10 15:31:37 2008 (r185862) @@ -162,7 +162,7 @@ static void fha_extract_info(struct svc_req *req, struct fha_info *i) { struct mbuf *md = req->rq_args; - fhandle_t fh; + nfsfh_t fh; caddr_t dpos = mtod(md, caddr_t); static u_int64_t random_fh = 0; int error; @@ -205,11 +205,11 @@ fha_extract_info(struct svc_req *req, st goto out; /* Grab the filehandle. */ - error = nfsm_srvmtofh_xx(&fh, v3, &md, &dpos); + error = nfsm_srvmtofh_xx(&fh.fh_generic, v3, &md, &dpos); if (error) goto out; - i->fh = *(const u_int64_t *)(fh.fh_fid.fid_data); + i->fh = *(const u_int64_t *)(fh.fh_generic.fh_fid.fid_data); /* Content ourselves with zero offset for all but reads. */ if (procnum != NFSPROC_READ) From owner-svn-src-user@FreeBSD.ORG Wed Dec 10 16:02:56 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F2CF106567F; Wed, 10 Dec 2008 16:02:56 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3CB948FC20; Wed, 10 Dec 2008 16:02:56 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBAG2uju035266; Wed, 10 Dec 2008 16:02:56 GMT (envelope-from dfr@svn.freebsd.org) Received: (from dfr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBAG2t65035235; Wed, 10 Dec 2008 16:02:55 GMT (envelope-from dfr@svn.freebsd.org) Message-Id: <200812101602.mBAG2t65035235@svn.freebsd.org> From: Doug Rabson Date: Wed, 10 Dec 2008 16:02:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185863 - in user/dfr/gssapi/7: . bin/chio bin/cp bin/sh contrib contrib/bind9 contrib/bind9/bin/dig contrib/bind9/bin/named contrib/bind9/bin/rndc contrib/bind9/doc/arm contrib/bind9/l... X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2008 16:02:56 -0000 Author: dfr Date: Wed Dec 10 16:02:54 2008 New Revision: 185863 URL: http://svn.freebsd.org/changeset/base/185863 Log: MF7: 184965:185862 Added: user/dfr/gssapi/7/lib/libc/string/ffsll.c - copied unchanged from r185862, stable/7/lib/libc/string/ffsll.c user/dfr/gssapi/7/lib/libc/string/flsll.c - copied unchanged from r185862, stable/7/lib/libc/string/flsll.c user/dfr/gssapi/7/lib/libutil/kinfo_getfile.c - copied unchanged from r185862, stable/7/lib/libutil/kinfo_getfile.c user/dfr/gssapi/7/lib/libutil/kinfo_getvmmap.c - copied unchanged from r185862, stable/7/lib/libutil/kinfo_getvmmap.c user/dfr/gssapi/7/share/man/man4/ale.4 - copied unchanged from r185862, stable/7/share/man/man4/ale.4 user/dfr/gssapi/7/share/man/man4/igb.4 - copied unchanged from r185862, stable/7/share/man/man4/igb.4 user/dfr/gssapi/7/share/man/man5/nullfs.5 - copied unchanged from r185862, stable/7/share/man/man5/nullfs.5 user/dfr/gssapi/7/sys/dev/ale/ - copied from r185862, stable/7/sys/dev/ale/ user/dfr/gssapi/7/sys/modules/ale/ - copied from r185862, stable/7/sys/modules/ale/ Modified: user/dfr/gssapi/7/ (props changed) user/dfr/gssapi/7/Makefile.inc1 (contents, props changed) user/dfr/gssapi/7/UPDATING (props changed) user/dfr/gssapi/7/bin/chio/ (props changed) user/dfr/gssapi/7/bin/cp/ (props changed) user/dfr/gssapi/7/bin/sh/ (props changed) user/dfr/gssapi/7/contrib/ (props changed) user/dfr/gssapi/7/contrib/bind9/ (props changed) user/dfr/gssapi/7/contrib/bind9/CHANGES user/dfr/gssapi/7/contrib/bind9/COPYRIGHT user/dfr/gssapi/7/contrib/bind9/bin/dig/dighost.c user/dfr/gssapi/7/contrib/bind9/bin/named/client.c user/dfr/gssapi/7/contrib/bind9/bin/named/config.c user/dfr/gssapi/7/contrib/bind9/bin/named/controlconf.c user/dfr/gssapi/7/contrib/bind9/bin/named/interfacemgr.c user/dfr/gssapi/7/contrib/bind9/bin/named/lwresd.c user/dfr/gssapi/7/contrib/bind9/bin/named/named.conf.docbook user/dfr/gssapi/7/contrib/bind9/bin/named/server.c user/dfr/gssapi/7/contrib/bind9/bin/rndc/rndc.c user/dfr/gssapi/7/contrib/bind9/configure.in user/dfr/gssapi/7/contrib/bind9/doc/arm/Bv9ARM-book.xml user/dfr/gssapi/7/contrib/bind9/lib/bind/configure.in user/dfr/gssapi/7/contrib/bind9/lib/bind9/check.c user/dfr/gssapi/7/contrib/bind9/lib/dns/api user/dfr/gssapi/7/contrib/bind9/lib/dns/dispatch.c user/dfr/gssapi/7/contrib/bind9/lib/dns/include/dns/dispatch.h user/dfr/gssapi/7/contrib/bind9/lib/dns/request.c user/dfr/gssapi/7/contrib/bind9/lib/dns/resolver.c user/dfr/gssapi/7/contrib/bind9/lib/dns/xfrin.c user/dfr/gssapi/7/contrib/bind9/lib/isc/api user/dfr/gssapi/7/contrib/bind9/lib/isc/include/isc/resource.h user/dfr/gssapi/7/contrib/bind9/lib/isc/include/isc/socket.h user/dfr/gssapi/7/contrib/bind9/lib/isc/include/isc/timer.h user/dfr/gssapi/7/contrib/bind9/lib/isc/timer.c user/dfr/gssapi/7/contrib/bind9/lib/isc/unix/app.c user/dfr/gssapi/7/contrib/bind9/lib/isc/unix/resource.c user/dfr/gssapi/7/contrib/bind9/lib/isc/unix/socket.c user/dfr/gssapi/7/contrib/bind9/lib/isc/unix/socket_p.h user/dfr/gssapi/7/contrib/bind9/lib/isccfg/api user/dfr/gssapi/7/contrib/bind9/lib/isccfg/namedconf.c user/dfr/gssapi/7/contrib/bind9/version user/dfr/gssapi/7/contrib/gcc/ (props changed) user/dfr/gssapi/7/contrib/gdb/ (props changed) user/dfr/gssapi/7/contrib/gdtoa/ (props changed) user/dfr/gssapi/7/contrib/ntp/ (props changed) user/dfr/gssapi/7/contrib/sendmail/ (props changed) user/dfr/gssapi/7/contrib/smbfs/ (props changed) user/dfr/gssapi/7/contrib/smbfs/lib/smb/nb_name.c user/dfr/gssapi/7/contrib/tcsh/ (props changed) user/dfr/gssapi/7/contrib/telnet/ (props changed) user/dfr/gssapi/7/contrib/top/ (props changed) user/dfr/gssapi/7/contrib/traceroute/ (props changed) user/dfr/gssapi/7/crypto/openssh/ (props changed) user/dfr/gssapi/7/etc/ (props changed) user/dfr/gssapi/7/etc/defaults/ (props changed) user/dfr/gssapi/7/etc/rc.d/ (props changed) user/dfr/gssapi/7/games/fortune/ (props changed) user/dfr/gssapi/7/games/fortune/fortune/ (props changed) user/dfr/gssapi/7/gnu/usr.bin/cvs/ (props changed) user/dfr/gssapi/7/gnu/usr.bin/gdb/kgdb/ (props changed) user/dfr/gssapi/7/gnu/usr.bin/groff/tmac/mdoc.local (props changed) user/dfr/gssapi/7/include/ (props changed) user/dfr/gssapi/7/include/strings.h user/dfr/gssapi/7/lib/ (props changed) user/dfr/gssapi/7/lib/bind/ (props changed) user/dfr/gssapi/7/lib/bind/config.h user/dfr/gssapi/7/lib/csu/ (props changed) user/dfr/gssapi/7/lib/libarchive/ (props changed) user/dfr/gssapi/7/lib/libarchive/archive_entry.c user/dfr/gssapi/7/lib/libarchive/archive_entry.h user/dfr/gssapi/7/lib/libarchive/archive_entry_private.h user/dfr/gssapi/7/lib/libarchive/archive_read_support_format_iso9660.c user/dfr/gssapi/7/lib/libarchive/archive_read_support_format_zip.c user/dfr/gssapi/7/lib/libarchive/archive_string.c user/dfr/gssapi/7/lib/libarchive/archive_string.h user/dfr/gssapi/7/lib/libarchive/archive_write_disk.c user/dfr/gssapi/7/lib/libarchive/test/test_entry.c user/dfr/gssapi/7/lib/libarchive/test/test_read_format_zip.c user/dfr/gssapi/7/lib/libarchive/test/test_read_format_zip.zip.uu user/dfr/gssapi/7/lib/libarchive/test/test_write_disk.c user/dfr/gssapi/7/lib/libarchive/test/test_write_disk_hardlink.c user/dfr/gssapi/7/lib/libbluetooth/ (props changed) user/dfr/gssapi/7/lib/libc/ (props changed) user/dfr/gssapi/7/lib/libc/gen/times.3 user/dfr/gssapi/7/lib/libc/i386/sys/pipe.S user/dfr/gssapi/7/lib/libc/i386/sys/reboot.S user/dfr/gssapi/7/lib/libc/i386/sys/setlogin.S user/dfr/gssapi/7/lib/libc/string/Makefile.inc user/dfr/gssapi/7/lib/libc/string/Symbol.map user/dfr/gssapi/7/lib/libc/string/ffs.3 user/dfr/gssapi/7/lib/libc_r/ (props changed) user/dfr/gssapi/7/lib/libcam/ (props changed) user/dfr/gssapi/7/lib/libdisk/ (props changed) user/dfr/gssapi/7/lib/libfetch/ (props changed) user/dfr/gssapi/7/lib/libftpio/ (props changed) user/dfr/gssapi/7/lib/libgeom/ (props changed) user/dfr/gssapi/7/lib/libgssapi/ (props changed) user/dfr/gssapi/7/lib/libkse/ (props changed) user/dfr/gssapi/7/lib/libkvm/ (props changed) user/dfr/gssapi/7/lib/libthr/ (props changed) user/dfr/gssapi/7/lib/libutil/ (props changed) user/dfr/gssapi/7/lib/libutil/Makefile user/dfr/gssapi/7/lib/libutil/libutil.h user/dfr/gssapi/7/libexec/rpc.rstatd/ (props changed) user/dfr/gssapi/7/libexec/rtld-elf/ (props changed) user/dfr/gssapi/7/release/ (props changed) user/dfr/gssapi/7/release/Makefile user/dfr/gssapi/7/release/doc/en_US.ISO8859-1/hardware/article.sgml user/dfr/gssapi/7/release/doc/en_US.ISO8859-1/relnotes/article.sgml user/dfr/gssapi/7/release/doc/zh_CN.GB2312/hardware/article.sgml user/dfr/gssapi/7/release/doc/zh_CN.GB2312/relnotes/article.sgml user/dfr/gssapi/7/release/scripts/package-split.py user/dfr/gssapi/7/release/scripts/src-install.sh (props changed) user/dfr/gssapi/7/rescue/ (props changed) user/dfr/gssapi/7/sbin/ (props changed) user/dfr/gssapi/7/sbin/atacontrol/ (props changed) user/dfr/gssapi/7/sbin/ddb/ (props changed) user/dfr/gssapi/7/sbin/devfs/ (props changed) user/dfr/gssapi/7/sbin/dhclient/ (props changed) user/dfr/gssapi/7/sbin/fdisk/ (props changed) user/dfr/gssapi/7/sbin/fsck_ffs/ (props changed) user/dfr/gssapi/7/sbin/geom/ (props changed) user/dfr/gssapi/7/sbin/geom/class/part/ (props changed) user/dfr/gssapi/7/sbin/geom/class/part/Makefile user/dfr/gssapi/7/sbin/geom/class/part/geom_part.c user/dfr/gssapi/7/sbin/geom/class/part/gpart.8 user/dfr/gssapi/7/sbin/geom/misc/ (props changed) user/dfr/gssapi/7/sbin/ifconfig/ (props changed) user/dfr/gssapi/7/sbin/init/ (props changed) user/dfr/gssapi/7/sbin/ipfw/ (props changed) user/dfr/gssapi/7/sbin/md5/ (props changed) user/dfr/gssapi/7/sbin/mdconfig/ (props changed) user/dfr/gssapi/7/sbin/mksnap_ffs/ (props changed) user/dfr/gssapi/7/sbin/mount/ (props changed) user/dfr/gssapi/7/sbin/mount_nfs/ (props changed) user/dfr/gssapi/7/sbin/mount_nfs/mount_nfs.c user/dfr/gssapi/7/sbin/natd/ (props changed) user/dfr/gssapi/7/sbin/ping6/ (props changed) user/dfr/gssapi/7/sbin/sconfig/ (props changed) user/dfr/gssapi/7/secure/lib/libssh/ (props changed) user/dfr/gssapi/7/secure/libexec/sftp-server/ (props changed) user/dfr/gssapi/7/secure/usr.bin/ssh/ (props changed) user/dfr/gssapi/7/secure/usr.sbin/sshd/ (props changed) user/dfr/gssapi/7/share/colldef/ (props changed) user/dfr/gssapi/7/share/examples/ (props changed) user/dfr/gssapi/7/share/man/man3/ (props changed) user/dfr/gssapi/7/share/man/man4/ (props changed) user/dfr/gssapi/7/share/man/man4/Makefile user/dfr/gssapi/7/share/man/man4/altq.4 user/dfr/gssapi/7/share/man/man4/bce.4 user/dfr/gssapi/7/share/man/man4/em.4 user/dfr/gssapi/7/share/man/man4/miibus.4 user/dfr/gssapi/7/share/man/man4/vlan.4 user/dfr/gssapi/7/share/man/man4/zyd.4 user/dfr/gssapi/7/share/man/man5/ (props changed) user/dfr/gssapi/7/share/man/man5/Makefile user/dfr/gssapi/7/share/man/man5/fstab.5 user/dfr/gssapi/7/share/man/man7/ (props changed) user/dfr/gssapi/7/share/man/man9/ (props changed) user/dfr/gssapi/7/share/man/man9/bus_dma.9 user/dfr/gssapi/7/share/man/man9/ktr.9 user/dfr/gssapi/7/share/mk/ (props changed) user/dfr/gssapi/7/share/sendmail/ (props changed) user/dfr/gssapi/7/share/syscons/ (props changed) user/dfr/gssapi/7/share/syscons/keymaps/ (props changed) user/dfr/gssapi/7/share/timedef/ (props changed) user/dfr/gssapi/7/share/zoneinfo/ (props changed) user/dfr/gssapi/7/sys/ (props changed) user/dfr/gssapi/7/sys/amd64/Makefile user/dfr/gssapi/7/sys/amd64/conf/GENERIC user/dfr/gssapi/7/sys/boot/forth/loader.conf user/dfr/gssapi/7/sys/boot/forth/loader.conf.5 user/dfr/gssapi/7/sys/boot/i386/boot0/boot0.S user/dfr/gssapi/7/sys/conf/NOTES user/dfr/gssapi/7/sys/conf/files user/dfr/gssapi/7/sys/contrib/pf/ (props changed) user/dfr/gssapi/7/sys/dev/bce/if_bce.c user/dfr/gssapi/7/sys/dev/cxgb/ (props changed) user/dfr/gssapi/7/sys/dev/cxgb/common/cxgb_ael1002.c user/dfr/gssapi/7/sys/dev/cxgb/common/cxgb_common.h user/dfr/gssapi/7/sys/dev/cxgb/common/cxgb_ctl_defs.h user/dfr/gssapi/7/sys/dev/cxgb/common/cxgb_t3_hw.c user/dfr/gssapi/7/sys/dev/cxgb/common/cxgb_xgmac.c user/dfr/gssapi/7/sys/dev/cxgb/cxgb_main.c user/dfr/gssapi/7/sys/dev/cxgb/cxgb_sge.c user/dfr/gssapi/7/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c user/dfr/gssapi/7/sys/dev/cxgb/ulp/tom/cxgb_tom.c user/dfr/gssapi/7/sys/dev/cxgb/ulp/tom/cxgb_tom_sysctl.c user/dfr/gssapi/7/sys/dev/e1000/e1000_80003es2lan.c user/dfr/gssapi/7/sys/dev/e1000/e1000_82540.c user/dfr/gssapi/7/sys/dev/e1000/e1000_82541.c user/dfr/gssapi/7/sys/dev/e1000/e1000_82542.c user/dfr/gssapi/7/sys/dev/e1000/e1000_82543.c user/dfr/gssapi/7/sys/dev/e1000/e1000_82571.c user/dfr/gssapi/7/sys/dev/e1000/e1000_82575.c user/dfr/gssapi/7/sys/dev/e1000/e1000_82575.h user/dfr/gssapi/7/sys/dev/e1000/e1000_api.c user/dfr/gssapi/7/sys/dev/e1000/e1000_api.h user/dfr/gssapi/7/sys/dev/e1000/e1000_defines.h user/dfr/gssapi/7/sys/dev/e1000/e1000_hw.h user/dfr/gssapi/7/sys/dev/e1000/e1000_ich8lan.c user/dfr/gssapi/7/sys/dev/e1000/e1000_ich8lan.h user/dfr/gssapi/7/sys/dev/e1000/e1000_mac.c user/dfr/gssapi/7/sys/dev/e1000/e1000_mac.h user/dfr/gssapi/7/sys/dev/e1000/e1000_manage.c user/dfr/gssapi/7/sys/dev/e1000/e1000_nvm.c user/dfr/gssapi/7/sys/dev/e1000/e1000_osdep.c user/dfr/gssapi/7/sys/dev/e1000/e1000_osdep.h user/dfr/gssapi/7/sys/dev/e1000/e1000_phy.c user/dfr/gssapi/7/sys/dev/e1000/e1000_phy.h user/dfr/gssapi/7/sys/dev/e1000/e1000_regs.h user/dfr/gssapi/7/sys/dev/e1000/if_em.c user/dfr/gssapi/7/sys/dev/e1000/if_em.h user/dfr/gssapi/7/sys/dev/e1000/if_igb.c user/dfr/gssapi/7/sys/dev/e1000/if_igb.h user/dfr/gssapi/7/sys/dev/esp/esp_sbus.c user/dfr/gssapi/7/sys/dev/esp/ncr53c9x.c user/dfr/gssapi/7/sys/dev/esp/ncr53c9xreg.h user/dfr/gssapi/7/sys/dev/esp/ncr53c9xvar.h user/dfr/gssapi/7/sys/dev/fb/s3_pci.c user/dfr/gssapi/7/sys/dev/ixgbe/ixgbe.c user/dfr/gssapi/7/sys/dev/ixgbe/ixgbe.h user/dfr/gssapi/7/sys/dev/ixgbe/ixgbe_82598.c user/dfr/gssapi/7/sys/dev/ixgbe/ixgbe_api.c user/dfr/gssapi/7/sys/dev/ixgbe/ixgbe_api.h user/dfr/gssapi/7/sys/dev/ixgbe/ixgbe_common.c user/dfr/gssapi/7/sys/dev/ixgbe/ixgbe_common.h user/dfr/gssapi/7/sys/dev/ixgbe/ixgbe_osdep.h user/dfr/gssapi/7/sys/dev/ixgbe/ixgbe_phy.c user/dfr/gssapi/7/sys/dev/ixgbe/ixgbe_phy.h user/dfr/gssapi/7/sys/dev/ixgbe/ixgbe_type.h user/dfr/gssapi/7/sys/dev/le/if_le_ledma.c user/dfr/gssapi/7/sys/dev/mfi/mfi.c user/dfr/gssapi/7/sys/dev/mfi/mfi_ioctl.h user/dfr/gssapi/7/sys/dev/mfi/mfi_pci.c user/dfr/gssapi/7/sys/dev/mfi/mfireg.h user/dfr/gssapi/7/sys/dev/mfi/mfivar.h user/dfr/gssapi/7/sys/dev/pccbb/pccbb_pci.c user/dfr/gssapi/7/sys/dev/random/randomdev.c user/dfr/gssapi/7/sys/dev/random/randomdev_soft.c user/dfr/gssapi/7/sys/dev/re/if_re.c user/dfr/gssapi/7/sys/dev/vr/if_vr.c user/dfr/gssapi/7/sys/fs/cd9660/cd9660_node.c user/dfr/gssapi/7/sys/fs/cd9660/cd9660_rrip.c user/dfr/gssapi/7/sys/geom/part/g_part_gpt.c user/dfr/gssapi/7/sys/i386/conf/GENERIC user/dfr/gssapi/7/sys/ia64/include/atomic.h user/dfr/gssapi/7/sys/kern/Make.tags.inc user/dfr/gssapi/7/sys/kern/kern_descrip.c user/dfr/gssapi/7/sys/kern/kern_proc.c user/dfr/gssapi/7/sys/kern/uipc_socket.c user/dfr/gssapi/7/sys/kern/vfs_cache.c user/dfr/gssapi/7/sys/modules/Makefile user/dfr/gssapi/7/sys/modules/cxgb/ (props changed) user/dfr/gssapi/7/sys/net80211/ieee80211_freebsd.h user/dfr/gssapi/7/sys/netinet/in_pcb.h user/dfr/gssapi/7/sys/netinet/ip_divert.c user/dfr/gssapi/7/sys/netinet/ip_output.c user/dfr/gssapi/7/sys/netinet/raw_ip.c user/dfr/gssapi/7/sys/netinet6/in6_pcb.c user/dfr/gssapi/7/sys/pci/agp_i810.c user/dfr/gssapi/7/sys/pci/agpreg.h user/dfr/gssapi/7/sys/pci/if_rlreg.h user/dfr/gssapi/7/sys/security/audit/audit_syscalls.c user/dfr/gssapi/7/sys/security/mac_bsdextended/mac_bsdextended.c user/dfr/gssapi/7/sys/sparc64/sbus/dma_sbus.c user/dfr/gssapi/7/sys/sparc64/sbus/lsi64854.c user/dfr/gssapi/7/sys/sparc64/sbus/lsi64854var.h user/dfr/gssapi/7/sys/sys/param.h user/dfr/gssapi/7/sys/sys/sysctl.h user/dfr/gssapi/7/sys/sys/user.h user/dfr/gssapi/7/sys/ufs/ffs/ffs_snapshot.c user/dfr/gssapi/7/sys/ufs/ufs/ufs_quota.c user/dfr/gssapi/7/sys/vm/vm_pageout.c user/dfr/gssapi/7/tools/regression/atm/ (props changed) user/dfr/gssapi/7/tools/regression/file/flock/ (props changed) user/dfr/gssapi/7/tools/tools/crypto/ (props changed) user/dfr/gssapi/7/tools/tools/editing/ (props changed) user/dfr/gssapi/7/tools/tools/nanobsd/ (props changed) user/dfr/gssapi/7/usr.bin/ (props changed) user/dfr/gssapi/7/usr.bin/calendar/ (props changed) user/dfr/gssapi/7/usr.bin/cksum/ (props changed) user/dfr/gssapi/7/usr.bin/comm/ (props changed) user/dfr/gssapi/7/usr.bin/cpuset/ (props changed) user/dfr/gssapi/7/usr.bin/fetch/ (props changed) user/dfr/gssapi/7/usr.bin/gzip/ (props changed) user/dfr/gssapi/7/usr.bin/ipcrm/ (props changed) user/dfr/gssapi/7/usr.bin/ipcs/ (props changed) user/dfr/gssapi/7/usr.bin/kdump/ (props changed) user/dfr/gssapi/7/usr.bin/ktrace/ (props changed) user/dfr/gssapi/7/usr.bin/ldd/ (props changed) user/dfr/gssapi/7/usr.bin/lockf/ (props changed) user/dfr/gssapi/7/usr.bin/logger/ (props changed) user/dfr/gssapi/7/usr.bin/make/ (props changed) user/dfr/gssapi/7/usr.bin/netstat/ (props changed) user/dfr/gssapi/7/usr.bin/procstat/ (props changed) user/dfr/gssapi/7/usr.bin/procstat/Makefile user/dfr/gssapi/7/usr.bin/procstat/procstat_files.c user/dfr/gssapi/7/usr.bin/procstat/procstat_vm.c user/dfr/gssapi/7/usr.bin/rpcgen/ (props changed) user/dfr/gssapi/7/usr.bin/sed/ (props changed) user/dfr/gssapi/7/usr.bin/sed/compile.c user/dfr/gssapi/7/usr.bin/shar/ (props changed) user/dfr/gssapi/7/usr.bin/su/ (props changed) user/dfr/gssapi/7/usr.bin/tar/ (props changed) user/dfr/gssapi/7/usr.bin/tar/write.c user/dfr/gssapi/7/usr.bin/top/ (props changed) user/dfr/gssapi/7/usr.bin/truncate/ (props changed) user/dfr/gssapi/7/usr.bin/truss/ (props changed) user/dfr/gssapi/7/usr.bin/units/ (props changed) user/dfr/gssapi/7/usr.bin/vmstat/ (props changed) user/dfr/gssapi/7/usr.bin/whereis/ (props changed) user/dfr/gssapi/7/usr.bin/window/ (props changed) user/dfr/gssapi/7/usr.bin/xargs/ (props changed) user/dfr/gssapi/7/usr.bin/xargs/xargs.1 user/dfr/gssapi/7/usr.sbin/ (props changed) user/dfr/gssapi/7/usr.sbin/adduser/ (props changed) user/dfr/gssapi/7/usr.sbin/bsnmpd/modules/snmp_pf/ (props changed) user/dfr/gssapi/7/usr.sbin/cdcontrol/ (props changed) user/dfr/gssapi/7/usr.sbin/config/ (props changed) user/dfr/gssapi/7/usr.sbin/cron/ (props changed) user/dfr/gssapi/7/usr.sbin/cron/cron/ (props changed) user/dfr/gssapi/7/usr.sbin/extattr/ (props changed) user/dfr/gssapi/7/usr.sbin/freebsd-update/ (props changed) user/dfr/gssapi/7/usr.sbin/iostat/ (props changed) user/dfr/gssapi/7/usr.sbin/mountd/ (props changed) user/dfr/gssapi/7/usr.sbin/mtree/ (props changed) user/dfr/gssapi/7/usr.sbin/mtree/mtree.c user/dfr/gssapi/7/usr.sbin/ndiscvt/ (props changed) user/dfr/gssapi/7/usr.sbin/newsyslog/newsyslog.conf.5 (props changed) user/dfr/gssapi/7/usr.sbin/nscd/ (props changed) user/dfr/gssapi/7/usr.sbin/ntp/ (props changed) user/dfr/gssapi/7/usr.sbin/pkg_install/ (props changed) user/dfr/gssapi/7/usr.sbin/pkg_install/add/main.c user/dfr/gssapi/7/usr.sbin/pmcstat/ (props changed) user/dfr/gssapi/7/usr.sbin/portsnap/ (props changed) user/dfr/gssapi/7/usr.sbin/powerd/ (props changed) user/dfr/gssapi/7/usr.sbin/pw/ (props changed) user/dfr/gssapi/7/usr.sbin/rpc.lockd/ (props changed) user/dfr/gssapi/7/usr.sbin/rpc.statd/ (props changed) user/dfr/gssapi/7/usr.sbin/setfib/ (props changed) user/dfr/gssapi/7/usr.sbin/sysinstall/ (props changed) user/dfr/gssapi/7/usr.sbin/sysinstall/devices.c user/dfr/gssapi/7/usr.sbin/syslogd/ (props changed) user/dfr/gssapi/7/usr.sbin/traceroute/ (props changed) user/dfr/gssapi/7/usr.sbin/tzsetup/ (props changed) user/dfr/gssapi/7/usr.sbin/wpa/wpa_supplicant/ (props changed) Modified: user/dfr/gssapi/7/Makefile.inc1 ============================================================================== --- user/dfr/gssapi/7/Makefile.inc1 Wed Dec 10 15:31:37 2008 (r185862) +++ user/dfr/gssapi/7/Makefile.inc1 Wed Dec 10 16:02:54 2008 (r185863) @@ -487,6 +487,9 @@ distribute32 install32: .if ${MK_CRYPT} != "no" cd ${.CURDIR}/secure/lib; ${LIB32IMAKE} ${.TARGET:S/32$//} .endif +.if ${MK_KERBEROS} != "no" + cd ${.CURDIR}/kerberos5/lib; ${LIB32IMAKE} ${.TARGET:S/32$//} +.endif cd ${.CURDIR}/libexec/rtld-elf; \ PROG=ld-elf32.so.1 ${LIB32IMAKE} ${.TARGET:S/32$//} cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32IMAKE} ${.TARGET:S/32$//} Modified: user/dfr/gssapi/7/contrib/bind9/CHANGES ============================================================================== --- user/dfr/gssapi/7/contrib/bind9/CHANGES Wed Dec 10 15:31:37 2008 (r185862) +++ user/dfr/gssapi/7/contrib/bind9/CHANGES Wed Dec 10 16:02:54 2008 (r185863) @@ -1,3 +1,47 @@ + --- 9.4.2-P2 released --- + +2406. [bug] Some operating systems have FD_SETSIZE set to a + low value by default, which can cause resource + exhaustion when many simultaneous connections are + open. Linux in particular makes it difficult to + increase this value. To use more sockets with + select(), set ISC_SOCKET_FDSETSIZE. Example: + STD_CDEFINES="-DISC_SOCKET_FDSETSIZE=4096" ./configure + (This should not be necessary in most cases, and + never for an authoritative-only server.) [RT #18328] + +2404. [port] hpux: files unlimited support. + +2403. [bug] TSIG context leak. [RT #18341] + +2402. [port] Support Solaris 2.11 and over. [RT #18362] + +2401. [bug] Expect to get E[MN]FILE errno internal_accept() + (from accept() or fcntl() system calls). [RT #18358] + +2399. [bug] Abort timeout queries to reduce the number of open + UDP sockets. [RT #18367] + +2398. [bug] Improve file descriptor management. New, + temporary, named.conf option reserved-sockets, + default 512. [RT #18344] + +2396. [bug] Don't set SO_REUSEADDR for randomized ports. + [RT #18336] + +2395. [port] Avoid warning and no effect from "files unlimited" + on Linux when running as root. [RT #18335] + +2394. [bug] Default configuration options set the limit for + open files to 'unlimited' as described in the + documentation. [RT #18331] + +2392. [bug] remove 'grep -q' from acl test script, some platforms + don't support it. [RT #18253] + +2322. [port] MacOS: work around the limitation of setrlimit() + for RLIMIT_NOFILE. [RT #17526] + --- 9.4.2-P1 released --- 2375. [security] Fully randomize UDP query ports to improve @@ -33,7 +77,7 @@ [RT #17113] 2249. [bug] Only set Authentic Data bit if client requested - DNSSEC, per RFC 3655 [RT #17175] + DNSSEC, per RFC 3655 [RT #17175] 2248. [cleanup] Fix several errors reported by Coverity. [RT #17160] Modified: user/dfr/gssapi/7/contrib/bind9/COPYRIGHT ============================================================================== --- user/dfr/gssapi/7/contrib/bind9/COPYRIGHT Wed Dec 10 15:31:37 2008 (r185862) +++ user/dfr/gssapi/7/contrib/bind9/COPYRIGHT Wed Dec 10 16:02:54 2008 (r185863) @@ -1,4 +1,4 @@ -Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") +Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") Copyright (C) 1996-2003 Internet Software Consortium. Permission to use, copy, modify, and/or distribute this software for any @@ -13,7 +13,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -$Id: COPYRIGHT,v 1.9.18.4 2007/08/28 07:19:54 tbox Exp $ +$Id: COPYRIGHT,v 1.9.18.4.10.1 2008/07/23 07:28:54 tbox Exp $ Portions Copyright (C) 1996-2001 Nominum, Inc. Modified: user/dfr/gssapi/7/contrib/bind9/bin/dig/dighost.c ============================================================================== --- user/dfr/gssapi/7/contrib/bind9/bin/dig/dighost.c Wed Dec 10 15:31:37 2008 (r185862) +++ user/dfr/gssapi/7/contrib/bind9/bin/dig/dighost.c Wed Dec 10 16:02:54 2008 (r185863) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dighost.c,v 1.259.18.43 2007/08/28 07:19:55 tbox Exp $ */ +/* $Id: dighost.c,v 1.259.18.43.10.3 2008/07/23 23:16:43 marka Exp $ */ /*! \file * \note @@ -2217,14 +2217,15 @@ send_tcp_connect(dig_query_t *query) { sockcount++; debug("sockcount=%d", sockcount); if (specified_source) - result = isc_socket_bind(query->sock, &bind_address); + result = isc_socket_bind(query->sock, &bind_address, + ISC_SOCKET_REUSEADDRESS); else { if ((isc_sockaddr_pf(&query->sockaddr) == AF_INET) && have_ipv4) isc_sockaddr_any(&bind_any); else isc_sockaddr_any6(&bind_any); - result = isc_socket_bind(query->sock, &bind_any); + result = isc_socket_bind(query->sock, &bind_any, 0); } check_result(result, "isc_socket_bind"); bringup_timer(query, TCP_TIMEOUT); @@ -2271,11 +2272,12 @@ send_udp(dig_query_t *query) { sockcount++; debug("sockcount=%d", sockcount); if (specified_source) { - result = isc_socket_bind(query->sock, &bind_address); + result = isc_socket_bind(query->sock, &bind_address, + ISC_SOCKET_REUSEADDRESS); } else { isc_sockaddr_anyofpf(&bind_any, isc_sockaddr_pf(&query->sockaddr)); - result = isc_socket_bind(query->sock, &bind_any); + result = isc_socket_bind(query->sock, &bind_any, 0); } check_result(result, "isc_socket_bind"); Modified: user/dfr/gssapi/7/contrib/bind9/bin/named/client.c ============================================================================== --- user/dfr/gssapi/7/contrib/bind9/bin/named/client.c Wed Dec 10 15:31:37 2008 (r185862) +++ user/dfr/gssapi/7/contrib/bind9/bin/named/client.c Wed Dec 10 16:02:54 2008 (r185863) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: client.c,v 1.219.18.28.10.1 2008/05/22 21:28:04 each Exp $ */ +/* $Id: client.c,v 1.219.18.28.10.2 2008/07/23 07:28:54 tbox Exp $ */ #include Modified: user/dfr/gssapi/7/contrib/bind9/bin/named/config.c ============================================================================== --- user/dfr/gssapi/7/contrib/bind9/bin/named/config.c Wed Dec 10 15:31:37 2008 (r185862) +++ user/dfr/gssapi/7/contrib/bind9/bin/named/config.c Wed Dec 10 16:02:54 2008 (r185863) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2001-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: config.c,v 1.47.18.32 2007/09/13 05:04:01 each Exp $ */ +/* $Id: config.c,v 1.47.18.32.10.3 2008/07/23 23:48:17 tbox Exp $ */ /*! \file */ @@ -52,7 +52,7 @@ options {\n\ #ifndef WIN32 " coresize default;\n\ datasize default;\n\ - files default;\n\ + files unlimited;\n\ stacksize default;\n" #endif " deallocate-on-exit true;\n\ @@ -99,6 +99,7 @@ options {\n\ use-ixfr true;\n\ edns-udp-size 4096;\n\ max-udp-size 4096;\n\ + reserved-sockets 512;\n\ \n\ /* view */\n\ allow-notify {none;};\n\ Modified: user/dfr/gssapi/7/contrib/bind9/bin/named/controlconf.c ============================================================================== --- user/dfr/gssapi/7/contrib/bind9/bin/named/controlconf.c Wed Dec 10 15:31:37 2008 (r185862) +++ user/dfr/gssapi/7/contrib/bind9/bin/named/controlconf.c Wed Dec 10 16:02:54 2008 (r185863) @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2006, 2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2001-2003 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: controlconf.c,v 1.40.18.10 2006/12/07 04:53:02 marka Exp $ */ +/* $Id: controlconf.c,v 1.40.18.10.40.3 2008/07/23 23:16:43 marka Exp $ */ /*! \file */ @@ -1151,8 +1151,8 @@ add_listener(ns_controls_t *cp, controll type, &listener->sock); if (result == ISC_R_SUCCESS) - result = isc_socket_bind(listener->sock, - &listener->address); + result = isc_socket_bind(listener->sock, &listener->address, + ISC_SOCKET_REUSEADDRESS); if (result == ISC_R_SUCCESS && type == isc_sockettype_unix) { listener->perm = cfg_obj_asuint32(cfg_tuple_get(control, Modified: user/dfr/gssapi/7/contrib/bind9/bin/named/interfacemgr.c ============================================================================== --- user/dfr/gssapi/7/contrib/bind9/bin/named/interfacemgr.c Wed Dec 10 15:31:37 2008 (r185862) +++ user/dfr/gssapi/7/contrib/bind9/bin/named/interfacemgr.c Wed Dec 10 16:02:54 2008 (r185863) @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2006, 2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2002 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: interfacemgr.c,v 1.76.18.8 2006/07/20 01:10:30 marka Exp $ */ +/* $Id: interfacemgr.c,v 1.76.18.8.44.3 2008/07/23 23:16:43 marka Exp $ */ /*! \file */ @@ -307,7 +307,8 @@ ns_interface_accepttcp(ns_interface_t *i #ifndef ISC_ALLOW_MAPPED isc_socket_ipv6only(ifp->tcpsocket, ISC_TRUE); #endif - result = isc_socket_bind(ifp->tcpsocket, &ifp->addr); + result = isc_socket_bind(ifp->tcpsocket, &ifp->addr, + ISC_SOCKET_REUSEADDRESS); if (result != ISC_R_SUCCESS) { isc_log_write(IFMGR_COMMON_LOGARGS, ISC_LOG_ERROR, "binding TCP socket: %s", Modified: user/dfr/gssapi/7/contrib/bind9/bin/named/lwresd.c ============================================================================== --- user/dfr/gssapi/7/contrib/bind9/bin/named/lwresd.c Wed Dec 10 15:31:37 2008 (r185862) +++ user/dfr/gssapi/7/contrib/bind9/bin/named/lwresd.c Wed Dec 10 16:02:54 2008 (r185863) @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2006, 2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000-2003 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: lwresd.c,v 1.46.18.7 2006/03/02 00:37:21 marka Exp $ */ +/* $Id: lwresd.c,v 1.46.18.7.52.3 2008/07/23 23:16:43 marka Exp $ */ /*! \file * \brief @@ -576,7 +576,8 @@ listener_bind(ns_lwreslistener_t *listen return (result); } - result = isc_socket_bind(sock, &listener->address); + result = isc_socket_bind(sock, &listener->address, + ISC_SOCKET_REUSEADDRESS); if (result != ISC_R_SUCCESS) { char socktext[ISC_SOCKADDR_FORMATSIZE]; isc_sockaddr_format(&listener->address, socktext, Modified: user/dfr/gssapi/7/contrib/bind9/bin/named/named.conf.docbook ============================================================================== --- user/dfr/gssapi/7/contrib/bind9/bin/named/named.conf.docbook Wed Dec 10 15:31:37 2008 (r185862) +++ user/dfr/gssapi/7/contrib/bind9/bin/named/named.conf.docbook Wed Dec 10 16:02:54 2008 (r185863) @@ -2,7 +2,7 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" []> - + Aug 13, 2004 @@ -40,6 +40,7 @@ 2005 2006 2007 + 2008 Internet Systems Consortium, Inc. ("ISC") @@ -201,6 +202,7 @@ options { port integer; querylog boolean; recursing-file quoted_string; + reserved-sockets integer; random-device quoted_string; recursive-clients integer; serial-query-rate integer; Modified: user/dfr/gssapi/7/contrib/bind9/bin/named/server.c ============================================================================== --- user/dfr/gssapi/7/contrib/bind9/bin/named/server.c Wed Dec 10 15:31:37 2008 (r185862) +++ user/dfr/gssapi/7/contrib/bind9/bin/named/server.c Wed Dec 10 16:02:54 2008 (r185863) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: server.c,v 1.419.18.57.10.1 2008/05/22 21:28:04 each Exp $ */ +/* $Id: server.c,v 1.419.18.57.10.3 2008/07/23 12:04:32 marka Exp $ */ /*! \file */ @@ -2696,27 +2696,29 @@ static isc_result_t load_configuration(const char *filename, ns_server_t *server, isc_boolean_t first_time) { - isc_result_t result; - isc_interval_t interval; - cfg_parser_t *parser = NULL; + cfg_aclconfctx_t aclconfctx; cfg_obj_t *config; - const cfg_obj_t *options; - const cfg_obj_t *views; + cfg_parser_t *parser = NULL; + const cfg_listelt_t *element; + const cfg_obj_t *builtin_views; + const cfg_obj_t *maps[3]; const cfg_obj_t *obj; + const cfg_obj_t *options; const cfg_obj_t *v4ports, *v6ports; - const cfg_obj_t *maps[3]; - const cfg_obj_t *builtin_views; - const cfg_listelt_t *element; + const cfg_obj_t *views; dns_view_t *view = NULL; dns_view_t *view_next; - dns_viewlist_t viewlist; dns_viewlist_t tmpviewlist; - cfg_aclconfctx_t aclconfctx; - isc_uint32_t interface_interval; - isc_uint32_t heartbeat_interval; - isc_uint32_t udpsize; + dns_viewlist_t viewlist; in_port_t listen_port; int i; + isc_interval_t interval; + isc_resourcevalue_t files; + isc_result_t result; + isc_uint32_t heartbeat_interval; + isc_uint32_t interface_interval; + isc_uint32_t reserved; + isc_uint32_t udpsize; cfg_aclconfctx_init(&aclconfctx); ISC_LIST_INIT(viewlist); @@ -2797,6 +2799,43 @@ load_configuration(const char *filename, set_limits(maps); /* + * Sanity check on "files" limit. + */ + result = isc_resource_curlimit(isc_resource_openfiles, &files); + if (result == ISC_R_SUCCESS && files < FD_SETSIZE) { + isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, + NS_LOGMODULE_SERVER, ISC_LOG_WARNING, + "the 'files' limit (%" ISC_PRINT_QUADFORMAT "u) " + "is less than FD_SETSIZE (%d), increase " + "'files' in named.conf or recompile with a " + "smaller FD_SETSIZE.", files, FD_SETSIZE); + if (files > FD_SETSIZE) + files = FD_SETSIZE; + } else + files = FD_SETSIZE; + + /* + * Set the number of socket reserved for TCP, stdio etc. + */ + obj = NULL; + result = ns_config_get(maps, "reserved-sockets", &obj); + INSIST(result == ISC_R_SUCCESS); + reserved = cfg_obj_asuint32(obj); + if (files < 128U) /* Prevent underflow. */ + reserved = 0; + else if (reserved > files - 128U) /* Mimimum UDP space. */ + reserved = files - 128; + if (reserved < 128U) /* Mimimum TCP/stdio space. */ + reserved = 128; + if (reserved + 128U > files) { + isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, + NS_LOGMODULE_SERVER, ISC_LOG_WARNING, + "less than 128 UDP sockets available after " + "applying 'reserved-sockets' and 'files'"); + } + isc__socketmgr_setreserved(ns_g_socketmgr, reserved); + + /* * Configure various server options. */ configure_server_quota(maps, "transfers-out", &server->xfroutquota); Modified: user/dfr/gssapi/7/contrib/bind9/bin/rndc/rndc.c ============================================================================== --- user/dfr/gssapi/7/contrib/bind9/bin/rndc/rndc.c Wed Dec 10 15:31:37 2008 (r185862) +++ user/dfr/gssapi/7/contrib/bind9/bin/rndc/rndc.c Wed Dec 10 16:02:54 2008 (r185863) @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2006, 2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000-2003 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rndc.c,v 1.96.18.17 2006/08/04 03:03:41 marka Exp $ */ +/* $Id: rndc.c,v 1.96.18.17.42.3 2008/07/23 23:16:43 marka Exp $ */ /*! \file */ @@ -400,10 +400,10 @@ rndc_startconnect(isc_sockaddr_t *addr, DO("create socket", isc_socket_create(socketmgr, pf, type, &sock)); switch (isc_sockaddr_pf(addr)) { case AF_INET: - DO("bind socket", isc_socket_bind(sock, &local4)); + DO("bind socket", isc_socket_bind(sock, &local4, 0)); break; case AF_INET6: - DO("bind socket", isc_socket_bind(sock, &local6)); + DO("bind socket", isc_socket_bind(sock, &local6, 0)); break; default: break; Modified: user/dfr/gssapi/7/contrib/bind9/configure.in ============================================================================== --- user/dfr/gssapi/7/contrib/bind9/configure.in Wed Dec 10 15:31:37 2008 (r185862) +++ user/dfr/gssapi/7/contrib/bind9/configure.in Wed Dec 10 16:02:54 2008 (r185863) @@ -1,4 +1,4 @@ -# Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") # Copyright (C) 1998-2003 Internet Software Consortium. # # Permission to use, copy, modify, and/or distribute this software for any @@ -18,7 +18,7 @@ AC_DIVERT_PUSH(1)dnl esyscmd([sed "s/^/# /" COPYRIGHT])dnl AC_DIVERT_POP()dnl -AC_REVISION($Revision: 1.355.18.71 $) +AC_REVISION($Revision: 1.355.18.71.8.2 $) AC_INIT(lib/dns/name.c) AC_PREREQ(2.59) @@ -1839,7 +1839,7 @@ case "$host" in [*-solaris2.[89]]) hack_shutup_pthreadonceinit=yes ;; - *-solaris2.10) + *-solaris2.1[0-9]) hack_shutup_pthreadonceinit=yes ;; esac Modified: user/dfr/gssapi/7/contrib/bind9/doc/arm/Bv9ARM-book.xml ============================================================================== --- user/dfr/gssapi/7/contrib/bind9/doc/arm/Bv9ARM-book.xml Wed Dec 10 15:31:37 2008 (r185862) +++ user/dfr/gssapi/7/contrib/bind9/doc/arm/Bv9ARM-book.xml Wed Dec 10 16:02:54 2008 (r185863) @@ -2,7 +2,7 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" []> - + BIND 9 Administrator Reference Manual @@ -28,6 +28,7 @@ 2005 2006 2007 + 2008 Internet Systems Consortium, Inc. ("ISC") @@ -4441,6 +4442,7 @@ category notify { null; }; max-transfer-idle-in number; max-transfer-idle-out number; tcp-clients number; + reserved-sockets number; recursive-clients number; serial-query-rate number; serial-queries number; @@ -6606,6 +6608,23 @@ query-source-v6 address * port *; + reserved-sockets + + + The number of file descriptors reserved for TCP, stdio, + etc. This needs to be big enough to cover the number of + interfaces named listens on, tcp-clients as well as + to provide room for outgoing TCP queries and incoming zone + transfers. The default is 512. + The minimum value is 128 and the + maximum value is 128 less than + 'files' or FD_SETSIZE (whichever is smaller). This + option may be removed in the future. + + + + + max-cache-size Modified: user/dfr/gssapi/7/contrib/bind9/lib/bind/configure.in ============================================================================== --- user/dfr/gssapi/7/contrib/bind9/lib/bind/configure.in Wed Dec 10 15:31:37 2008 (r185862) +++ user/dfr/gssapi/7/contrib/bind9/lib/bind/configure.in Wed Dec 10 16:02:54 2008 (r185863) @@ -1,4 +1,4 @@ -# Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") # Copyright (C) 2001, 2003 Internet Software Consortium. # # Permission to use, copy, modify, and/or distribute this software for any @@ -13,7 +13,7 @@ # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. -AC_REVISION($Revision: 1.90.18.34 $) +AC_REVISION($Revision: 1.90.18.34.10.2 $) AC_INIT(resolv/herror.c) AC_PREREQ(2.13) @@ -2590,7 +2590,7 @@ case "$host" in *-solaris2.9) hack_shutup_in6addr_init_macros=yes ;; - *-solaris2.10) + *-solaris2.1[0-9]) hack_shutup_in6addr_init_macros=yes ;; esac Modified: user/dfr/gssapi/7/contrib/bind9/lib/bind9/check.c ============================================================================== --- user/dfr/gssapi/7/contrib/bind9/lib/bind9/check.c Wed Dec 10 15:31:37 2008 (r185862) +++ user/dfr/gssapi/7/contrib/bind9/lib/bind9/check.c Wed Dec 10 16:02:54 2008 (r185863) @@ -1015,10 +1015,10 @@ check_zoneconf(const cfg_obj_t *zconfig, isc_buffer_add(&b, strlen(zname)); tresult = dns_name_fromtext(dns_fixedname_name(&fixedname), &b, dns_rootname, ISC_TRUE, NULL); - if (tresult != ISC_R_SUCCESS) { + if (result != ISC_R_SUCCESS) { cfg_obj_log(zconfig, logctx, ISC_LOG_ERROR, "zone '%s': is not a valid name", zname); - result = ISC_R_FAILURE; + tresult = ISC_R_FAILURE; } else { char namebuf[DNS_NAME_FORMATSIZE]; Modified: user/dfr/gssapi/7/contrib/bind9/lib/dns/api ============================================================================== --- user/dfr/gssapi/7/contrib/bind9/lib/dns/api Wed Dec 10 15:31:37 2008 (r185862) +++ user/dfr/gssapi/7/contrib/bind9/lib/dns/api Wed Dec 10 16:02:54 2008 (r185863) @@ -1,3 +1,3 @@ LIBINTERFACE = 35 -LIBREVISION = 0 +LIBREVISION = 1 LIBAGE = 0 Modified: user/dfr/gssapi/7/contrib/bind9/lib/dns/dispatch.c ============================================================================== --- user/dfr/gssapi/7/contrib/bind9/lib/dns/dispatch.c Wed Dec 10 15:31:37 2008 (r185862) +++ user/dfr/gssapi/7/contrib/bind9/lib/dns/dispatch.c Wed Dec 10 16:02:54 2008 (r185863) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dispatch.c,v 1.116.18.19.12.1 2008/05/22 21:28:06 each Exp $ */ +/* $Id: dispatch.c,v 1.116.18.19.12.5 2008/07/23 23:16:43 marka Exp $ */ /*! \file */ @@ -276,7 +276,26 @@ request_log(dns_dispatch_t *disp, dns_di } /* - * ARC4 random number generator obtained from OpenBSD + * ARC4 random number generator derived from OpenBSD. + * Only dispatch_arc4random() and dispatch_arc4uniformrandom() are expected + * to be called from general dispatch routines; the rest of them are subroutines + * for these two. + * + * The original copyright follows: + * Copyright (c) 1996, David Mazieres + * Copyright (c) 2008, Damien Miller + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ static void dispatch_arc4init(arc4ctx_t *actx) { @@ -1172,7 +1191,7 @@ destroy_mgr(dns_dispatchmgr_t **mgrp) { static isc_result_t create_socket(isc_socketmgr_t *mgr, isc_sockaddr_t *local, - isc_socket_t **sockp) + unsigned int options, isc_socket_t **sockp) { isc_socket_t *sock; isc_result_t result; @@ -1186,7 +1205,7 @@ create_socket(isc_socketmgr_t *mgr, isc_ #ifndef ISC_ALLOW_MAPPED isc_socket_ipv6only(sock, ISC_TRUE); #endif - result = isc_socket_bind(sock, local); + result = isc_socket_bind(sock, local, options); if (result != ISC_R_SUCCESS) { isc_socket_detach(&sock); return (result); @@ -1917,7 +1936,7 @@ dispatch_createudp(dns_dispatchmgr_t *mg attributes &= ~DNS_DISPATCHATTR_RANDOMPORT; goto getsocket; } - result = create_socket(sockmgr, &localaddr_bound, &sock); + result = create_socket(sockmgr, &localaddr_bound, 0, &sock); if (result == ISC_R_ADDRINUSE) { if (++k == 1024) attributes &= ~DNS_DISPATCHATTR_RANDOMPORT; @@ -1925,7 +1944,8 @@ dispatch_createudp(dns_dispatchmgr_t *mg } localport = prt; } else - result = create_socket(sockmgr, localaddr, &sock); + result = create_socket(sockmgr, localaddr, + ISC_SOCKET_REUSEADDRESS, &sock); if (result != ISC_R_SUCCESS) goto deallocate_dispatch; if ((attributes & DNS_DISPATCHATTR_RANDOMPORT) == 0 && Modified: user/dfr/gssapi/7/contrib/bind9/lib/dns/include/dns/dispatch.h ============================================================================== --- user/dfr/gssapi/7/contrib/bind9/lib/dns/include/dns/dispatch.h Wed Dec 10 15:31:37 2008 (r185862) +++ user/dfr/gssapi/7/contrib/bind9/lib/dns/include/dns/dispatch.h Wed Dec 10 16:02:54 2008 (r185863) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dispatch.h,v 1.48.18.5.12.1 2008/05/22 21:28:06 each Exp $ */ +/* $Id: dispatch.h,v 1.48.18.5.12.2 2008/07/23 07:28:56 tbox Exp $ */ #ifndef DNS_DISPATCH_H #define DNS_DISPATCH_H 1 Modified: user/dfr/gssapi/7/contrib/bind9/lib/dns/request.c ============================================================================== --- user/dfr/gssapi/7/contrib/bind9/lib/dns/request.c Wed Dec 10 15:31:37 2008 (r185862) +++ user/dfr/gssapi/7/contrib/bind9/lib/dns/request.c Wed Dec 10 16:02:54 2008 (r185863) @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2006, 2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000-2002 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: request.c,v 1.72.18.5 2006/08/21 00:40:53 marka Exp $ */ +/* $Id: request.c,v 1.72.18.5.42.2 2008/07/23 07:28:56 tbox Exp $ */ /*! \file */ @@ -518,11 +518,11 @@ create_tcp_dispatch(dns_requestmgr_t *re if (srcaddr == NULL) { isc_sockaddr_anyofpf(&bind_any, isc_sockaddr_pf(destaddr)); - result = isc_socket_bind(socket, &bind_any); + result = isc_socket_bind(socket, &bind_any, 0); } else { src = *srcaddr; isc_sockaddr_setport(&src, 0); - result = isc_socket_bind(socket, &src); + result = isc_socket_bind(socket, &src, 0); } if (result != ISC_R_SUCCESS) goto cleanup; Modified: user/dfr/gssapi/7/contrib/bind9/lib/dns/resolver.c ============================================================================== --- user/dfr/gssapi/7/contrib/bind9/lib/dns/resolver.c Wed Dec 10 15:31:37 2008 (r185862) +++ user/dfr/gssapi/7/contrib/bind9/lib/dns/resolver.c Wed Dec 10 16:02:54 2008 (r185863) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: resolver.c,v 1.284.18.66.8.1 2008/05/22 21:28:06 each Exp $ */ +/* $Id: resolver.c,v 1.284.18.66.8.4 2008/07/24 05:00:48 jinmei Exp $ */ /*! \file */ @@ -1123,7 +1123,7 @@ fctx_query(fetchctx_t *fctx, dns_adbaddr goto cleanup_query; #ifndef BROKEN_TCP_BIND_BEFORE_CONNECT - result = isc_socket_bind(query->tcpsocket, &addr); + result = isc_socket_bind(query->tcpsocket, &addr, 0); if (result != ISC_R_SUCCESS) goto cleanup_socket; #endif @@ -2689,6 +2689,8 @@ fctx_destroy(fetchctx_t *fctx) { static void fctx_timeout(isc_task_t *task, isc_event_t *event) { fetchctx_t *fctx = event->ev_arg; + isc_timerevent_t *tevent = (isc_timerevent_t *)event; + resquery_t *query; REQUIRE(VALID_FCTX(fctx)); @@ -2704,8 +2706,18 @@ fctx_timeout(isc_task_t *task, isc_event fctx->timeouts++; /* * We could cancel the running queries here, or we could let - * them keep going. Right now we choose the latter... - */ + * them keep going. Since we normally use separate sockets for + * different queries, we adopt the former approach to reduce + * the number of open sockets: cancel the oldest query if it + * expired after the query had started (this is usually the + * case but is not always so, depending on the task schedule + * timing). + */ + query = ISC_LIST_HEAD(fctx->queries); + if (query != NULL && + isc_time_compare(&tevent->due, &query->start) >= 0) { + fctx_cancelquery(&query, NULL, NULL, ISC_TRUE); + } fctx->attributes &= ~FCTX_ATTR_ADDRWAIT; /* * Our timer has triggered. Reestablish the fctx lifetime Modified: user/dfr/gssapi/7/contrib/bind9/lib/dns/xfrin.c ============================================================================== --- user/dfr/gssapi/7/contrib/bind9/lib/dns/xfrin.c Wed Dec 10 15:31:37 2008 (r185862) +++ user/dfr/gssapi/7/contrib/bind9/lib/dns/xfrin.c Wed Dec 10 16:02:54 2008 (r185863) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: xfrin.c,v 1.135.18.16 2007/10/31 01:59:47 marka Exp $ */ +/* $Id: xfrin.c,v 1.135.18.16.10.3 2008/07/23 23:16:43 marka Exp $ */ /*! \file */ @@ -862,7 +862,8 @@ xfrin_start(dns_xfrin_ctx_t *xfr) { isc_sockettype_tcp, &xfr->socket)); #ifndef BROKEN_TCP_BIND_BEFORE_CONNECT - CHECK(isc_socket_bind(xfr->socket, &xfr->sourceaddr)); + CHECK(isc_socket_bind(xfr->socket, &xfr->sourceaddr, + ISC_SOCKET_REUSEADDRESS)); #endif CHECK(isc_socket_connect(xfr->socket, &xfr->masteraddr, xfr->task, xfrin_connect_done, xfr)); Modified: user/dfr/gssapi/7/contrib/bind9/lib/isc/api ============================================================================== --- user/dfr/gssapi/7/contrib/bind9/lib/isc/api Wed Dec 10 15:31:37 2008 (r185862) +++ user/dfr/gssapi/7/contrib/bind9/lib/isc/api Wed Dec 10 16:02:54 2008 (r185863) @@ -1,3 +1,3 @@ -LIBINTERFACE = 32 -LIBREVISION = 5 +LIBINTERFACE = 35 +LIBREVISION = 0 LIBAGE = 0 Modified: user/dfr/gssapi/7/contrib/bind9/lib/isc/include/isc/resource.h ============================================================================== --- user/dfr/gssapi/7/contrib/bind9/lib/isc/include/isc/resource.h Wed Dec 10 15:31:37 2008 (r185862) +++ user/dfr/gssapi/7/contrib/bind9/lib/isc/include/isc/resource.h Wed Dec 10 16:02:54 2008 (r185863) @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2005, 2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: resource.h,v 1.5.18.2 2005/04/29 00:17:02 marka Exp $ */ +/* $Id: resource.h,v 1.5.18.2.52.2 2008/07/23 23:48:17 tbox Exp $ */ #ifndef ISC_RESOURCE_H #define ISC_RESOURCE_H 1 @@ -81,6 +81,19 @@ isc_resource_getlimit(isc_resource_t res *\li #ISC_R_NOTIMPLEMENTED 'resource' is not a type known by the OS. */ +isc_result_t +isc_resource_curlimit(isc_resource_t resource, isc_resourcevalue_t *value); +/* + * Get the current limit on a resource. + * + * Requires: + * 'resource' is a valid member of the isc_resource_t enumeration. + * + * Returns: + * ISC_R_SUCCESS Success. + * ISC_R_NOTIMPLEMENTED 'resource' is not a type known by the OS. + */ + ISC_LANG_ENDDECLS #endif /* ISC_RESOURCE_H */ Modified: user/dfr/gssapi/7/contrib/bind9/lib/isc/include/isc/socket.h ============================================================================== --- user/dfr/gssapi/7/contrib/bind9/lib/isc/include/isc/socket.h Wed Dec 10 15:31:37 2008 (r185862) +++ user/dfr/gssapi/7/contrib/bind9/lib/isc/include/isc/socket.h Wed Dec 10 16:02:54 2008 (r185863) @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2006, 2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2002 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: socket.h,v 1.57.18.6 2006/06/07 00:29:45 marka Exp $ */ +/* $Id: socket.h,v 1.57.18.6.46.4 2008/07/23 23:16:43 marka Exp $ */ #ifndef ISC_SOCKET_H #define ISC_SOCKET_H 1 @@ -77,6 +77,12 @@ ISC_LANG_BEGINDECLS */ #define ISC_SOCKET_MAXSCATTERGATHER 8 +/*% + * In isc_socket_bind() set socket option SO_REUSEADDR prior to calling + * bind() if a non zero port is specified (AF_INET and AF_INET6). + */ +#define ISC_SOCKET_REUSEADDRESS 0x01U + /*** *** Types ***/ @@ -312,7 +318,8 @@ isc_socket_detach(isc_socket_t **socketp */ isc_result_t -isc_socket_bind(isc_socket_t *sock, isc_sockaddr_t *addressp); +isc_socket_bind(isc_socket_t *sock, isc_sockaddr_t *addressp, + unsigned int options); /*%< * Bind 'socket' to '*addressp'. * @@ -747,6 +754,12 @@ isc_socket_permunix(isc_sockaddr_t *sock * \li #ISC_R_FAILURE */ +void +isc__socketmgr_setreserved(isc_socketmgr_t *mgr, isc_uint32_t); +/*%< + * Temporary. For use by named only. + */ + ISC_LANG_ENDDECLS #endif /* ISC_SOCKET_H */ Modified: user/dfr/gssapi/7/contrib/bind9/lib/isc/include/isc/timer.h ============================================================================== --- user/dfr/gssapi/7/contrib/bind9/lib/isc/include/isc/timer.h Wed Dec 10 15:31:37 2008 (r185862) +++ user/dfr/gssapi/7/contrib/bind9/lib/isc/include/isc/timer.h Wed Dec 10 16:02:54 2008 (r185863) @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2005, 2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2002 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: timer.h,v 1.31.18.3 2005/10/26 06:50:50 marka Exp $ */ +/* $Id: timer.h,v 1.31.18.3.52.2 2008/07/24 23:48:09 tbox Exp $ */ #ifndef ISC_TIMER_H #define ISC_TIMER_H 1 @@ -76,6 +76,7 @@ #include #include #include +#include ISC_LANG_BEGINDECLS @@ -93,6 +94,7 @@ typedef enum { typedef struct isc_timerevent { struct isc_event common; + isc_time_t due; } isc_timerevent_t; #define ISC_TIMEREVENT_FIRSTEVENT (ISC_EVENTCLASS_TIMER + 0) Modified: user/dfr/gssapi/7/contrib/bind9/lib/isc/timer.c ============================================================================== --- user/dfr/gssapi/7/contrib/bind9/lib/isc/timer.c Wed Dec 10 15:31:37 2008 (r185862) +++ user/dfr/gssapi/7/contrib/bind9/lib/isc/timer.c Wed Dec 10 16:02:54 2008 (r185863) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: timer.c,v 1.73.18.7 2007/10/24 23:46:26 tbox Exp $ */ +/* $Id: timer.c,v 1.73.18.7.10.3 2008/07/29 18:35:53 jinmei Exp $ */ /*! \file */ @@ -577,7 +577,7 @@ isc_timer_detach(isc_timer_t **timerp) { static void dispatch(isc_timermgr_t *manager, isc_time_t *now) { isc_boolean_t done = ISC_FALSE, post_event, need_schedule; - isc_event_t *event; + isc_timerevent_t *event; isc_eventtype_t type = 0; isc_timer_t *timer; isc_result_t result; @@ -650,16 +650,18 @@ dispatch(isc_timermgr_t *manager, isc_ti /* * XXX We could preallocate this event. */ - event = isc_event_allocate(manager->mctx, + event = (isc_timerevent_t *)isc_event_allocate(manager->mctx, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Wed Dec 10 16:20:51 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09C871065679; Wed, 10 Dec 2008 16:20:51 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB64B8FC13; Wed, 10 Dec 2008 16:20:50 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBAGKoBF036135; Wed, 10 Dec 2008 16:20:50 GMT (envelope-from dfr@svn.freebsd.org) Received: (from dfr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBAGKnAc036108; Wed, 10 Dec 2008 16:20:49 GMT (envelope-from dfr@svn.freebsd.org) Message-Id: <200812101620.mBAGKnAc036108@svn.freebsd.org> From: Doug Rabson Date: Wed, 10 Dec 2008 16:20:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185865 - in user/dfr/gssapi/6: . bin/cp contrib/bind9 contrib/ntp contrib/openpam contrib/sendmail contrib/tcsh contrib/telnet crypto/heimdal etc etc/defaults etc/rc.d games/fortune/fo... X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2008 16:20:51 -0000 Author: dfr Date: Wed Dec 10 16:20:49 2008 New Revision: 185865 URL: http://svn.freebsd.org/changeset/base/185865 Log: MF6: 184967:185863 Added: user/dfr/gssapi/6/share/man/man4/nfe.4 - copied unchanged from r185863, stable/6/share/man/man4/nfe.4 user/dfr/gssapi/6/sys/dev/nfe/ - copied from r185863, stable/6/sys/dev/nfe/ user/dfr/gssapi/6/sys/modules/nfe/ - copied from r185863, stable/6/sys/modules/nfe/ Modified: user/dfr/gssapi/6/ (props changed) user/dfr/gssapi/6/Makefile.inc1 (props changed) user/dfr/gssapi/6/bin/cp/ (props changed) user/dfr/gssapi/6/contrib/bind9/ (props changed) user/dfr/gssapi/6/contrib/ntp/ (props changed) user/dfr/gssapi/6/contrib/openpam/ (props changed) user/dfr/gssapi/6/contrib/sendmail/ (props changed) user/dfr/gssapi/6/contrib/tcsh/ (props changed) user/dfr/gssapi/6/contrib/telnet/ (props changed) user/dfr/gssapi/6/crypto/heimdal/ (props changed) user/dfr/gssapi/6/etc/ (props changed) user/dfr/gssapi/6/etc/defaults/ (props changed) user/dfr/gssapi/6/etc/rc.d/ (props changed) user/dfr/gssapi/6/games/fortune/fortune/ (props changed) user/dfr/gssapi/6/include/ (props changed) user/dfr/gssapi/6/lib/libarchive/ (props changed) user/dfr/gssapi/6/lib/libbluetooth/ (props changed) user/dfr/gssapi/6/lib/libc/ (props changed) user/dfr/gssapi/6/lib/libc/gen/times.3 user/dfr/gssapi/6/lib/libc/sys/ (props changed) user/dfr/gssapi/6/lib/libcam/ (props changed) user/dfr/gssapi/6/lib/libcam/camlib.c user/dfr/gssapi/6/lib/libexpat/ (props changed) user/dfr/gssapi/6/lib/libfetch/ (props changed) user/dfr/gssapi/6/lib/libftpio/ (props changed) user/dfr/gssapi/6/lib/libgeom/ (props changed) user/dfr/gssapi/6/lib/libpam/ (props changed) user/dfr/gssapi/6/lib/libutil/ (props changed) user/dfr/gssapi/6/libexec/rpc.rstatd/ (props changed) user/dfr/gssapi/6/release/ (props changed) user/dfr/gssapi/6/release/doc/en_US.ISO8859-1/errata/article.sgml user/dfr/gssapi/6/release/doc/share/sgml/release.ent user/dfr/gssapi/6/release/scripts/src-install.sh (props changed) user/dfr/gssapi/6/sbin/devfs/ (props changed) user/dfr/gssapi/6/sbin/dhclient/ (props changed) user/dfr/gssapi/6/sbin/fdisk/ (props changed) user/dfr/gssapi/6/sbin/mount_nfs/ (props changed) user/dfr/gssapi/6/sbin/ping6/ (props changed) user/dfr/gssapi/6/sbin/routed/main.c (props changed) user/dfr/gssapi/6/share/colldef/ (props changed) user/dfr/gssapi/6/share/man/man4/ (props changed) user/dfr/gssapi/6/share/man/man4/Makefile user/dfr/gssapi/6/share/man/man4/polling.4 user/dfr/gssapi/6/share/man/man4/xl.4 (props changed) user/dfr/gssapi/6/share/man/man5/ (props changed) user/dfr/gssapi/6/share/man/man5/fstab.5 user/dfr/gssapi/6/share/man/man7/ports.7 (props changed) user/dfr/gssapi/6/share/man/man9/ (props changed) user/dfr/gssapi/6/share/mk/ (props changed) user/dfr/gssapi/6/share/sendmail/ (props changed) user/dfr/gssapi/6/share/syscons/keymaps/ (props changed) user/dfr/gssapi/6/share/timedef/ (props changed) user/dfr/gssapi/6/share/zoneinfo/ (props changed) user/dfr/gssapi/6/sys/ (props changed) user/dfr/gssapi/6/sys/alpha/alpha/uma_machdep.c user/dfr/gssapi/6/sys/amd64/amd64/uma_machdep.c user/dfr/gssapi/6/sys/amd64/conf/NOTES user/dfr/gssapi/6/sys/boot/forth/loader.conf.5 user/dfr/gssapi/6/sys/conf/files.amd64 user/dfr/gssapi/6/sys/conf/files.i386 user/dfr/gssapi/6/sys/conf/newvers.sh user/dfr/gssapi/6/sys/dev/mii/ciphy.c user/dfr/gssapi/6/sys/dev/mii/ciphyreg.h user/dfr/gssapi/6/sys/dev/mii/miidevs user/dfr/gssapi/6/sys/dev/mii/rlphy.c user/dfr/gssapi/6/sys/dev/puc/pucdata.c user/dfr/gssapi/6/sys/dev/random/randomdev.c user/dfr/gssapi/6/sys/dev/random/randomdev_soft.c user/dfr/gssapi/6/sys/i386/conf/NOTES user/dfr/gssapi/6/sys/i386/cpufreq/p4tcc.c user/dfr/gssapi/6/sys/ia64/ia64/uma_machdep.c user/dfr/gssapi/6/sys/kern/vfs_aio.c user/dfr/gssapi/6/sys/modules/Makefile user/dfr/gssapi/6/sys/pci/if_dc.c user/dfr/gssapi/6/sys/powerpc/powerpc/uma_machdep.c user/dfr/gssapi/6/sys/sparc64/sparc64/vm_machdep.c user/dfr/gssapi/6/tools/regression/file/flock/ (props changed) user/dfr/gssapi/6/tools/regression/usr.bin/ (props changed) user/dfr/gssapi/6/tools/regression/usr.bin/calendar/ (props changed) user/dfr/gssapi/6/usr.bin/calendar/ (props changed) user/dfr/gssapi/6/usr.bin/cksum/ (props changed) user/dfr/gssapi/6/usr.bin/fetch/ (props changed) user/dfr/gssapi/6/usr.bin/gzip/ (props changed) user/dfr/gssapi/6/usr.bin/ipcrm/ (props changed) user/dfr/gssapi/6/usr.bin/ipcs/ (props changed) user/dfr/gssapi/6/usr.bin/ldd/ (props changed) user/dfr/gssapi/6/usr.bin/lockf/ (props changed) user/dfr/gssapi/6/usr.bin/make/ (props changed) user/dfr/gssapi/6/usr.bin/netstat/ (props changed) user/dfr/gssapi/6/usr.bin/rpcgen/ (props changed) user/dfr/gssapi/6/usr.bin/shar/ (props changed) user/dfr/gssapi/6/usr.bin/su/ (props changed) user/dfr/gssapi/6/usr.bin/tar/ (props changed) user/dfr/gssapi/6/usr.bin/truncate/ (props changed) user/dfr/gssapi/6/usr.bin/units/ (props changed) user/dfr/gssapi/6/usr.bin/whereis/ (props changed) user/dfr/gssapi/6/usr.bin/window/ (props changed) user/dfr/gssapi/6/usr.bin/xargs/ (props changed) user/dfr/gssapi/6/usr.bin/xargs/xargs.1 user/dfr/gssapi/6/usr.sbin/ (props changed) user/dfr/gssapi/6/usr.sbin/adduser/ (props changed) user/dfr/gssapi/6/usr.sbin/cdcontrol/ (props changed) user/dfr/gssapi/6/usr.sbin/config/ (props changed) user/dfr/gssapi/6/usr.sbin/cron/ (props changed) user/dfr/gssapi/6/usr.sbin/freebsd-update/ (props changed) user/dfr/gssapi/6/usr.sbin/mergemaster/ (props changed) user/dfr/gssapi/6/usr.sbin/mergemaster/mergemaster.sh user/dfr/gssapi/6/usr.sbin/mountd/ (props changed) user/dfr/gssapi/6/usr.sbin/mtree/ (props changed) user/dfr/gssapi/6/usr.sbin/newsyslog/newsyslog.conf.5 (props changed) user/dfr/gssapi/6/usr.sbin/ntp/ (props changed) user/dfr/gssapi/6/usr.sbin/ntp/doc/ (props changed) user/dfr/gssapi/6/usr.sbin/pkg_install/ (props changed) user/dfr/gssapi/6/usr.sbin/portsnap/ (props changed) user/dfr/gssapi/6/usr.sbin/pw/ (props changed) user/dfr/gssapi/6/usr.sbin/rpc.lockd/ (props changed) user/dfr/gssapi/6/usr.sbin/rpc.statd/ (props changed) user/dfr/gssapi/6/usr.sbin/sysinstall/ (props changed) user/dfr/gssapi/6/usr.sbin/syslogd/ (props changed) user/dfr/gssapi/6/usr.sbin/tzsetup/ (props changed) Modified: user/dfr/gssapi/6/lib/libc/gen/times.3 ============================================================================== --- user/dfr/gssapi/6/lib/libc/gen/times.3 Wed Dec 10 16:11:09 2008 (r185864) +++ user/dfr/gssapi/6/lib/libc/gen/times.3 Wed Dec 10 16:20:49 2008 (r185865) @@ -32,7 +32,7 @@ .\" @(#)times.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd December 1, 2008 .Dt TIMES 3 .Os .Sh NAME @@ -56,9 +56,13 @@ The .Fn times function returns the value of time in .Dv CLK_TCK Ns 's -of a second since -0 hours, 0 minutes, 0 seconds, January 1, 1970, Coordinated Universal -Time. +of a second since the system startup time. +The current value of +.Dv CLK_TCK , +the frequency of the statistics clock in ticks per second, may be +obtained through the +.Xr sysconf 3 +interface. .Pp It also fills in the structure pointed to by .Fa tp @@ -135,6 +139,7 @@ and .Xr getrusage 2 , .Xr gettimeofday 2 , .Xr wait 2 , +.Xr sysconf 3 , .Xr clocks 7 .Sh STANDARDS The Modified: user/dfr/gssapi/6/lib/libcam/camlib.c ============================================================================== --- user/dfr/gssapi/6/lib/libcam/camlib.c Wed Dec 10 16:11:09 2008 (r185864) +++ user/dfr/gssapi/6/lib/libcam/camlib.c Wed Dec 10 16:20:49 2008 (r185865) @@ -346,6 +346,9 @@ cam_open_btl(path_id_t path_id, target_i bzero(&ccb, sizeof(union ccb)); ccb.ccb_h.func_code = XPT_DEV_MATCH; + ccb.ccb_h.path_id = CAM_XPT_PATH_ID; + ccb.ccb_h.target_id = CAM_TARGET_WILDCARD; + ccb.ccb_h.target_lun = CAM_LUN_WILDCARD; /* Setup the result buffer */ bufsize = sizeof(struct dev_match_result); Modified: user/dfr/gssapi/6/release/doc/en_US.ISO8859-1/errata/article.sgml ============================================================================== --- user/dfr/gssapi/6/release/doc/en_US.ISO8859-1/errata/article.sgml Wed Dec 10 16:11:09 2008 (r185864) +++ user/dfr/gssapi/6/release/doc/en_US.ISO8859-1/errata/article.sgml Wed Dec 10 16:20:49 2008 (r185865) @@ -16,7 +16,7 @@ %release; - + ]>
@@ -62,7 +62,8 @@ &os;. This errata document for &os; &release.bugfix; - will be maintained until the release of &os; &release.next;. + will be maintained until the end of 6.4-STABLE development + line support. @@ -96,21 +97,7 @@ Late-Breaking News and Corrections - [20080204] The ISO images of &os; &release.bugfix; are sized - for 700MB CD-ROM media (ISO images of all prior versions assumed - 650MB media). This fact should have been mentioned in the - release notes. - - [20080204] Contrary to the release notes, ipfwpcap(8) - is not a feature included in &os; - &release.bugfix;. It was merged to the &release.branch; - codeline after the release branch was created. This utility - will be included in subsequent snapshots of &release.branch; and in - &release.next;. - - [20080229] The release notes gave an incorrect version - number for KDE. The correct version number is 3.5.8. - + No news. @@ -120,7 +107,9 @@ For more information, consult the individual advisories available from . + No advisories. + Known Problems and Solutions - [20080229] A bug in Linux emulation may cause segmentation - faults for some Linux programs using &man.mmap.2;. This issue - has been fixed on the HEAD and RELENG_6 branches. - - [20080229, updated 20080420] Multithreaded programs that perform a - &man.fork.2; operation may crash due to a race condition in the - threading library. This problem has been fixed on the HEAD, - RELENG_6, and RELENG_6_3 branches, and is addressed by errata - notice - FreeBSD-EN-08:01.libpthread. - - - [20080307] When using &man.sysinstall.8; to install the - X.org packages, selecting only specific components to be - installed may result in - the x11/xorg-drivers package - not being installed, and a corresponding failure of X.org server - to configure itself correctly. The recommended way to a - functioning X.org installation is simply to - select All from the Distributions - menu. - - [20080420] A reference counting bug in the IP multicast code - could cause kernel panics under some circumstances. It has been - fixed on the RELENG_6 branch by - revision 1.85.2.10 - of sys/netinet/in.c. - + No news.
Modified: user/dfr/gssapi/6/release/doc/share/sgml/release.ent ============================================================================== --- user/dfr/gssapi/6/release/doc/share/sgml/release.ent Wed Dec 10 16:11:09 2008 (r185864) +++ user/dfr/gssapi/6/release/doc/share/sgml/release.ent Wed Dec 10 16:20:49 2008 (r185865) @@ -6,7 +6,7 @@ - + - - - + + - + Modified: user/dfr/gssapi/6/share/man/man4/Makefile ============================================================================== --- user/dfr/gssapi/6/share/man/man4/Makefile Wed Dec 10 16:11:09 2008 (r185864) +++ user/dfr/gssapi/6/share/man/man4/Makefile Wed Dec 10 16:20:49 2008 (r185865) @@ -180,6 +180,7 @@ MAN= aac.4 \ ncv.4 \ netgraph.4 \ netintro.4 \ + ${_nfe.4} \ ${_nfsmb.4} \ ng_async.4 \ ng_atm.4 \ @@ -469,6 +470,7 @@ MLINKS+=mxge.4 if_mxge.4 MLINKS+=my.4 if_my.4 MLINKS+=netintro.4 net.4 \ netintro.4 networking.4 +MLINKS+=${_nfe.4} ${_if_nfe.4} MLINKS+=nge.4 if_nge.4 MLINKS+=${_nve.4} ${_if_nve.4} MLINKS+=oldcard.4 card.4 @@ -522,9 +524,11 @@ MLINKS+=watchdog.4 SW_WATCHDOG.4 .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" _amdsmb.4= amdsmb.4 _coretemp.4= coretemp.4 +_if_nfe.4= if_nfe.4 _if_nve.4= if_nve.4 _ipmi.4= ipmi.4 _nfsmb.4= nfsmb.4 +_nfe.4= nfe.4 _nve.4= nve.4 _rr232x.4= rr232x.4 _spkr.4= spkr.4 Copied: user/dfr/gssapi/6/share/man/man4/nfe.4 (from r185863, stable/6/share/man/man4/nfe.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/dfr/gssapi/6/share/man/man4/nfe.4 Wed Dec 10 16:20:49 2008 (r185865, copy of r185863, stable/6/share/man/man4/nfe.4) @@ -0,0 +1,202 @@ +.\" $OpenBSD: nfe.4,v 1.7 2006/02/28 08:13:47 jsg Exp $ +.\" +.\" Copyright (c) 2006 Jonathan Gray +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.\" $FreeBSD$ +.\" +.Dd October 2, 2008 +.Dt NFE 4 +.Os +.Sh NAME +.Nm nfe +.Nd "NVIDIA nForce MCP Ethernet driver" +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device miibus" +.Cd "device nfe" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_nfe_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver supports PCI Ethernet adapters based on the NVIDIA +nForce Media and Communications Processors (MCP), such as +the nForce, nForce 2, nForce 3, CK804, MCP04, MCP51, MCP55, +MCP61, MCP65, MCP67, MCP73, MCP77 and MCP79 Ethernet +controller chips. +.Pp +Supported features include (hardware support provided): +.Pp +.Bl -bullet -compact +.It +Receive/Transmit IP/TCP/UDP checksum offload +.It +Hardware VLAN tag insertion/stripping +.It +TCP segmentation offload (TSO) +.It +MSI/MSI-X +.It +Jumbo Frames +.El +.Pp +Support for Jumbo Frames is provided via the interface MTU setting. +Selecting an MTU larger than 1500 bytes with the +.Xr ifconfig 8 +utility configures the adapter to receive and transmit Jumbo Frames. +.Pp +The +.Nm +driver supports the following media types: +.Bl -tag -width "10baseT/UTP" +.It Cm autoselect +Enable autoselection of the media type and options. +.It Cm 10baseT/UTP +Set 10Mbps operation. +.It Cm 100baseTX +Set 100Mbps (Fast Ethernet) operation. +.It Cm 1000baseT +Set 1000Mbps (Gigabit Ethernet) operation (recent models only). +.El +.Pp +The +.Nm +driver supports the following media options: +.Bl -tag -width ".Cm 10baseT/UTP" +.It Cm half-duplex +Force half duplex operation. +.It Cm full-duplex +Force full duplex operation. +.El +.Pp +For more information on configuring this device, see +.Xr ifconfig 8 . +.Sh HARDWARE +The +.Nm +driver supports the following NVIDIA MCP onboard adapters: +.Pp +.Bl -bullet -compact +.It +NVIDIA nForce MCP Networking Adapter +.It +NVIDIA nForce MCP04 Networking Adapter +.It +NVIDIA nForce 430 MCP12 Networking Adapter +.It +NVIDIA nForce 430 MCP13 Networking Adapter +.It +NVIDIA nForce MCP51 Networking Adapter +.It +NVIDIA nForce MCP55 Networking Adapter +.It +NVIDIA nForce MCP61 Networking Adapter +.It +NVIDIA nForce MCP65 Networking Adapter +.It +NVIDIA nForce MCP67 Networking Adapter +.It +NVIDIA nForce MCP73 Networking Adapter +.It +NVIDIA nForce MCP77 Networking Adapter +.It +NVIDIA nForce MCP79 Networking Adapter +.It +NVIDIA nForce2 MCP2 Networking Adapter +.It +NVIDIA nForce2 400 MCP4 Networking Adapter +.It +NVIDIA nForce2 400 MCP5 Networking Adapter +.It +NVIDIA nForce3 MCP3 Networking Adapter +.It +NVIDIA nForce3 250 MCP6 Networking Adapter +.It +NVIDIA nForce3 MCP7 Networking Adapter +.It +NVIDIA nForce4 CK804 MCP8 Networking Adapter +.It +NVIDIA nForce4 CK804 MCP9 Networking Adapter +.El +.Sh LOADER TUNABLES +Tunables can be set at the +.Xr loader 8 +prompt before booting the kernel or stored in +.Xr loader.conf 5 . +.Bl -tag -width indent +.It Va hw.nfe.msi_disable +Whether or not MSI support is enabled in the driver. +The default value is 0. +.It Va hw.nfe.msix_disable +Whether or not MSI-X support is enabled in the driver. +The default value is 0. +.El +.Sh SYSCTL VARIABLES +The following +.Xr sysctl 8 +variables can be used to modify or monitor +.Nm +behavior. +.Bl -tag -width indent +.It Va dev.nfe.%d.process_limit +Maximum number of Rx events to be processed in the event loop +before rescheduling a taskqueue. +The accepted range is 50 to 255, the default value is 192. +The interface does not need to be brought down and up again +before a change takes effect. +.El +.Sh SEE ALSO +.Xr altq 4 , +.Xr arp 4 , +.Xr intro 4 , +.Xr miibus 4 , +.Xr netintro 4 , +.Xr pci 4 , +.Xr polling 4 , +.Xr sysctl 8 , +.Xr ifconfig 8 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Ox 3.9 , +and then in +.Fx 7.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Jonathan Gray +.Aq jsg@openbsd.org +and +.An Damien Bergamini +.Aq damien@openbsd.org . +The +.Nm +driver was ported to +.Fx +by +.An Shigeaki Tagashira +.Aq shigeaki@se.hiroshima-u.ac.jp . Modified: user/dfr/gssapi/6/share/man/man4/polling.4 ============================================================================== --- user/dfr/gssapi/6/share/man/man4/polling.4 Wed Dec 10 16:11:09 2008 (r185864) +++ user/dfr/gssapi/6/share/man/man4/polling.4 Wed Dec 10 16:20:49 2008 (r185865) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 2, 2006 +.Dd April 6, 2007 .Dt POLLING 4 .Os .Sh NAME @@ -184,6 +184,7 @@ As of this writing, the .Xr fwip 4 , .Xr fxp 4 , .Xr ixgb 4 , +.Xr nfe 4 , .Xr nge 4 , .Xr re 4 , .Xr rl 4 , Modified: user/dfr/gssapi/6/share/man/man5/fstab.5 ============================================================================== --- user/dfr/gssapi/6/share/man/man5/fstab.5 Wed Dec 10 16:11:09 2008 (r185864) +++ user/dfr/gssapi/6/share/man/man5/fstab.5 Wed Dec 10 16:20:49 2008 (r185865) @@ -32,7 +32,7 @@ .\" @(#)fstab.5 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd June 5, 1993 +.Dd November 23, 2008 .Dt FSTAB 5 .Os .Sh NAME @@ -64,15 +64,8 @@ doing their thing. .Pp The first field, .Pq Fa fs_spec , -describes the block special device or +describes the special device or remote file system to be mounted. -For file systems of type -.Em ufs , -the special file name is the block special file name, -and not the character special file name. -If a program needs the character special file name, -the program must create it by appending a ``r'' after the -last ``/'' in the special file name. .Pp The second field, .Pq Fa fs_file , @@ -98,8 +91,7 @@ describes the mount options associated w It is formatted as a comma separated list of options. It contains at least the type of mount (see .Fa fs_type -below) plus any additional options -appropriate to the file system type. +below) plus any additional options appropriate to the file system type. See the options flag .Pq Fl o in the @@ -107,6 +99,32 @@ in the page and the file system specific page, such as .Xr mount_nfs 8 , for additional options that may be specified. +All options that can be given to the file system specific mount commands +can be used in +.Nm +as well. +They just need to be formatted a bit differently. +The arguments of the +.Fl o +option can be used without the preceding +.Fl o +flag. +Other options need both the file system specific flag and its argument, +separated by an equal sign. +For example, mounting an +.Xr msdosfs 5 +filesystem, the options +.Bd -literal -offset indent +-o sync -o noatime -m 644 -M 755 -u foo -g bar +.Ed +.Pp +should be written as +.Bd -literal -offset indent +sync,noatime,-m=644,-M=755,-u=foo,-g=bar +.Ed +.Pp +in the option field of +.Nm . .Pp If the options ``userquota'' and/or ``groupquota'' are specified, the file system is automatically processed by the @@ -186,20 +204,72 @@ The sixth field, .Pq Fa fs_passno , is used by the .Xr fsck 8 -program to determine the order in which file system checks are done -at reboot time. +and +.Xr quotacheck 8 +programs to determine the order in which file system and quota +checks are done at reboot time. +The +.Fa fs_passno +field can be any value between 0 and +.Ql INT_MAX Ns -1 . +.Pp The root file system should be specified with a .Fa fs_passno of 1, and other file systems should have a .Fa fs_passno -of 2. -File systems within a drive will be checked sequentially, +of 2 or greater. +A file system with a +.Fa fs_passno +value of 1 is always checked sequentially and be completed before +another file system is processed, and it will be processed before +all file systems with a larger +.Fa fs_passno . +.Pp +For any given value of +.Fa fs_passno , +file systems within a drive will be checked sequentially, but file systems on different drives will be checked at the same time to utilize parallelism available in the hardware. +Once all file system checks are complete for the current +.Fa fs_passno , +the same process will start over for the next +.Fa fs_passno . +.Pp If the sixth field is not present or is zero, a value of zero is returned and .Xr fsck 8 +and +.Xr quotacheck 8 will assume that the file system does not need to be checked. +.Pp +The +.Fa fs_passno +field can be used to implement finer control when +the system utilities may determine that the file system resides +on a different physical device, when it actually does not, as with a +.Xr ccd 4 +device. +All file systems with a lower +.Fa fs_passno +value will be completed before starting on file systems with a +higher +.Fa fs_passno +value. +E.g. all file systems with a +.Fa fs_passno +of 2 will be completed before any file systems with a +.Fa fs_passno +of 3 or greater are started. +Gaps are allowed between the different +.Fa fs_passno +values. +E.g. file systems listed in +.Pa /etc/fstab +may have +.Fa fs_passno +values such as 0, 1, 2, 15, 100, 200, 300, and may appear in any order +within +.Pa /etc/fstab . .Bd -literal #define FSTAB_RW "rw" /* read/write device */ #define FSTAB_RQ "rq" /* read/write with quotas */ @@ -237,6 +307,7 @@ resides in .Sh SEE ALSO .Xr getfsent 3 , .Xr getvfsbyname 3 , +.Xr ccd 4 , .Xr dump 8 , .Xr fsck 8 , .Xr mount 8 , Modified: user/dfr/gssapi/6/sys/alpha/alpha/uma_machdep.c ============================================================================== --- user/dfr/gssapi/6/sys/alpha/alpha/uma_machdep.c Wed Dec 10 16:11:09 2008 (r185864) +++ user/dfr/gssapi/6/sys/alpha/alpha/uma_machdep.c Wed Dec 10 16:20:49 2008 (r185865) @@ -49,9 +49,9 @@ uma_small_alloc(uma_zone_t zone, int byt *flags = UMA_SLAB_PRIV; if ((wait & (M_NOWAIT | M_USE_RESERVE)) == M_NOWAIT) - pflags = VM_ALLOC_INTERRUPT; + pflags = VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED; else - pflags = VM_ALLOC_SYSTEM; + pflags = VM_ALLOC_SYSTEM | VM_ALLOC_WIRED; if (wait & M_ZERO) pflags |= VM_ALLOC_ZERO; for (;;) { @@ -76,7 +76,9 @@ uma_small_free(void *mem, int size, u_in vm_page_t m; m = PHYS_TO_VM_PAGE(ALPHA_K0SEG_TO_PHYS((vm_offset_t)mem)); + m->wire_count--; vm_page_lock_queues(); vm_page_free(m); vm_page_unlock_queues(); + atomic_subtract_int(&cnt.v_wire_count, 1); } Modified: user/dfr/gssapi/6/sys/amd64/amd64/uma_machdep.c ============================================================================== --- user/dfr/gssapi/6/sys/amd64/amd64/uma_machdep.c Wed Dec 10 16:11:09 2008 (r185864) +++ user/dfr/gssapi/6/sys/amd64/amd64/uma_machdep.c Wed Dec 10 16:20:49 2008 (r185865) @@ -50,9 +50,9 @@ uma_small_alloc(uma_zone_t zone, int byt *flags = UMA_SLAB_PRIV; if ((wait & (M_NOWAIT|M_USE_RESERVE)) == M_NOWAIT) - pflags = VM_ALLOC_INTERRUPT; + pflags = VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED; else - pflags = VM_ALLOC_SYSTEM; + pflags = VM_ALLOC_SYSTEM | VM_ALLOC_WIRED; if (wait & M_ZERO) pflags |= VM_ALLOC_ZERO; for (;;) { @@ -82,7 +82,9 @@ uma_small_free(void *mem, int size, u_in pa = DMAP_TO_PHYS((vm_offset_t)mem); dump_drop_page(pa); m = PHYS_TO_VM_PAGE(pa); + m->wire_count--; vm_page_lock_queues(); vm_page_free(m); vm_page_unlock_queues(); + atomic_subtract_int(&cnt.v_wire_count, 1); } Modified: user/dfr/gssapi/6/sys/amd64/conf/NOTES ============================================================================== --- user/dfr/gssapi/6/sys/amd64/conf/NOTES Wed Dec 10 16:11:09 2008 (r185864) +++ user/dfr/gssapi/6/sys/amd64/conf/NOTES Wed Dec 10 16:20:49 2008 (r185865) @@ -234,6 +234,7 @@ options DRM_DEBUG # Include debug print # lnc: Lance/PCnet cards (Isolan, Novell NE2100, NE32-VL, AMD Am7990 and # Am79C960) # mxge: Myricom Myri-10G 10GbE NIC +# nfe: nVidia nForce MCP on-board Ethernet Networking (BSD open source) # nve: nVidia nForce MCP on-board Ethernet Networking #XXX# still calls MD i386 kvtop function instead of vtophys etc @@ -243,6 +244,7 @@ options DRM_DEBUG # Include debug print #XXX#options ED_SIC #XXX#device lnc device mxge # Myricom Myri-10G 10GbE NIC +device nfe # nVidia nForce MCP on-board Ethernet Networking device nve # nVidia nForce MCP on-board Ethernet Networking device ath Modified: user/dfr/gssapi/6/sys/boot/forth/loader.conf.5 ============================================================================== --- user/dfr/gssapi/6/sys/boot/forth/loader.conf.5 Wed Dec 10 16:11:09 2008 (r185864) +++ user/dfr/gssapi/6/sys/boot/forth/loader.conf.5 Wed Dec 10 16:20:49 2008 (r185865) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd November 15, 2005 +.Dd January 16, 2008 .Dt LOADER.CONF 5 .Os .Sh NAME @@ -238,6 +238,16 @@ contains the instructions to automatical .Xr boot 8 , .Xr loader 8 , .Xr loader.4th 8 +.Sh BUGS +The +.Xr loader 8 +stops reading +.Nm +when it encounters a syntax error, so any options which are vital for +booting a particular system (i.e.\& +.Dq Va hw.ata.ata_dma Ns "=0" ) +should precede any experimental additions to +.Nm . .Sh HISTORY The file .Nm Modified: user/dfr/gssapi/6/sys/conf/files.amd64 ============================================================================== --- user/dfr/gssapi/6/sys/conf/files.amd64 Wed Dec 10 16:11:09 2008 (r185864) +++ user/dfr/gssapi/6/sys/conf/files.amd64 Wed Dec 10 16:20:49 2008 (r185865) @@ -200,6 +200,7 @@ dev/mxge/mxge_ethp_z8e.c optional mxge p dev/mxge/mxge_rss_eth_z8e.c optional mxge pci dev/mxge/mxge_rss_ethp_z8e.c optional mxge pci net/zlib.c optional mxge +dev/nfe/if_nfe.c optional nfe pci dev/nve/if_nve.c optional nve pci dev/nvram/nvram.c optional nvram isa dev/rr232x/os_bsd.c optional rr232x Modified: user/dfr/gssapi/6/sys/conf/files.i386 ============================================================================== --- user/dfr/gssapi/6/sys/conf/files.i386 Wed Dec 10 16:11:09 2008 (r185864) +++ user/dfr/gssapi/6/sys/conf/files.i386 Wed Dec 10 16:20:49 2008 (r185865) @@ -234,6 +234,7 @@ dev/mxge/mxge_ethp_z8e.c optional mxge p dev/mxge/mxge_rss_eth_z8e.c optional mxge pci dev/mxge/mxge_rss_ethp_z8e.c optional mxge pci net/zlib.c optional mxge +dev/nfe/if_nfe.c optional nfe pci dev/nve/if_nve.c optional nve pci dev/nvram/nvram.c optional nvram isa dev/ppc/ppc.c optional ppc Modified: user/dfr/gssapi/6/sys/conf/newvers.sh ============================================================================== --- user/dfr/gssapi/6/sys/conf/newvers.sh Wed Dec 10 16:11:09 2008 (r185864) +++ user/dfr/gssapi/6/sys/conf/newvers.sh Wed Dec 10 16:20:49 2008 (r185865) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="6.4" -BRANCH="PRERELEASE" +BRANCH="STABLE" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: user/dfr/gssapi/6/sys/dev/mii/ciphy.c ============================================================================== --- user/dfr/gssapi/6/sys/dev/mii/ciphy.c Wed Dec 10 16:11:09 2008 (r185864) +++ user/dfr/gssapi/6/sys/dev/mii/ciphy.c Wed Dec 10 16:20:49 2008 (r185865) @@ -93,6 +93,7 @@ static const struct mii_phydesc ciphys[] MII_PHY_DESC(CICADA, CS8201), MII_PHY_DESC(CICADA, CS8201A), MII_PHY_DESC(CICADA, CS8201B), + MII_PHY_DESC(VITESSE, VSC8601), MII_PHY_END }; @@ -356,11 +357,28 @@ ciphy_fixup(struct mii_softc *sc) { uint16_t model; uint16_t status, speed; + uint16_t val; model = MII_MODEL(PHY_READ(sc, CIPHY_MII_PHYIDR2)); status = PHY_READ(sc, CIPHY_MII_AUXCSR); speed = status & CIPHY_AUXCSR_SPEED; + if (strcmp(device_get_name(device_get_parent(sc->mii_dev)), + "nfe") == 0) { + /* need to set for 2.5V RGMII for NVIDIA adapters */ + val = PHY_READ(sc, CIPHY_MII_ECTL1); + val &= ~(CIPHY_ECTL1_IOVOL | CIPHY_ECTL1_INTSEL); + val |= (CIPHY_IOVOL_2500MV | CIPHY_INTSEL_RGMII); + PHY_WRITE(sc, CIPHY_MII_ECTL1, val); + /* From Linux. */ + val = PHY_READ(sc, CIPHY_MII_AUXCSR); + val |= CIPHY_AUXCSR_MDPPS; + PHY_WRITE(sc, CIPHY_MII_AUXCSR, val); + val = PHY_READ(sc, CIPHY_MII_10BTCSR); + val |= CIPHY_10BTCSR_ECHO; + PHY_WRITE(sc, CIPHY_MII_10BTCSR, val); + } + switch (model) { case MII_MODEL_CICADA_CS8201: @@ -398,6 +416,8 @@ ciphy_fixup(struct mii_softc *sc) } break; + case MII_MODEL_VITESSE_VSC8601: + break; default: device_printf(sc->mii_dev, "unknown CICADA PHY model %x\n", model); Modified: user/dfr/gssapi/6/sys/dev/mii/ciphyreg.h ============================================================================== --- user/dfr/gssapi/6/sys/dev/mii/ciphyreg.h Wed Dec 10 16:11:09 2008 (r185864) +++ user/dfr/gssapi/6/sys/dev/mii/ciphyreg.h Wed Dec 10 16:20:49 2008 (r185865) @@ -251,6 +251,16 @@ /* Extended PHY control register #1 */ #define CIPHY_MII_ECTL1 0x17 #define CIPHY_ECTL1_ACTIPHY 0x0020 /* Enable ActiPHY power saving */ +#define CIPHY_ECTL1_IOVOL 0x0e00 /* MAC interface and I/O voltage select */ +#define CIPHY_ECTL1_INTSEL 0xf000 /* select MAC interface */ + +#define CIPHY_IOVOL_3300MV 0x0000 /* 3.3V for I/O pins */ +#define CIPHY_IOVOL_2500MV 0x0200 /* 2.5V for I/O pins */ + +#define CIPHY_INTSEL_GMII 0x0000 /* GMII/MII */ +#define CIPHY_INTSEL_RGMII 0x1000 +#define CIPHY_INTSEL_TBI 0x2000 +#define CIPHY_INTSEL_RTBI 0x3000 /* Extended PHY control register #2 */ #define CIPHY_MII_ECTL2 0x18 Modified: user/dfr/gssapi/6/sys/dev/mii/miidevs ============================================================================== --- user/dfr/gssapi/6/sys/dev/mii/miidevs Wed Dec 10 16:11:09 2008 (r185864) +++ user/dfr/gssapi/6/sys/dev/mii/miidevs Wed Dec 10 16:20:49 2008 (r185865) @@ -68,6 +68,7 @@ oui SEEQ 0x00a07d Seeq oui SIS 0x00e006 Silicon Integrated Systems oui TDK 0x00c039 TDK oui TI 0x080028 Texas Instruments +oui VITESSE 0x0001c1 Vitesse Semiconductor oui XAQTI 0x00e0ae XaQti Corp. oui MARVELL 0x005043 Marvell Semiconductor oui xxMARVELL 0x000ac2 Marvell Semiconductor @@ -143,6 +144,7 @@ model BROADCOM2 BCM5906 0x0004 BCM5906 model CICADA CS8201 0x0001 Cicada CS8201 10/100/1000TX PHY model CICADA CS8201A 0x0020 Cicada CS8201 10/100/1000TX PHY model CICADA CS8201B 0x0021 Cicada CS8201 10/100/1000TX PHY +model VITESSE VSC8601 0x0002 Vitesse VSC8601 10/100/1000TX PHY /* Davicom Semiconductor PHYs */ model DAVICOM DM9102 0x0004 DM9102 10/100 media interface @@ -155,6 +157,7 @@ model xxICS 1892 0x0003 ICS1892 10/100 model xxICS 1893 0x0004 ICS1893 10/100 media interface /* IC Plus Corp. PHYs */ +model ICPLUS IP101 0x0005 IC Plus 10/100 PHY model ICPLUS IP1000A 0x0008 IC Plus 10/100/1000 media interface model ICPLUS IP1001 0x0019 IC Plus IP1001 10/100/1000 media interface Modified: user/dfr/gssapi/6/sys/dev/mii/rlphy.c ============================================================================== --- user/dfr/gssapi/6/sys/dev/mii/rlphy.c Wed Dec 10 16:11:09 2008 (r185864) +++ user/dfr/gssapi/6/sys/dev/mii/rlphy.c Wed Dec 10 16:20:49 2008 (r185865) @@ -93,6 +93,7 @@ static const struct mii_phydesc rlintphy static const struct mii_phydesc rlphys[] = { MII_PHY_DESC(REALTEK, RTL8201L), + MII_PHY_DESC(ICPLUS, IP101), MII_PHY_END }; Modified: user/dfr/gssapi/6/sys/dev/puc/pucdata.c ============================================================================== --- user/dfr/gssapi/6/sys/dev/puc/pucdata.c Wed Dec 10 16:11:09 2008 (r185864) +++ user/dfr/gssapi/6/sys/dev/puc/pucdata.c Wed Dec 10 16:20:49 2008 (r185865) @@ -955,7 +955,7 @@ const struct puc_device_description puc_ /* NetMos 4S0P PCI: 4S, 0P */ { "NetMos NM9845 Quad UART", - { 0x9710, 0x9845, 0, 0x0014 }, + { 0x9710, 0x9845, 0, 0x0004 }, { 0xffff, 0xffff, 0, 0xffff }, { { PUC_PORT_TYPE_COM, 0x10, 0x00, COM_FREQ }, Modified: user/dfr/gssapi/6/sys/dev/random/randomdev.c ============================================================================== --- user/dfr/gssapi/6/sys/dev/random/randomdev.c Wed Dec 10 16:11:09 2008 (r185864) +++ user/dfr/gssapi/6/sys/dev/random/randomdev.c Wed Dec 10 16:20:49 2008 (r185865) @@ -89,6 +89,7 @@ random_close(struct cdev *dev __unused, && (securelevel_gt(td->td_ucred, 0) == 0)) { (*random_systat.reseed)(); random_systat.seeded = 1; + arc4rand(NULL, 0, 1); /* Reseed arc4random as well. */ } return (0); Modified: user/dfr/gssapi/6/sys/dev/random/randomdev_soft.c ============================================================================== --- user/dfr/gssapi/6/sys/dev/random/randomdev_soft.c Wed Dec 10 16:11:09 2008 (r185864) +++ user/dfr/gssapi/6/sys/dev/random/randomdev_soft.c Wed Dec 10 16:20:49 2008 (r185865) @@ -61,6 +61,7 @@ random_harvest_internal(u_int64_t, const u_int, u_int, enum esource); static int random_yarrow_poll(int event,struct thread *td); static int random_yarrow_block(int flag); +static void random_yarrow_flush_reseed(void); struct random_systat random_yarrow = { .ident = "Software, Yarrow", @@ -70,7 +71,7 @@ struct random_systat random_yarrow = { .read = random_yarrow_read, .write = random_yarrow_write, .poll = random_yarrow_poll, - .reseed = random_yarrow_reseed, + .reseed = random_yarrow_flush_reseed, .seeded = 1, }; @@ -96,7 +97,7 @@ static struct entropyfifo emptyfifo; /* Harvested entropy */ static struct entropyfifo harvestfifo[ENTROPYSOURCE]; -/* <0 to end the kthread, 0 to let it run */ +/* <0 to end the kthread, 0 to let it run, 1 to flush the harvest queues */ static int random_kthread_control = 0; static struct proc *random_kthread_proc; @@ -247,7 +248,7 @@ random_kthread(void *arg __unused) local_count = 0; /* Process until told to stop */ - for (; random_kthread_control == 0;) { + for (; random_kthread_control >= 0;) { active = 0; @@ -282,6 +283,13 @@ random_kthread(void *arg __unused) KASSERT(local_count == 0, ("random_kthread: local_count %d", local_count)); + /* + * If a queue flush was commanded, it has now happened, + * and we can mark this by resetting the command. + */ + if (random_kthread_control == 1) + random_kthread_control = 0; + /* Found nothing, so don't belabour the issue */ if (!active) tsleep(&harvestfifo, 0, "-", hz / 10); @@ -406,3 +414,15 @@ random_yarrow_block(int flag) return error; } + +/* Helper routine to perform explicit reseeds */ +static void +random_yarrow_flush_reseed(void) +{ + /* Command a entropy queue flush and wait for it to finish */ + random_kthread_control = 1; + while (random_kthread_control) + tsleep(&harvestfifo, 0, "-", hz / 10); + + random_yarrow_reseed(); +} Modified: user/dfr/gssapi/6/sys/i386/conf/NOTES ============================================================================== --- user/dfr/gssapi/6/sys/i386/conf/NOTES Wed Dec 10 16:11:09 2008 (r185864) +++ user/dfr/gssapi/6/sys/i386/conf/NOTES Wed Dec 10 16:20:49 2008 (r185865) @@ -525,6 +525,7 @@ hint.mse.0.irq="5" # lnc: Lance/PCnet cards (Isolan, Novell NE2100, NE32-VL, AMD Am7990 and # Am79C960) # mxge: Myricom Myri-10G 10GbE NIC +# nfe: nVidia nForce MCP on-board Ethernet Networking (BSD open source) # nve: nVidia nForce MCP on-board Ethernet Networking # oltr: Olicom ISA token-ring adapters OC-3115, OC-3117, OC-3118 and OC-3133. # Olicom PCI token-ring adapters OC-3136, OC-3137, OC-3139, OC-3140, @@ -581,6 +582,7 @@ hint.lnc.0.port="0x280" hint.lnc.0.irq="10" hint.lnc.0.drq="0" device mxge # Myricom Myri-10G 10GbE NIC +device nfe # nVidia nForce MCP on-board Ethernet Networking device nve # nVidia nForce MCP on-board Ethernet Networking device sbni hint.sbni.0.at="isa" Modified: user/dfr/gssapi/6/sys/i386/cpufreq/p4tcc.c ============================================================================== --- user/dfr/gssapi/6/sys/i386/cpufreq/p4tcc.c Wed Dec 10 16:11:09 2008 (r185864) +++ user/dfr/gssapi/6/sys/i386/cpufreq/p4tcc.c Wed Dec 10 16:20:49 2008 (r185865) @@ -164,7 +164,7 @@ p4tcc_attach(device_t dev) */ sc->auto_mode = TRUE; - switch (cpu_id & 0xf) { + switch (cpu_id & 0xff) { case 0x22: case 0x24: case 0x25: @@ -180,9 +180,12 @@ p4tcc_attach(device_t dev) case 0x0a: case 0x12: case 0x13: + case 0x62: /* Pentium D B1: errata AA21 */ + case 0x64: /* Pentium D C1: errata AA21 */ + case 0x65: /* Pentium D D0: errata AA21 */ /* * These CPU models hang when set to 12.5% or 25%. - * See Errata N44 and P18l. + * See Errata N44, P18l and AA21. */ sc->set_count -= 2; break; Modified: user/dfr/gssapi/6/sys/ia64/ia64/uma_machdep.c ============================================================================== --- user/dfr/gssapi/6/sys/ia64/ia64/uma_machdep.c Wed Dec 10 16:11:09 2008 (r185864) +++ user/dfr/gssapi/6/sys/ia64/ia64/uma_machdep.c Wed Dec 10 16:20:49 2008 (r185865) @@ -48,9 +48,9 @@ uma_small_alloc(uma_zone_t zone, int byt *flags = UMA_SLAB_PRIV; if ((wait & (M_NOWAIT|M_USE_RESERVE)) == M_NOWAIT) - pflags = VM_ALLOC_INTERRUPT; + pflags = VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED; else - pflags = VM_ALLOC_SYSTEM; + pflags = VM_ALLOC_SYSTEM | VM_ALLOC_WIRED; if (wait & M_ZERO) pflags |= VM_ALLOC_ZERO; @@ -76,7 +76,9 @@ uma_small_free(void *mem, int size, u_in vm_page_t m; m = PHYS_TO_VM_PAGE(IA64_RR_MASK((u_int64_t)mem)); + m->wire_count--; vm_page_lock_queues(); vm_page_free(m); vm_page_unlock_queues(); + atomic_subtract_int(&cnt.v_wire_count, 1); } Modified: user/dfr/gssapi/6/sys/kern/vfs_aio.c ============================================================================== --- user/dfr/gssapi/6/sys/kern/vfs_aio.c Wed Dec 10 16:11:09 2008 (r185864) +++ user/dfr/gssapi/6/sys/kern/vfs_aio.c Wed Dec 10 16:20:49 2008 (r185865) @@ -61,7 +61,6 @@ __FBSDID("$FreeBSD$"); #include "opt_vfs_aio.h" -NET_NEEDS_GIANT("aio"); /* * Counter for allocating reference ids to new jobs. Wrapped to 1 on @@ -504,8 +503,10 @@ aio_free_entry(struct aiocblist *aiocbe) splx(s); } else if (aiocbe->jobstate == JOBST_JOBQGLOBAL) { s = splnet(); + mtx_lock(&aio_freeproc_mtx); TAILQ_REMOVE(&aio_jobs, aiocbe, list); TAILQ_REMOVE(&ki->kaio_jobqueue, aiocbe, plist); + mtx_unlock(&aio_freeproc_mtx); splx(s); } else if (aiocbe->jobstate == JOBST_JOBFINISHED) TAILQ_REMOVE(&ki->kaio_jobdone, aiocbe, plist); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Wed Dec 10 21:32:59 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A4F71065676; Wed, 10 Dec 2008 21:32:59 +0000 (UTC) (envelope-from mlaier@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E26A38FC19; Wed, 10 Dec 2008 21:32:58 +0000 (UTC) (envelope-from mlaier@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBALWwdA043701; Wed, 10 Dec 2008 21:32:58 GMT (envelope-from mlaier@svn.freebsd.org) Received: (from mlaier@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBALWwEs043700; Wed, 10 Dec 2008 21:32:58 GMT (envelope-from mlaier@svn.freebsd.org) Message-Id: <200812102132.mBALWwEs043700@svn.freebsd.org> From: Max Laier Date: Wed, 10 Dec 2008 21:32:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185890 - in user/mlaier: . pf44head X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2008 21:32:59 -0000 Author: mlaier Date: Wed Dec 10 21:32:58 2008 New Revision: 185890 URL: http://svn.freebsd.org/changeset/base/185890 Log: Create a copy of head in my user directory to work towards a pf 4.4 import Added: user/mlaier/ user/mlaier/pf44head/ - copied from r185889, head/ From owner-svn-src-user@FreeBSD.ORG Thu Dec 11 06:53:54 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A24FD106564A; Thu, 11 Dec 2008 06:53:54 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 901C08FC2A; Thu, 11 Dec 2008 06:53:54 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBB6rsvT056920; Thu, 11 Dec 2008 06:53:54 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBB6rrJk056905; Thu, 11 Dec 2008 06:53:53 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812110653.mBB6rrJk056905@svn.freebsd.org> From: Kip Macy Date: Thu, 11 Dec 2008 06:53:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185911 - in user/kmacy/HEAD_fast_multi_xmit/sys: conf contrib/rdma dev/cxgb/ulp/tom net netinet netinet6 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Dec 2008 06:53:54 -0000 Author: kmacy Date: Thu Dec 11 06:53:53 2008 New Revision: 185911 URL: http://svn.freebsd.org/changeset/base/185911 Log: merge arpv2 and garbage collection of cloning Modified: user/kmacy/HEAD_fast_multi_xmit/sys/conf/files user/kmacy/HEAD_fast_multi_xmit/sys/contrib/rdma/rdma_addr.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/cxgb/ulp/tom/cxgb_l2t.c user/kmacy/HEAD_fast_multi_xmit/sys/net/flowtable.c user/kmacy/HEAD_fast_multi_xmit/sys/net/if.c user/kmacy/HEAD_fast_multi_xmit/sys/net/if_arcsubr.c user/kmacy/HEAD_fast_multi_xmit/sys/net/if_ethersubr.c user/kmacy/HEAD_fast_multi_xmit/sys/net/if_fddisubr.c user/kmacy/HEAD_fast_multi_xmit/sys/net/if_fwsubr.c user/kmacy/HEAD_fast_multi_xmit/sys/net/if_iso88025subr.c user/kmacy/HEAD_fast_multi_xmit/sys/net/if_var.h user/kmacy/HEAD_fast_multi_xmit/sys/net/radix_mpath.c user/kmacy/HEAD_fast_multi_xmit/sys/net/route.c user/kmacy/HEAD_fast_multi_xmit/sys/net/route.h user/kmacy/HEAD_fast_multi_xmit/sys/net/rtsock.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/if_ether.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/if_ether.h user/kmacy/HEAD_fast_multi_xmit/sys/netinet/in.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/in_mcast.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/in_pcb.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/in_proto.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/in_rmx.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/in_var.h user/kmacy/HEAD_fast_multi_xmit/sys/netinet/ip_fastfwd.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/ip_input.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/ip_output.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/tcp_subr.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/icmp6.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/in6.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/in6_rmx.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/in6_src.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/in6_var.h user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/ip6_forward.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/ip6_input.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/ip6_output.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/ip6_var.h user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/nd6.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/nd6.h user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/nd6_nbr.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/nd6_rtr.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/vinet6.h Modified: user/kmacy/HEAD_fast_multi_xmit/sys/conf/files ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/conf/files Thu Dec 11 06:27:18 2008 (r185910) +++ user/kmacy/HEAD_fast_multi_xmit/sys/conf/files Thu Dec 11 06:53:53 2008 (r185911) @@ -2171,6 +2171,7 @@ net/if_gre.c optional gre net/if_iso88025subr.c optional token net/if_lagg.c optional lagg net/if_loop.c optional loop +net/if_llatbl.c standard net/if_media.c standard net/if_mib.c standard net/if_ppp.c optional ppp Modified: user/kmacy/HEAD_fast_multi_xmit/sys/contrib/rdma/rdma_addr.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/contrib/rdma/rdma_addr.c Thu Dec 11 06:27:18 2008 (r185910) +++ user/kmacy/HEAD_fast_multi_xmit/sys/contrib/rdma/rdma_addr.c Thu Dec 11 06:53:53 2008 (r185911) @@ -163,6 +163,7 @@ static void addr_send_arp(struct sockadd struct route iproute; struct sockaddr_in *dst = (struct sockaddr_in *)&iproute.ro_dst; char dmac[ETHER_ADDR_LEN]; + struct llentry *lle; bzero(&iproute, sizeof iproute); *dst = *dst_in; @@ -172,7 +173,7 @@ static void addr_send_arp(struct sockadd return; arpresolve(iproute.ro_rt->rt_ifp, iproute.ro_rt, NULL, - rt_key(iproute.ro_rt), dmac); + rt_key(iproute.ro_rt), dmac, &lle); RTFREE(iproute.ro_rt); } @@ -186,6 +187,7 @@ static int addr_resolve_remote(struct so struct route iproute; struct sockaddr_in *dst = (struct sockaddr_in *)&iproute.ro_dst; char dmac[ETHER_ADDR_LEN]; + struct llentry *lle; bzero(&iproute, sizeof iproute); *dst = *dst_in; @@ -202,7 +204,7 @@ static int addr_resolve_remote(struct so goto put; } ret = arpresolve(iproute.ro_rt->rt_ifp, iproute.ro_rt, NULL, - rt_key(iproute.ro_rt), dmac); + rt_key(iproute.ro_rt), dmac, &lle); if (ret) { goto put; } Modified: user/kmacy/HEAD_fast_multi_xmit/sys/dev/cxgb/ulp/tom/cxgb_l2t.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/dev/cxgb/ulp/tom/cxgb_l2t.c Thu Dec 11 06:27:18 2008 (r185910) +++ user/kmacy/HEAD_fast_multi_xmit/sys/dev/cxgb/ulp/tom/cxgb_l2t.c Thu Dec 11 06:53:53 2008 (r185911) @@ -166,6 +166,7 @@ t3_l2t_send_slow(struct t3cdev *dev, str { struct rtentry *rt = e->neigh; struct sockaddr_in sin; + struct llentry *lle; bzero(&sin, sizeof(struct sockaddr_in)); sin.sin_family = AF_INET; @@ -177,7 +178,7 @@ again: switch (e->state) { case L2T_STATE_STALE: /* entry is stale, kick off revalidation */ arpresolve(rt->rt_ifp, rt, NULL, - (struct sockaddr *)&sin, e->dmac); + (struct sockaddr *)&sin, e->dmac, &lle); mtx_lock(&e->lock); if (e->state == L2T_STATE_STALE) e->state = L2T_STATE_VALID; @@ -201,7 +202,7 @@ again: * entries when there's no memory. */ if (arpresolve(rt->rt_ifp, rt, NULL, - (struct sockaddr *)&sin, e->dmac) == 0) { + (struct sockaddr *)&sin, e->dmac, &lle) == 0) { CTR6(KTR_CXGB, "mac=%x:%x:%x:%x:%x:%x\n", e->dmac[0], e->dmac[1], e->dmac[2], e->dmac[3], e->dmac[4], e->dmac[5]); @@ -228,6 +229,7 @@ t3_l2t_send_event(struct t3cdev *dev, st sin.sin_family = AF_INET; sin.sin_len = sizeof(struct sockaddr_in); sin.sin_addr.s_addr = e->addr; + struct llentry *lle; if ((m0 = m_gethdr(M_NOWAIT, MT_DATA)) == NULL) return; @@ -237,7 +239,7 @@ again: switch (e->state) { case L2T_STATE_STALE: /* entry is stale, kick off revalidation */ arpresolve(rt->rt_ifp, rt, NULL, - (struct sockaddr *)&sin, e->dmac); + (struct sockaddr *)&sin, e->dmac, &lle); mtx_lock(&e->lock); if (e->state == L2T_STATE_STALE) { e->state = L2T_STATE_VALID; @@ -263,7 +265,7 @@ again: * entries when there's no memory. */ arpresolve(rt->rt_ifp, rt, NULL, - (struct sockaddr *)&sin, e->dmac); + (struct sockaddr *)&sin, e->dmac, &lle); } return; Modified: user/kmacy/HEAD_fast_multi_xmit/sys/net/flowtable.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/net/flowtable.c Thu Dec 11 06:27:18 2008 (r185910) +++ user/kmacy/HEAD_fast_multi_xmit/sys/net/flowtable.c Thu Dec 11 06:53:53 2008 (r185911) @@ -34,22 +34,6 @@ #define calloc(count, size) malloc((count)*(size), M_DEVBUF, M_WAITOK|M_ZERO) - - -#if defined (__GNUC__) - #if #cpu(i386) || defined __i386 || defined i386 || defined __i386__ || #cpu(x86_64) || defined __x86_64__ - #define mb() __asm__ __volatile__ ("mfence;": : :"memory") - #elif #cpu(sparc64) || defined sparc64 || defined __sparcv9 - #define mb() __asm__ __volatile__ ("membar #MemIssue": : :"memory") - #elif #cpu(sparc) || defined sparc || defined __sparc__ - #define mb() __asm__ __volatile__ ("stbar;": : :"memory") - #else - #define mb() /* XXX just to make this compile */ - #endif -#else - #error "unknown compiler" -#endif - /* * Taken from http://burtleburtle.net/bob/c/lookup3.c */ @@ -301,7 +285,7 @@ static void in_rtalloc_ign_wrapper(struct route *ro, uint32_t hash, u_int fib) { - in_rtalloc_ign(ro, RTF_CLONING, fib); + in_rtalloc_ign(ro, 0, fib); } #endif @@ -463,12 +447,12 @@ flow_stale(struct flowtable *ft, struct if ((fle->f_fhash == 0) || ((fle->f_rt->rt_flags & RTF_HOST) && - ((fle->f_rt->rt_flags & (RTF_UP|RTF_LLINFO)) - != (RTF_UP|RTF_LLINFO))) + ((fle->f_rt->rt_flags & (RTF_UP)) + != (RTF_UP))) || (fle->f_uptime <= fle->f_rt->rt_llinfo_uptime) || ((fle->f_rt->rt_flags & RTF_GATEWAY) && - ((fle->f_rt->rt_gwroute->rt_flags & (RTF_UP|RTF_LLINFO)) - != (RTF_UP|RTF_LLINFO))) + ((fle->f_rt->rt_gwroute->rt_flags & (RTF_UP)) + != (RTF_UP))) || (fle->f_rt->rt_ifp == NULL)) return (1); @@ -677,13 +661,14 @@ uncached: error = ENETUNREACH; else { int finsert; - + struct llentry *lle; + if (ro.ro_rt->rt_flags & RTF_GATEWAY) error = arpresolve(ro.ro_rt->rt_ifp, ro.ro_rt, - NULL, ro.ro_rt->rt_gateway, desten); + NULL, ro.ro_rt->rt_gateway, desten, &lle); else error = arpresolve(ro.ro_rt->rt_ifp, ro.ro_rt, - NULL, &ro.ro_dst, desten); + NULL, &ro.ro_dst, desten, &lle); #ifdef DIAGNOSTICS if (error) log(LOG_WARNING, "dst=%s gw=%s proto=%d hash=%x " @@ -704,8 +689,8 @@ uncached: #endif route_to_rtentry_info(&ro, error ? NULL : desten, ri); ro.ro_rt->rt_rmx.rmx_pksent++; - finsert = (error == 0 && cache - && !(ro.ro_rt->rt_flags & RTF_CLONING)); + finsert = ((error == 0) && cache); + if (finsert) error = flowtable_insert(ft, hash, key, proto, Modified: user/kmacy/HEAD_fast_multi_xmit/sys/net/if.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/net/if.c Thu Dec 11 06:27:18 2008 (r185910) +++ user/kmacy/HEAD_fast_multi_xmit/sys/net/if.c Thu Dec 11 06:53:53 2008 (r185911) @@ -60,6 +60,7 @@ #include #include #include +#include #include #include @@ -1343,6 +1344,9 @@ done: return (ifa); } +#include +#include + /* * Default action when installing a route with a Link Level gateway. * Lookup an appropriate real ifa to point to. Modified: user/kmacy/HEAD_fast_multi_xmit/sys/net/if_arcsubr.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/net/if_arcsubr.c Thu Dec 11 06:27:18 2008 (r185910) +++ user/kmacy/HEAD_fast_multi_xmit/sys/net/if_arcsubr.c Thu Dec 11 06:53:53 2008 (r185911) @@ -64,6 +64,7 @@ #include #include #include +#include #if defined(INET) || defined(INET6) #include @@ -108,6 +109,7 @@ arc_output(struct ifnet *ifp, struct mbu u_int8_t atype, adst; int loop_copy = 0; int isphds; + struct llentry *lle; if (!((ifp->if_flags & IFF_UP) && (ifp->if_drv_flags & IFF_DRV_RUNNING))) @@ -127,7 +129,7 @@ arc_output(struct ifnet *ifp, struct mbu else if (ifp->if_flags & IFF_NOARP) adst = ntohl(SIN(dst)->sin_addr.s_addr) & 0xFF; else { - error = arpresolve(ifp, rt0, m, dst, &adst); + error = arpresolve(ifp, rt0, m, dst, &adst, &lle); if (error) return (error == EWOULDBLOCK ? 0 : error); } @@ -165,7 +167,7 @@ arc_output(struct ifnet *ifp, struct mbu #endif #ifdef INET6 case AF_INET6: - error = nd6_storelladdr(ifp, rt0, m, dst, (u_char *)&adst); + error = nd6_storelladdr(ifp, rt0, m, dst, (u_char *)&adst, &lle); if (error) return (error); atype = ARCTYPE_INET6; Modified: user/kmacy/HEAD_fast_multi_xmit/sys/net/if_ethersubr.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/net/if_ethersubr.c Thu Dec 11 06:27:18 2008 (r185910) +++ user/kmacy/HEAD_fast_multi_xmit/sys/net/if_ethersubr.c Thu Dec 11 06:53:53 2008 (r185911) @@ -63,6 +63,7 @@ #include #include #include +#include #include #include @@ -149,6 +150,8 @@ static int ether_ipfw; #endif #endif +extern int useloopback; + /* * Ethernet output routine. * Encapsulate a packet of type family for the local net. @@ -162,6 +165,7 @@ ether_output(struct ifnet *ifp, struct m short type; int error, hdrcmplt = 0; u_char esrc[ETHER_ADDR_LEN], edst[ETHER_ADDR_LEN]; + struct llentry *lle = NULL; struct ether_header *eh; struct pf_mtag *t; struct rtentry_info *ri = NULL; @@ -200,7 +204,7 @@ ether_output(struct ifnet *ifp, struct m if (riset && (ri->ri_flags && RTF_DESTEN_VALID)) memcpy(edst, ri->ri_desten, ETHER_ADDR_LEN); else - error = arpresolve(ifp, rt0, m, dst, edst); + error = arpresolve(ifp, rt0, m, dst, edst, &lle); if (error) return (error == EWOULDBLOCK ? 0 : error); type = htons(ETHERTYPE_IP); @@ -235,7 +239,7 @@ ether_output(struct ifnet *ifp, struct m #endif #ifdef INET6 case AF_INET6: - error = nd6_storelladdr(ifp, rt0, m, dst, (u_char *)edst); + error = nd6_storelladdr(ifp, rt0, m, dst, (u_char *)edst, &lle); if (error) return error; type = htons(ETHERTYPE_IPV6); @@ -303,6 +307,17 @@ ether_output(struct ifnet *ifp, struct m senderr(EAFNOSUPPORT); } + if (lle && (lle->la_flags & LLE_IFADDR) && useloopback) { + int csum_flags = 0; + if (m->m_pkthdr.csum_flags & CSUM_IP) + csum_flags |= (CSUM_IP_CHECKED|CSUM_IP_VALID); + if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) + csum_flags |= (CSUM_DATA_VALID|CSUM_PSEUDO_HDR); + m->m_pkthdr.csum_flags |= csum_flags; + m->m_pkthdr.csum_data = 0xffff; + return (if_simloop(ifp, m, dst->sa_family, 0)); + } + /* * Add local net header. If no space in first mbuf, * allocate another. Modified: user/kmacy/HEAD_fast_multi_xmit/sys/net/if_fddisubr.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/net/if_fddisubr.c Thu Dec 11 06:27:18 2008 (r185910) +++ user/kmacy/HEAD_fast_multi_xmit/sys/net/if_fddisubr.c Thu Dec 11 06:53:53 2008 (r185911) @@ -55,6 +55,7 @@ #include #include #include +#include #include #include @@ -120,6 +121,7 @@ fddi_output(ifp, m, dst, rt0) int loop_copy = 0, error = 0, hdrcmplt = 0; u_char esrc[FDDI_ADDR_LEN], edst[FDDI_ADDR_LEN]; struct fddi_header *fh; + struct llentry *lle; #ifdef MAC error = mac_ifnet_check_transmit(ifp, m); @@ -137,7 +139,7 @@ fddi_output(ifp, m, dst, rt0) switch (dst->sa_family) { #ifdef INET case AF_INET: { - error = arpresolve(ifp, rt0, m, dst, edst); + error = arpresolve(ifp, rt0, m, dst, edst, &lle); if (error) return (error == EWOULDBLOCK ? 0 : error); type = htons(ETHERTYPE_IP); @@ -173,7 +175,7 @@ fddi_output(ifp, m, dst, rt0) #endif /* INET */ #ifdef INET6 case AF_INET6: - error = nd6_storelladdr(ifp, rt0, m, dst, (u_char *)edst); + error = nd6_storelladdr(ifp, rt0, m, dst, (u_char *)edst, &lle); if (error) return (error); /* Something bad happened */ type = htons(ETHERTYPE_IPV6); Modified: user/kmacy/HEAD_fast_multi_xmit/sys/net/if_fwsubr.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/net/if_fwsubr.c Thu Dec 11 06:27:18 2008 (r185910) +++ user/kmacy/HEAD_fast_multi_xmit/sys/net/if_fwsubr.c Thu Dec 11 06:53:53 2008 (r185911) @@ -51,6 +51,7 @@ #include #include #include +#include #if defined(INET) || defined(INET6) #include @@ -89,6 +90,7 @@ firewire_output(struct ifnet *ifp, struc struct mbuf *mtail; int unicast, dgl, foff; static int next_dgl; + struct llentry *lle; #ifdef MAC error = mac_ifnet_check_transmit(ifp, m); @@ -144,7 +146,7 @@ firewire_output(struct ifnet *ifp, struc * doesn't fit into the arp model. */ if (unicast) { - error = arpresolve(ifp, rt, m, dst, (u_char *) destfw); + error = arpresolve(ifp, rt, m, dst, (u_char *) destfw, &lle); if (error) return (error == EWOULDBLOCK ? 0 : error); } @@ -174,7 +176,7 @@ firewire_output(struct ifnet *ifp, struc case AF_INET6: if (unicast) { error = nd6_storelladdr(fc->fc_ifp, rt, m, dst, - (u_char *) destfw); + (u_char *) destfw, &lle); if (error) return (error); } Modified: user/kmacy/HEAD_fast_multi_xmit/sys/net/if_iso88025subr.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/net/if_iso88025subr.c Thu Dec 11 06:27:18 2008 (r185910) +++ user/kmacy/HEAD_fast_multi_xmit/sys/net/if_iso88025subr.c Thu Dec 11 06:53:53 2008 (r185911) @@ -59,6 +59,7 @@ #include #include #include +#include #include #include @@ -244,6 +245,7 @@ iso88025_output(ifp, m, dst, rt0) struct iso88025_header gen_th; struct sockaddr_dl *sdl = NULL; struct rtentry *rt = NULL; + struct llentry *lle; #ifdef MAC error = mac_ifnet_check_transmit(ifp, m); @@ -289,7 +291,7 @@ iso88025_output(ifp, m, dst, rt0) switch (dst->sa_family) { #ifdef INET case AF_INET: - error = arpresolve(ifp, rt0, m, dst, edst); + error = arpresolve(ifp, rt0, m, dst, edst, &lle); if (error) return (error == EWOULDBLOCK ? 0 : error); snap_type = ETHERTYPE_IP; @@ -324,7 +326,7 @@ iso88025_output(ifp, m, dst, rt0) #endif /* INET */ #ifdef INET6 case AF_INET6: - error = nd6_storelladdr(ifp, rt0, m, dst, (u_char *)edst); + error = nd6_storelladdr(ifp, rt0, m, dst, (u_char *)edst, &lle); if (error) return (error); snap_type = ETHERTYPE_IPV6; Modified: user/kmacy/HEAD_fast_multi_xmit/sys/net/if_var.h ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/net/if_var.h Thu Dec 11 06:27:18 2008 (r185910) +++ user/kmacy/HEAD_fast_multi_xmit/sys/net/if_var.h Thu Dec 11 06:53:53 2008 (r185911) @@ -68,6 +68,7 @@ struct rtentry; struct rt_addrinfo; struct socket; struct ether_header; +struct lltable; struct carp_if; struct ifvlantrunk; #endif @@ -170,8 +171,6 @@ struct ifnet { void *if_bridge; /* bridge glue */ - struct lltable *lltables; /* list of L3-L2 resolution tables */ - struct label *if_label; /* interface MAC label */ /* these are only used by IPv6 */ @@ -182,6 +181,7 @@ struct ifnet { struct task if_starttask; /* task for IFF_NEEDSGIANT */ struct task if_linktask; /* task for link change events */ struct mtx if_addr_mtx; /* mutex to protect address lists */ + LIST_ENTRY(ifnet) if_clones; /* interfaces of a cloner */ TAILQ_HEAD(, ifg_list) if_groups; /* linked list of groups per if */ /* protected by if_addr_mtx */ @@ -366,6 +366,9 @@ EVENTHANDLER_DECLARE(group_change_event, #define IF_AFDATA_UNLOCK(ifp) mtx_unlock(&(ifp)->if_afdata_mtx) #define IF_AFDATA_DESTROY(ifp) mtx_destroy(&(ifp)->if_afdata_mtx) +#define IF_AFDATA_LOCK_ASSERT(ifp) mtx_assert(&(ifp)->if_afdata_mtx, MA_OWNED) +#define IF_AFDATA_UNLOCK_ASSERT(ifp) mtx_assert(&(ifp)->if_afdata_mtx, MA_NOTOWNED) + #define IFF_LOCKGIANT(ifp) do { \ if ((ifp)->if_flags & IFF_NEEDSGIANT) \ mtx_lock(&Giant); \ Modified: user/kmacy/HEAD_fast_multi_xmit/sys/net/radix_mpath.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/net/radix_mpath.c Thu Dec 11 06:27:18 2008 (r185910) +++ user/kmacy/HEAD_fast_multi_xmit/sys/net/radix_mpath.c Thu Dec 11 06:53:53 2008 (r185911) @@ -271,8 +271,8 @@ rtalloc_mpath_fib(struct route *ro, u_in * be done for sendto(3) case? */ if (ro->ro_rt && ro->ro_rt->rt_ifp && (ro->ro_rt->rt_flags & RTF_UP)) - return; /* XXX */ - ro->ro_rt = rtalloc1_fib(&ro->ro_dst, 1, RTF_CLONING, fibnum); + return; + ro->ro_rt = rtalloc1_fib(&ro->ro_dst, 1, 0, fibnum); /* if the route does not exist or it is not multipath, don't care */ if (ro->ro_rt == NULL) Modified: user/kmacy/HEAD_fast_multi_xmit/sys/net/route.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/net/route.c Thu Dec 11 06:27:18 2008 (r185910) +++ user/kmacy/HEAD_fast_multi_xmit/sys/net/route.c Thu Dec 11 06:53:53 2008 (r185911) @@ -41,6 +41,7 @@ #include #include +#include #include #include #include @@ -53,6 +54,7 @@ #include #include +#include #include #ifdef RADIX_MPATH @@ -269,8 +271,7 @@ rtalloc1_fib(struct sockaddr *dst, int r struct radix_node *rn; struct rtentry *newrt; struct rt_addrinfo info; - u_long nflags; - int needresolve = 0, err = 0, msgtype = RTM_MISS; + int err = 0, msgtype = RTM_MISS; int needlock; KASSERT((fibnum < rt_numfibs), ("rtalloc1_fib: bad fibnum")); @@ -283,10 +284,9 @@ rtalloc1_fib(struct sockaddr *dst, int r */ if (rnh == NULL) { V_rtstat.rts_unreach++; - goto miss2; + goto miss; } needlock = !(ignflags & RTF_RNH_LOCKED); -retry: if (needlock) RADIX_NODE_HEAD_RLOCK(rnh); #ifdef INVARIANTS @@ -295,103 +295,33 @@ retry: #endif rn = rnh->rnh_matchaddr(dst, rnh); if (rn && ((rn->rn_flags & RNF_ROOT) == 0)) { - newrt = rt = RNTORT(rn); - nflags = rt->rt_flags & ~ignflags; - if (report && (nflags & RTF_CLONING)) { - if (needlock && !RADIX_NODE_HEAD_LOCK_TRY_UPGRADE(rnh)) { - RADIX_NODE_HEAD_RUNLOCK(rnh); - RADIX_NODE_HEAD_LOCK(rnh); - /* - * lookup again to make sure it wasn't changed - */ - rn = rnh->rnh_matchaddr(dst, rnh); - if (!(rn && ((rn->rn_flags & RNF_ROOT) == 0))) { - RADIX_NODE_HEAD_UNLOCK(rnh); - needresolve = 0; - log(LOG_INFO, "retrying route lookup ...\n"); - goto retry; - } - } - needresolve = 1; - } else { - RT_LOCK(newrt); - RT_ADDREF(newrt); - if (needlock) - RADIX_NODE_HEAD_RUNLOCK(rnh); - goto done; - } - } - /* - * if needresolve is set then we have the exclusive lock - * and we need to keep it held for the benefit of rtrequest_fib - */ - if (!needresolve && needlock) - RADIX_NODE_HEAD_RUNLOCK(rnh); - - if (needresolve) { - RADIX_NODE_HEAD_WLOCK_ASSERT(rnh); - /* - * We are apparently adding (report = 0 in delete). - * If it requires that it be cloned, do so. - * (This implies it wasn't a HOST route.) - */ - err = rtrequest_fib(RTM_RESOLVE, dst, NULL, - NULL, RTF_RNH_LOCKED, &newrt, fibnum); - if (err) { - /* - * If the cloning didn't succeed, maybe - * what we have will do. Return that. - */ - newrt = rt; /* existing route */ - RT_LOCK(newrt); - RT_ADDREF(newrt); - goto miss; - } - KASSERT(newrt, ("no route and no error")); RT_LOCK(newrt); - if (newrt->rt_flags & RTF_XRESOLVE) { - /* - * If the new route specifies it be - * externally resolved, then go do that. - */ - msgtype = RTM_RESOLVE; - goto miss; - } - /* Inform listeners of the new route. */ - bzero(&info, sizeof(info)); - info.rti_info[RTAX_DST] = rt_key(newrt); - info.rti_info[RTAX_NETMASK] = rt_mask(newrt); - info.rti_info[RTAX_GATEWAY] = newrt->rt_gateway; - if (newrt->rt_ifp != NULL) { - info.rti_info[RTAX_IFP] = - newrt->rt_ifp->if_addr->ifa_addr; - info.rti_info[RTAX_IFA] = newrt->rt_ifa->ifa_addr; - } - rt_missmsg(RTM_ADD, &info, newrt->rt_flags, 0); + RT_ADDREF(newrt); if (needlock) - RADIX_NODE_HEAD_UNLOCK(rnh); - } else { - /* - * Either we hit the root or couldn't find any match, - * Which basically means - * "caint get there frm here" + RADIX_NODE_HEAD_RUNLOCK(rnh); + goto done; + + } else if (needlock) + RADIX_NODE_HEAD_RUNLOCK(rnh); + + /* + * Either we hit the root or couldn't find any match, + * Which basically means + * "caint get there frm here" + */ + V_rtstat.rts_unreach++; +miss: + if (report) { + /* + * If required, report the failure to the supervising + * Authorities. + * For a delete, this is not an error. (report == 0) */ - V_rtstat.rts_unreach++; - miss: - if (needlock && needresolve) - RADIX_NODE_HEAD_UNLOCK(rnh); - miss2: if (report) { - /* - * If required, report the failure to the supervising - * Authorities. - * For a delete, this is not an error. (report == 0) - */ - bzero(&info, sizeof(info)); - info.rti_info[RTAX_DST] = dst; - rt_missmsg(msgtype, &info, 0, err); - } - } + bzero(&info, sizeof(info)); + info.rti_info[RTAX_DST] = dst; + rt_missmsg(msgtype, &info, 0, err); + } done: if (newrt) RT_LOCK_ASSERT(newrt); @@ -420,7 +350,7 @@ rtfree(struct rtentry *rt) */ RT_REMREF(rt); if (rt->rt_refcnt > 0) { - printf("%s: %p has %lu refs\n", __func__, rt, rt->rt_refcnt); + log(LOG_DEBUG, "%s: %p has %lu refs\t", __func__, rt, rt->rt_refcnt); goto done; } @@ -715,14 +645,6 @@ ifa_ifwithroute_fib(int flags, struct so return (ifa); } -static walktree_f_t rt_fixdelete; -static walktree_f_t rt_fixchange; - -struct rtfc_arg { - struct rtentry *rt0; - struct radix_node_head *rnh; -}; - /* * Do appropriate manipulations of a routing tree given * all the bits of info needed @@ -862,14 +784,6 @@ rtexpunge(struct rtentry *rt) rt->rt_flags &= ~RTF_UP; /* - * Now search what's left of the subtree for any cloned - * routes which might have been formed from this node. - */ - if ((rt->rt_flags & RTF_CLONING) && rt_mask(rt)) - rnh->rnh_walktree_from(rnh, rt_key(rt), rt_mask(rt), - rt_fixdelete, rt); - - /* * Remove any external references we may have. * This might result in another rtentry being freed if * we held its last reference. @@ -1032,10 +946,9 @@ rtrequest1_fib(int req, struct rt_addrin * If we are adding a host route then we don't want to put * a netmask in the tree, nor do we want to clone it. */ - if (flags & RTF_HOST) { + if (flags & RTF_HOST) netmask = NULL; - flags &= ~RTF_CLONING; - } + switch (req) { case RTM_DELETE: #ifdef RADIX_MPATH @@ -1064,16 +977,6 @@ rtrequest1_fib(int req, struct rt_addrin RT_ADDREF(rt); rt->rt_flags &= ~RTF_UP; /* - * Now search what's left of the subtree for any cloned - * routes which might have been formed from this node. - */ - if ((rt->rt_flags & RTF_CLONING) && - rt_mask(rt)) { - rnh->rnh_walktree_from(rnh, dst, rt_mask(rt), - rt_fixdelete, rt); - } - - /* * Remove any external references we may have. * This might result in another rtentry being freed if * we held its last reference. @@ -1107,20 +1010,12 @@ rtrequest1_fib(int req, struct rt_addrin } else RTFREE_LOCKED(rt); break; - case RTM_RESOLVE: - if (ret_nrt == NULL || (rt = *ret_nrt) == NULL) - senderr(EINVAL); - ifa = rt->rt_ifa; - /* XXX locking? */ - flags = rt->rt_flags & - ~(RTF_CLONING | RTF_STATIC); - flags |= RTF_WASCLONED; - gateway = rt->rt_gateway; - if ((netmask = rt->rt_genmask) == NULL) - flags |= RTF_HOST; - goto makeroute; - + /* + * resolve is only used for route cloning + * + */ + senderr(EINVAL); case RTM_ADD: if ((flags & RTF_GATEWAY) && !gateway) senderr(EINVAL); @@ -1131,8 +1026,6 @@ rtrequest1_fib(int req, struct rt_addrin if (info->rti_ifa == NULL && (error = rt_getifa_fib(info, fibnum))) senderr(error); ifa = info->rti_ifa; - - makeroute: rt = uma_zalloc(rtzone, M_NOWAIT | M_ZERO); if (rt == NULL) senderr(ENOBUFS); @@ -1190,26 +1083,6 @@ rtrequest1_fib(int req, struct rt_addrin /* XXX mtu manipulation will be done in rnh_addaddr -- itojun */ rn = rnh->rnh_addaddr(ndst, netmask, rnh, rt->rt_nodes); - if (rn == NULL) { - struct rtentry *rt2; - /* - * Uh-oh, we already have one of these in the tree. - * We do a special hack: if the route that's already - * there was generated by the cloning mechanism - * then we just blow it away and retry the insertion - * of the new one. - */ - rt2 = rtalloc1_fib(dst, 0, 0, fibnum); - if (rt2 && rt2->rt_parent) { - rtexpunge(rt2); - RT_UNLOCK(rt2); - rn = rnh->rnh_addaddr(ndst, netmask, - rnh, rt->rt_nodes); - } else if (rt2) { - /* undo the extra ref we got */ - RTFREE_LOCKED(rt2); - } - } /* * If it still failed to go into the tree, @@ -1227,32 +1100,6 @@ rtrequest1_fib(int req, struct rt_addrin } rt->rt_parent = NULL; - - /* - * If we got here from RESOLVE, then we are cloning - * so clone the rest, and note that we - * are a clone (and increment the parent's references) - */ - if (req == RTM_RESOLVE) { - KASSERT(ret_nrt && *ret_nrt, - ("no route to clone from")); - rt->rt_rmx = (*ret_nrt)->rt_rmx; /* copy metrics */ - rt->rt_rmx.rmx_pksent = 0; /* reset packet counter */ - if ((*ret_nrt)->rt_flags & RTF_CLONING) { - /* - * NB: We do not bump the refcnt on the parent - * entry under the assumption that it will - * remain so long as we do. This is - * important when deleting the parent route - * as this operation requires traversing - * the tree to delete all clones and futzing - * with refcnts requires us to double-lock - * parent through this back reference. - */ - rt->rt_parent = *ret_nrt; - } - } - /* * If this protocol has something to add to this then * allow it to do that as well. @@ -1261,20 +1108,6 @@ rtrequest1_fib(int req, struct rt_addrin ifa->ifa_rtrequest(req, rt, info); /* - * We repeat the same procedure from rt_setgate() here because - * it doesn't fire when we call it there because the node - * hasn't been added to the tree yet. - */ - if (req == RTM_ADD && - !(rt->rt_flags & RTF_HOST) && rt_mask(rt) != NULL) { - struct rtfc_arg arg; - arg.rnh = rnh; - arg.rt0 = rt; - rnh->rnh_walktree_from(rnh, rt_key(rt), rt_mask(rt), - rt_fixchange, &arg); - } - - /* * actually return a resultant rtentry and * give the caller a single reference. */ @@ -1301,90 +1134,6 @@ bad: #undef ifpaddr #undef flags -/* - * Called from rtrequest(RTM_DELETE, ...) to fix up the route's ``family'' - * (i.e., the routes related to it by the operation of cloning). This - * routine is iterated over all potential former-child-routes by way of - * rnh->rnh_walktree_from() above, and those that actually are children of - * the late parent (passed in as VP here) are themselves deleted. - */ -static int -rt_fixdelete(struct radix_node *rn, void *vp) -{ - struct rtentry *rt = RNTORT(rn); - struct rtentry *rt0 = vp; - - if (rt->rt_parent == rt0 && - !(rt->rt_flags & (RTF_PINNED | RTF_CLONING))) { - return rtrequest_fib(RTM_DELETE, rt_key(rt), NULL, rt_mask(rt), - rt->rt_flags|RTF_RNH_LOCKED, NULL, rt->rt_fibnum); - } - return 0; -} - -/* - * This routine is called from rt_setgate() to do the analogous thing for - * adds and changes. There is the added complication in this case of a - * middle insert; i.e., insertion of a new network route between an older - * network route and (cloned) host routes. For this reason, a simple check - * of rt->rt_parent is insufficient; each candidate route must be tested - * against the (mask, value) of the new route (passed as before in vp) - * to see if the new route matches it. - * - * XXX - it may be possible to do fixdelete() for changes and reserve this - * routine just for adds. I'm not sure why I thought it was necessary to do - * changes this way. - */ - -static int -rt_fixchange(struct radix_node *rn, void *vp) -{ - struct rtentry *rt = RNTORT(rn); - struct rtfc_arg *ap = vp; - struct rtentry *rt0 = ap->rt0; - struct radix_node_head *rnh = ap->rnh; - u_char *xk1, *xm1, *xk2, *xmp; - int i, len, mlen; - - /* make sure we have a parent, and route is not pinned or cloning */ - if (!rt->rt_parent || - (rt->rt_flags & (RTF_PINNED | RTF_CLONING))) - return 0; - - if (rt->rt_parent == rt0) /* parent match */ - goto delete_rt; - /* - * There probably is a function somewhere which does this... - * if not, there should be. - */ - len = imin(rt_key(rt0)->sa_len, rt_key(rt)->sa_len); - - xk1 = (u_char *)rt_key(rt0); - xm1 = (u_char *)rt_mask(rt0); - xk2 = (u_char *)rt_key(rt); - - /* avoid applying a less specific route */ - xmp = (u_char *)rt_mask(rt->rt_parent); - mlen = rt_key(rt->rt_parent)->sa_len; - if (mlen > rt_key(rt0)->sa_len) /* less specific route */ - return 0; - for (i = rnh->rnh_treetop->rn_offset; i < mlen; i++) - if ((xmp[i] & ~(xmp[i] ^ xm1[i])) != xmp[i]) - return 0; /* less specific route */ - - for (i = rnh->rnh_treetop->rn_offset; i < len; i++) - if ((xk2[i] & xm1[i]) != xk1[i]) - return 0; /* no match */ - - /* - * OK, this node is a clone, and matches the node currently being - * changed/added under the node's mask. So, get rid of it. - */ -delete_rt: - return rtrequest_fib(RTM_DELETE, rt_key(rt), NULL, - rt_mask(rt), rt->rt_flags, NULL, rt->rt_fibnum); -} - int rt_setgate(struct rtentry *rt, struct sockaddr *dst, struct sockaddr *gate) { @@ -1399,24 +1148,6 @@ again: RADIX_NODE_HEAD_LOCK_ASSERT(rnh); /* - * A host route with the destination equal to the gateway - * will interfere with keeping LLINFO in the routing - * table, so disallow it. - */ - if (((rt->rt_flags & (RTF_HOST|RTF_GATEWAY|RTF_LLINFO)) == - (RTF_HOST|RTF_GATEWAY)) && - dst->sa_len == gate->sa_len && - bcmp(dst, gate, dst->sa_len) == 0) { - /* - * The route might already exist if this is an RTM_CHANGE - * or a routing redirect, so try to delete it. - */ - if (rt_key(rt)) - rtexpunge(rt); - return EADDRNOTAVAIL; - } - - /* * Cloning loop avoidance in case of bad configuration. */ if (rt->rt_flags & RTF_GATEWAY) { @@ -1484,21 +1215,7 @@ again: */ bcopy(gate, rt->rt_gateway, glen); - /* - * This isn't going to do anything useful for host routes, so - * don't bother. Also make sure we have a reasonable mask - * (we don't yet have one during adds). - */ - if (!(rt->rt_flags & RTF_HOST) && rt_mask(rt) != 0) { - struct rtfc_arg arg; - - arg.rnh = rnh; - arg.rt0 = rt; - rnh->rnh_walktree_from(rnh, rt_key(rt), rt_mask(rt), - rt_fixchange, &arg); - } - - return 0; + return (0); } static void @@ -1538,6 +1255,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int char tempbuf[_SOCKADDR_TMPSIZE]; int didwork = 0; int a_failure = 0; + static struct sockaddr_dl null_sdl = {sizeof(null_sdl), AF_LINK}; if (flags & RTF_HOST) { dst = ifa->ifa_dstaddr; @@ -1642,7 +1360,14 @@ rtinit1(struct ifaddr *ifa, int cmd, int info.rti_ifa = ifa; info.rti_flags = flags | ifa->ifa_flags; info.rti_info[RTAX_DST] = dst; - info.rti_info[RTAX_GATEWAY] = ifa->ifa_addr; + /* + * doing this for compatibility reasons + */ + if (cmd == RTM_ADD) + info.rti_info[RTAX_GATEWAY] = + (struct sockaddr *)&null_sdl; + else + info.rti_info[RTAX_GATEWAY] = ifa->ifa_addr; info.rti_info[RTAX_NETMASK] = netmask; error = rtrequest1_fib(cmd, &info, &rt, fibnum); if (error == 0 && rt != NULL) { @@ -1666,6 +1391,15 @@ rtinit1(struct ifaddr *ifa, int cmd, int rt->rt_ifa = ifa; } #endif + /* + * doing this for compatibility reasons + */ + if (cmd == RTM_ADD) { + ((struct sockaddr_dl *)rt->rt_gateway)->sdl_type = + rt->rt_ifp->if_type; + ((struct sockaddr_dl *)rt->rt_gateway)->sdl_index = + rt->rt_ifp->if_index; + } rt_newaddrmsg(cmd, ifa, error, rt); if (cmd == RTM_DELETE) { /* Modified: user/kmacy/HEAD_fast_multi_xmit/sys/net/route.h ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/net/route.h Thu Dec 11 06:27:18 2008 (r185910) +++ user/kmacy/HEAD_fast_multi_xmit/sys/net/route.h Thu Dec 11 06:53:53 2008 (r185911) @@ -143,7 +143,7 @@ struct rtentry { struct sockaddr *rt_genmask; /* for generation of cloned routes */ caddr_t rt_llinfo; /* pointer to link level info cache */ struct rtentry *rt_gwroute; /* implied entry for gatewayed routes */ - struct rtentry *rt_parent; /* cloning parent of this route */ + struct rtentry *rt_parent; /* cloning parent - UNUSED */ u_int rt_fibnum; /* which FIB */ #ifdef _KERNEL /* XXX ugly, user apps use this definition but don't have a mtx def */ @@ -176,9 +176,9 @@ struct ortentry { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Thu Dec 11 06:55:02 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B042A1065676; Thu, 11 Dec 2008 06:55:02 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 320928FC17; Thu, 11 Dec 2008 06:55:02 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBB6t2Ap057028; Thu, 11 Dec 2008 06:55:02 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBB6t1Bl057026; Thu, 11 Dec 2008 06:55:01 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812110655.mBB6t1Bl057026@svn.freebsd.org> From: Kip Macy Date: Thu, 11 Dec 2008 06:55:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185913 - in user/kmacy/HEAD_fast_multi_xmit/usr.sbin: arp ndp X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Dec 2008 06:55:02 -0000 Author: kmacy Date: Thu Dec 11 06:55:01 2008 New Revision: 185913 URL: http://svn.freebsd.org/changeset/base/185913 Log: merge arpv2 changes to ndp and arp Modified: user/kmacy/HEAD_fast_multi_xmit/usr.sbin/arp/arp.c user/kmacy/HEAD_fast_multi_xmit/usr.sbin/ndp/ndp.c Modified: user/kmacy/HEAD_fast_multi_xmit/usr.sbin/arp/arp.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/usr.sbin/arp/arp.c Thu Dec 11 06:54:36 2008 (r185912) +++ user/kmacy/HEAD_fast_multi_xmit/usr.sbin/arp/arp.c Thu Dec 11 06:55:01 2008 (r185913) @@ -445,6 +445,18 @@ delete(char *host, int do_proxy) !(rtm->rtm_flags & RTF_GATEWAY) && valid_type(sdl->sdl_type) ) break; /* found it */ + + /* Qing + * why not just remove the RTF_LLINFO in the above + * code instead of another "if", works + */ + if (sdl->sdl_family == AF_LINK && + !(rtm->rtm_flags & RTF_GATEWAY) && + valid_type(sdl->sdl_type) ) { + addr->sin_addr.s_addr = dst->sin_addr.s_addr; + break; + } + if (dst->sin_other & SIN_PROXY) { fprintf(stderr, "delete: cannot locate %s\n",host); return (1); @@ -563,15 +575,9 @@ print_entry(struct sockaddr_dl *sdl, printf(" permanent"); if (addr->sin_other & SIN_PROXY) printf(" published (proxy only)"); - if (rtm->rtm_addrs & RTA_NETMASK) { - addr = (struct sockaddr_inarp *) - (SA_SIZE(sdl) + (char *)sdl); - if (addr->sin_addr.s_addr == 0xffffffff) - printf(" published"); - if (addr->sin_len != 8) - printf("(weird)"); - } - switch(sdl->sdl_type) { + if (rtm->rtm_flags & RTF_ANNOUNCE) + printf(" published"); + switch(sdl->sdl_type) { case IFT_ETHER: printf(" [ethernet]"); break; Modified: user/kmacy/HEAD_fast_multi_xmit/usr.sbin/ndp/ndp.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/usr.sbin/ndp/ndp.c Thu Dec 11 06:54:36 2008 (r185912) +++ user/kmacy/HEAD_fast_multi_xmit/usr.sbin/ndp/ndp.c Thu Dec 11 06:55:01 2008 (r185913) @@ -114,6 +114,11 @@ ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long)) #define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len)) +#define NEXTADDR(w, s) \ + if (rtm->rtm_addrs & (w)) { \ + bcopy((char *)&s, cp, sizeof(s)); cp += sizeof(s);} + + static pid_t pid; static int nflag; static int tflag; @@ -428,7 +433,6 @@ set(argc, argv) sdl = (struct sockaddr_dl *)(ROUNDUP(sin->sin6_len) + (char *)sin); if (IN6_ARE_ADDR_EQUAL(&sin->sin6_addr, &sin_m.sin6_addr)) { if (sdl->sdl_family == AF_LINK && - (rtm->rtm_flags & RTF_LLINFO) && !(rtm->rtm_flags & RTF_GATEWAY)) { switch (sdl->sdl_type) { case IFT_ETHER: case IFT_FDDI: case IFT_ISO88023: @@ -499,6 +503,7 @@ delete(host) { struct sockaddr_in6 *sin = &sin_m; register struct rt_msghdr *rtm = &m_rtmsg.m_rtm; + register char *cp = m_rtmsg.m_space; struct sockaddr_dl *sdl; struct addrinfo hints, *res; int gai_error; @@ -529,7 +534,6 @@ delete(host) sdl = (struct sockaddr_dl *)(ROUNDUP(sin->sin6_len) + (char *)sin); if (IN6_ARE_ADDR_EQUAL(&sin->sin6_addr, &sin_m.sin6_addr)) { if (sdl->sdl_family == AF_LINK && - (rtm->rtm_flags & RTF_LLINFO) && !(rtm->rtm_flags & RTF_GATEWAY)) { goto delete; } @@ -545,6 +549,11 @@ delete: printf("cannot locate %s\n", host); return (1); } + /* + * need to reinit the field because it has rt_key + * but we want the actual address + */ + NEXTADDR(RTA_DST, sin_m); if (rtmsg(RTM_DELETE) == 0) { struct sockaddr_in6 s6 = *sin; /* XXX: for safety */ @@ -893,9 +902,6 @@ rtmsg(cmd) case RTM_GET: rtm->rtm_addrs |= RTA_DST; } -#define NEXTADDR(w, s) \ - if (rtm->rtm_addrs & (w)) { \ - bcopy((char *)&s, cp, sizeof(s)); cp += SA_SIZE(&s);} NEXTADDR(RTA_DST, sin_m); NEXTADDR(RTA_GATEWAY, sdl_m); @@ -1616,3 +1622,5 @@ ts_print(tvp) (void)printf("%02d:%02d:%02d.%06u ", s / 3600, (s % 3600) / 60, s % 60, (u_int32_t)tvp->tv_usec); } + +#undef NEXTADDR From owner-svn-src-user@FreeBSD.ORG Thu Dec 11 07:01:49 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C65F1065672; Thu, 11 Dec 2008 07:01:49 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2CF478FC1A; Thu, 11 Dec 2008 07:01:49 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBB71nqt057337; Thu, 11 Dec 2008 07:01:49 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBB71m9q057336; Thu, 11 Dec 2008 07:01:48 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812110701.mBB71m9q057336@svn.freebsd.org> From: Kip Macy Date: Thu, 11 Dec 2008 07:01:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185916 - user/kmacy/HEAD_fast_multi_xmit/lib/libstand X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Dec 2008 07:01:49 -0000 Author: kmacy Date: Thu Dec 11 07:01:48 2008 New Revision: 185916 URL: http://svn.freebsd.org/changeset/base/185916 Log: update arpresolve interface Modified: user/kmacy/HEAD_fast_multi_xmit/lib/libstand/if_ether.h Modified: user/kmacy/HEAD_fast_multi_xmit/lib/libstand/if_ether.h ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/lib/libstand/if_ether.h Thu Dec 11 07:00:23 2008 (r185915) +++ user/kmacy/HEAD_fast_multi_xmit/lib/libstand/if_ether.h Thu Dec 11 07:01:48 2008 (r185916) @@ -156,7 +156,7 @@ struct ifqueue arpintrq; void arpwhohas(struct arpcom *, struct in_addr *); void arpintr(void); int arpresolve(struct arpcom *, - struct rtentry *, struct mbuf *, struct sockaddr *, u_char *); + struct rtentry *, struct mbuf *, struct sockaddr *, u_char *, struct llentry **); void arp_ifinit(struct arpcom *, struct ifaddr *); void arp_rtrequest(int, struct rtentry *, struct sockaddr *); @@ -233,7 +233,7 @@ struct ether_multistep { #ifdef _KERNEL void arp_rtrequest(int, struct rtentry *, struct sockaddr *); int arpresolve(struct arpcom *, struct rtentry *, struct mbuf *, - struct sockaddr *, u_char *); + struct sockaddr *, u_char *, struct llentry **); void arpintr(void); int arpioctl(u_long, caddr_t); void arp_ifinit(struct arpcom *, struct ifaddr *); From owner-svn-src-user@FreeBSD.ORG Thu Dec 11 07:02:31 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3529C1065675; Thu, 11 Dec 2008 07:02:31 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 264858FC12; Thu, 11 Dec 2008 07:02:31 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBB72UIV057388; Thu, 11 Dec 2008 07:02:30 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBB72UCk057387; Thu, 11 Dec 2008 07:02:30 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812110702.mBB72UCk057387@svn.freebsd.org> From: Kip Macy Date: Thu, 11 Dec 2008 07:02:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185917 - user/kmacy/HEAD_fast_multi_xmit/lib/libc/stdio X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Dec 2008 07:02:31 -0000 Author: kmacy Date: Thu Dec 11 07:02:30 2008 New Revision: 185917 URL: http://svn.freebsd.org/changeset/base/185917 Log: merge apparent vfprintf change Modified: user/kmacy/HEAD_fast_multi_xmit/lib/libc/stdio/vfprintf.c Modified: user/kmacy/HEAD_fast_multi_xmit/lib/libc/stdio/vfprintf.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/lib/libc/stdio/vfprintf.c Thu Dec 11 07:01:48 2008 (r185916) +++ user/kmacy/HEAD_fast_multi_xmit/lib/libc/stdio/vfprintf.c Thu Dec 11 07:02:30 2008 (r185917) @@ -396,6 +396,12 @@ __vfprintf(FILE *fp, const char *fmt0, v char sign; /* sign prefix (' ', '+', '-', or \0) */ char thousands_sep; /* locale specific thousands separator */ const char *grouping; /* locale specific numeric grouping rules */ + + if (__use_xprintf == 0 && getenv("USE_XPRINTF")) + __use_xprintf = 1; + if (__use_xprintf > 0) + return (__xvprintf(fp, fmt0, ap)); + #ifndef NO_FLOATING_POINT /* * We can decompose the printed representation of floating @@ -562,10 +568,6 @@ __vfprintf(FILE *fp, const char *fmt0, v val = GETARG (int); \ } - if (__use_xprintf == 0 && getenv("USE_XPRINTF")) - __use_xprintf = 1; - if (__use_xprintf > 0) - return (__xvprintf(fp, fmt0, ap)); thousands_sep = '\0'; grouping = NULL; From owner-svn-src-user@FreeBSD.ORG Thu Dec 11 07:43:03 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5BE1106564A; Thu, 11 Dec 2008 07:43:03 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C2DD68FC12; Thu, 11 Dec 2008 07:43:03 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBB7h3Hv058193; Thu, 11 Dec 2008 07:43:03 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBB7h2db058172; Thu, 11 Dec 2008 07:43:02 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812110743.mBB7h2db058172@svn.freebsd.org> From: Kip Macy Date: Thu, 11 Dec 2008 07:43:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185919 - in user/kmacy/HEAD_fast_multi_xmit: contrib/pf lib/libc/stdio sys/boot/zfs sys/compat/freebsd32 sys/compat/linprocfs sys/conf sys/contrib/pf/net sys/dev/ath/ath_hal sys/dev/at... X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Dec 2008 07:43:04 -0000 Author: kmacy Date: Thu Dec 11 07:43:02 2008 New Revision: 185919 URL: http://svn.freebsd.org/changeset/base/185919 Log: IFC 185841:185918 merge latest Added: user/kmacy/HEAD_fast_multi_xmit/sys/kern/kern_vimage.c Modified: user/kmacy/HEAD_fast_multi_xmit/contrib/pf/ (props changed) user/kmacy/HEAD_fast_multi_xmit/lib/libc/stdio/vfprintf.c user/kmacy/HEAD_fast_multi_xmit/lib/libc/stdio/vfwprintf.c user/kmacy/HEAD_fast_multi_xmit/sys/boot/zfs/zfs.c user/kmacy/HEAD_fast_multi_xmit/sys/boot/zfs/zfsimpl.c user/kmacy/HEAD_fast_multi_xmit/sys/compat/freebsd32/freebsd32_proto.h user/kmacy/HEAD_fast_multi_xmit/sys/compat/freebsd32/freebsd32_signal.h user/kmacy/HEAD_fast_multi_xmit/sys/compat/freebsd32/freebsd32_syscall.h user/kmacy/HEAD_fast_multi_xmit/sys/compat/freebsd32/freebsd32_syscalls.c user/kmacy/HEAD_fast_multi_xmit/sys/compat/freebsd32/freebsd32_sysent.c user/kmacy/HEAD_fast_multi_xmit/sys/compat/freebsd32/syscalls.master user/kmacy/HEAD_fast_multi_xmit/sys/compat/linprocfs/linprocfs.c user/kmacy/HEAD_fast_multi_xmit/sys/conf/files user/kmacy/HEAD_fast_multi_xmit/sys/conf/options user/kmacy/HEAD_fast_multi_xmit/sys/contrib/pf/net/pf_subr.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/ath/ath_hal/ah_eeprom_v14.c (contents, props changed) user/kmacy/HEAD_fast_multi_xmit/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c (contents, props changed) user/kmacy/HEAD_fast_multi_xmit/sys/dev/pccbb/pccbb_pci.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/re/if_re.c user/kmacy/HEAD_fast_multi_xmit/sys/fs/procfs/procfs_map.c user/kmacy/HEAD_fast_multi_xmit/sys/kern/kern_jail.c user/kmacy/HEAD_fast_multi_xmit/sys/kern/kern_linker.c user/kmacy/HEAD_fast_multi_xmit/sys/kern/kern_mbuf.c user/kmacy/HEAD_fast_multi_xmit/sys/kern/subr_prf.c user/kmacy/HEAD_fast_multi_xmit/sys/kern/uipc_socket.c user/kmacy/HEAD_fast_multi_xmit/sys/kern/vfs_aio.c user/kmacy/HEAD_fast_multi_xmit/sys/mips/adm5120/adm5120_machdep.c user/kmacy/HEAD_fast_multi_xmit/sys/modules/aio/Makefile user/kmacy/HEAD_fast_multi_xmit/sys/net/if.c user/kmacy/HEAD_fast_multi_xmit/sys/net/if_bridge.c user/kmacy/HEAD_fast_multi_xmit/sys/net/if_ethersubr.c user/kmacy/HEAD_fast_multi_xmit/sys/net/if_gif.c user/kmacy/HEAD_fast_multi_xmit/sys/net/if_gif.h user/kmacy/HEAD_fast_multi_xmit/sys/net/route.c user/kmacy/HEAD_fast_multi_xmit/sys/net/rtsock.c user/kmacy/HEAD_fast_multi_xmit/sys/net/vnet.h user/kmacy/HEAD_fast_multi_xmit/sys/netgraph/netgraph.h user/kmacy/HEAD_fast_multi_xmit/sys/netgraph/ng_base.c user/kmacy/HEAD_fast_multi_xmit/sys/netgraph/ng_bridge.c user/kmacy/HEAD_fast_multi_xmit/sys/netgraph/ng_eiface.c user/kmacy/HEAD_fast_multi_xmit/sys/netgraph/ng_iface.c user/kmacy/HEAD_fast_multi_xmit/sys/netgraph/ng_ipfw.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/if_ether.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/in_pcb.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/in_proto.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/ip_divert.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/ip_dummynet.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/ip_fw.h user/kmacy/HEAD_fast_multi_xmit/sys/netinet/ip_fw2.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/ip_fw_nat.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/ip_fw_pfil.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/ip_input.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/ip_output.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/ip_var.h user/kmacy/HEAD_fast_multi_xmit/sys/netinet/libalias/alias_db.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/raw_ip.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/sctp_os_bsd.h user/kmacy/HEAD_fast_multi_xmit/sys/netinet/sctp_pcb.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/tcp_sack.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/tcp_subr.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/tcp_syncache.h user/kmacy/HEAD_fast_multi_xmit/sys/netinet/tcp_var.h user/kmacy/HEAD_fast_multi_xmit/sys/netinet/udp_usrreq.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/vinet.h user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/in6_proto.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/ip6_input.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/nd6.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/vinet6.h user/kmacy/HEAD_fast_multi_xmit/sys/netipsec/ipsec.c user/kmacy/HEAD_fast_multi_xmit/sys/netipsec/vipsec.h user/kmacy/HEAD_fast_multi_xmit/sys/nfsserver/nfs_fha.c user/kmacy/HEAD_fast_multi_xmit/sys/pci/if_rlreg.h user/kmacy/HEAD_fast_multi_xmit/sys/sys/aio.h user/kmacy/HEAD_fast_multi_xmit/sys/sys/kernel.h user/kmacy/HEAD_fast_multi_xmit/sys/sys/sysctl.h user/kmacy/HEAD_fast_multi_xmit/sys/sys/vimage.h user/kmacy/HEAD_fast_multi_xmit/usr.bin/fetch/fetch.c user/kmacy/HEAD_fast_multi_xmit/usr.sbin/jexec/jexec.c user/kmacy/HEAD_fast_multi_xmit/usr.sbin/jls/jls.c Modified: user/kmacy/HEAD_fast_multi_xmit/lib/libc/stdio/vfprintf.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/lib/libc/stdio/vfprintf.c Thu Dec 11 07:39:06 2008 (r185918) +++ user/kmacy/HEAD_fast_multi_xmit/lib/libc/stdio/vfprintf.c Thu Dec 11 07:43:02 2008 (r185919) @@ -569,13 +569,6 @@ __vfprintf(FILE *fp, const char *fmt0, v } - thousands_sep = '\0'; - grouping = NULL; - convbuf = NULL; -#ifndef NO_FLOATING_POINT - dtoaresult = NULL; - decimal_point = localeconv()->decimal_point; -#endif /* sorry, fprintf(read_only_file, "") returns EOF, not 0 */ if (prepwrite(fp) != 0) return (EOF); @@ -585,6 +578,9 @@ __vfprintf(FILE *fp, const char *fmt0, v fp->_file >= 0) return (__sbprintf(fp, fmt0, ap)); + thousands_sep = '\0'; + grouping = NULL; + convbuf = NULL; fmt = (char *)fmt0; argtable = NULL; nextarg = 1; @@ -593,6 +589,10 @@ __vfprintf(FILE *fp, const char *fmt0, v uio.uio_resid = 0; uio.uio_iovcnt = 0; ret = 0; +#ifndef NO_FLOATING_POINT + dtoaresult = NULL; + decimal_point = localeconv()->decimal_point; +#endif /* * Scan the format for conversions (`%' character). Modified: user/kmacy/HEAD_fast_multi_xmit/lib/libc/stdio/vfwprintf.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/lib/libc/stdio/vfwprintf.c Thu Dec 11 07:39:06 2008 (r185918) +++ user/kmacy/HEAD_fast_multi_xmit/lib/libc/stdio/vfwprintf.c Thu Dec 11 07:43:02 2008 (r185919) @@ -575,12 +575,6 @@ __vfwprintf(FILE *fp, const wchar_t *fmt } - thousands_sep = '\0'; - grouping = NULL; -#ifndef NO_FLOATING_POINT - decimal_point = localeconv()->decimal_point; -#endif - convbuf = NULL; /* sorry, fwprintf(read_only_file, L"") returns WEOF, not 0 */ if (prepwrite(fp) != 0) return (EOF); @@ -590,11 +584,17 @@ __vfwprintf(FILE *fp, const wchar_t *fmt fp->_file >= 0) return (__sbprintf(fp, fmt0, ap)); + thousands_sep = '\0'; + grouping = NULL; + convbuf = NULL; fmt = (wchar_t *)fmt0; argtable = NULL; nextarg = 1; va_copy(orgap, ap); ret = 0; +#ifndef NO_FLOATING_POINT + decimal_point = localeconv()->decimal_point; +#endif /* * Scan the format for conversions (`%' character). Modified: user/kmacy/HEAD_fast_multi_xmit/sys/boot/zfs/zfs.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/boot/zfs/zfs.c Thu Dec 11 07:39:06 2008 (r185918) +++ user/kmacy/HEAD_fast_multi_xmit/sys/boot/zfs/zfs.c Thu Dec 11 07:43:02 2008 (r185919) @@ -474,7 +474,6 @@ zfs_dev_open(struct open_file *f, ...) * the pool. */ unit = dev->d_unit; - free(dev); i = 0; STAILQ_FOREACH(spa, &zfs_pools, spa_link) { Modified: user/kmacy/HEAD_fast_multi_xmit/sys/boot/zfs/zfsimpl.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/boot/zfs/zfsimpl.c Thu Dec 11 07:39:06 2008 (r185918) +++ user/kmacy/HEAD_fast_multi_xmit/sys/boot/zfs/zfsimpl.c Thu Dec 11 07:43:02 2008 (r185919) @@ -623,7 +623,7 @@ vdev_probe(vdev_read_t *read, void *read uint64_t pool_txg, pool_guid; const char *pool_name; const unsigned char *vdevs; - int i; + int i, rc; char upbuf[1024]; const struct uberblock *up; @@ -723,7 +723,9 @@ vdev_probe(vdev_read_t *read, void *read DATA_TYPE_NVLIST, 0, &vdevs)) { return (EIO); } - vdev_init_from_nvlist(vdevs, &top_vdev); + rc = vdev_init_from_nvlist(vdevs, &top_vdev); + if (rc) + return (rc); /* * Add the toplevel vdev to the pool if its not already there. Modified: user/kmacy/HEAD_fast_multi_xmit/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/compat/freebsd32/freebsd32_proto.h Thu Dec 11 07:39:06 2008 (r185918) +++ user/kmacy/HEAD_fast_multi_xmit/sys/compat/freebsd32/freebsd32_proto.h Thu Dec 11 07:43:02 2008 (r185919) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 185435 2008-11-29 14:32:14Z bz + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 185878 2008-12-10 20:56:19Z jhb */ #ifndef _FREEBSD32_SYSPROTO_H_ @@ -215,6 +215,18 @@ struct freebsd32_nanosleep_args { char rqtp_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * rqtp; char rqtp_r_[PADR_(const struct timespec32 *)]; char rmtp_l_[PADL_(struct timespec32 *)]; struct timespec32 * rmtp; char rmtp_r_[PADR_(struct timespec32 *)]; }; +struct freebsd32_aio_read_args { + char aiocbp_l_[PADL_(struct aiocb32 *)]; struct aiocb32 * aiocbp; char aiocbp_r_[PADR_(struct aiocb32 *)]; +}; +struct freebsd32_aio_write_args { + char aiocbp_l_[PADL_(struct aiocb32 *)]; struct aiocb32 * aiocbp; char aiocbp_r_[PADR_(struct aiocb32 *)]; +}; +struct freebsd32_lio_listio_args { + char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)]; + char acb_list_l_[PADL_(struct aiocb32 *const *)]; struct aiocb32 *const * acb_list; char acb_list_r_[PADR_(struct aiocb32 *const *)]; + char nent_l_[PADL_(int)]; int nent; char nent_r_[PADR_(int)]; + char sig_l_[PADL_(struct sigevent *)]; struct sigevent * sig; char sig_r_[PADR_(struct sigevent *)]; +}; struct freebsd32_lutimes_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char tptr_l_[PADL_(struct timeval32 *)]; struct timeval32 * tptr; char tptr_r_[PADR_(struct timeval32 *)]; @@ -235,6 +247,33 @@ struct freebsd32_modstat_args { char modid_l_[PADL_(int)]; int modid; char modid_r_[PADR_(int)]; char stat_l_[PADL_(struct module_stat32 *)]; struct module_stat32 * stat; char stat_r_[PADR_(struct module_stat32 *)]; }; +struct freebsd32_aio_return_args { + char aiocbp_l_[PADL_(struct aiocb32 *)]; struct aiocb32 * aiocbp; char aiocbp_r_[PADR_(struct aiocb32 *)]; +}; +struct freebsd32_aio_suspend_args { + char aiocbp_l_[PADL_(struct aiocb32 *const *)]; struct aiocb32 *const * aiocbp; char aiocbp_r_[PADR_(struct aiocb32 *const *)]; + char nent_l_[PADL_(int)]; int nent; char nent_r_[PADR_(int)]; + char timeout_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * timeout; char timeout_r_[PADR_(const struct timespec32 *)]; +}; +struct freebsd32_aio_cancel_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char aiocbp_l_[PADL_(struct aiocb32 *)]; struct aiocb32 * aiocbp; char aiocbp_r_[PADR_(struct aiocb32 *)]; +}; +struct freebsd32_aio_error_args { + char aiocbp_l_[PADL_(struct aiocb32 *)]; struct aiocb32 * aiocbp; char aiocbp_r_[PADR_(struct aiocb32 *)]; +}; +struct freebsd32_oaio_read_args { + char aiocbp_l_[PADL_(struct oaiocb32 *)]; struct oaiocb32 * aiocbp; char aiocbp_r_[PADR_(struct oaiocb32 *)]; +}; +struct freebsd32_oaio_write_args { + char aiocbp_l_[PADL_(struct oaiocb32 *)]; struct oaiocb32 * aiocbp; char aiocbp_r_[PADR_(struct oaiocb32 *)]; +}; +struct freebsd32_olio_listio_args { + char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)]; + char acb_list_l_[PADL_(struct oaiocb32 *const *)]; struct oaiocb32 *const * acb_list; char acb_list_r_[PADR_(struct oaiocb32 *const *)]; + char nent_l_[PADL_(int)]; int nent; char nent_r_[PADR_(int)]; + char sig_l_[PADL_(struct osigevent32 *)]; struct osigevent32 * sig; char sig_r_[PADR_(struct osigevent32 *)]; +}; struct freebsd32_jail_args { char jail_l_[PADL_(struct jail32 *)]; struct jail32 * jail; char jail_r_[PADR_(struct jail32 *)]; }; @@ -247,6 +286,10 @@ struct freebsd32_sigwaitinfo_args { char set_l_[PADL_(const sigset_t *)]; const sigset_t * set; char set_r_[PADR_(const sigset_t *)]; char info_l_[PADL_(siginfo_t *)]; siginfo_t * info; char info_r_[PADR_(siginfo_t *)]; }; +struct freebsd32_aio_waitcomplete_args { + char aiocbp_l_[PADL_(struct aiocb32 **)]; struct aiocb32 ** aiocbp; char aiocbp_r_[PADR_(struct aiocb32 **)]; + char timeout_l_[PADL_(struct timespec32 *)]; struct timespec32 * timeout; char timeout_r_[PADR_(struct timespec32 *)]; +}; struct freebsd32_kevent_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char changelist_l_[PADL_(const struct kevent32 *)]; const struct kevent32 * changelist; char changelist_r_[PADR_(const struct kevent32 *)]; @@ -308,6 +351,10 @@ struct freebsd32_thr_new_args { char param_l_[PADL_(struct thr_param32 *)]; struct thr_param32 * param; char param_r_[PADR_(struct thr_param32 *)]; char param_size_l_[PADL_(int)]; int param_size; char param_size_r_[PADR_(int)]; }; +struct freebsd32_aio_fsync_args { + char op_l_[PADL_(int)]; int op; char op_r_[PADR_(int)]; + char aiocbp_l_[PADL_(struct aiocb32 *)]; struct aiocb32 * aiocbp; char aiocbp_r_[PADR_(struct aiocb32 *)]; +}; struct freebsd32_pread_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)]; @@ -427,13 +474,24 @@ int freebsd32_clock_gettime(struct threa int freebsd32_clock_settime(struct thread *, struct freebsd32_clock_settime_args *); int freebsd32_clock_getres(struct thread *, struct freebsd32_clock_getres_args *); int freebsd32_nanosleep(struct thread *, struct freebsd32_nanosleep_args *); +int freebsd32_aio_read(struct thread *, struct freebsd32_aio_read_args *); +int freebsd32_aio_write(struct thread *, struct freebsd32_aio_write_args *); +int freebsd32_lio_listio(struct thread *, struct freebsd32_lio_listio_args *); int freebsd32_lutimes(struct thread *, struct freebsd32_lutimes_args *); int freebsd32_preadv(struct thread *, struct freebsd32_preadv_args *); int freebsd32_pwritev(struct thread *, struct freebsd32_pwritev_args *); int freebsd32_modstat(struct thread *, struct freebsd32_modstat_args *); +int freebsd32_aio_return(struct thread *, struct freebsd32_aio_return_args *); +int freebsd32_aio_suspend(struct thread *, struct freebsd32_aio_suspend_args *); +int freebsd32_aio_cancel(struct thread *, struct freebsd32_aio_cancel_args *); +int freebsd32_aio_error(struct thread *, struct freebsd32_aio_error_args *); +int freebsd32_oaio_read(struct thread *, struct freebsd32_oaio_read_args *); +int freebsd32_oaio_write(struct thread *, struct freebsd32_oaio_write_args *); +int freebsd32_olio_listio(struct thread *, struct freebsd32_olio_listio_args *); int freebsd32_jail(struct thread *, struct freebsd32_jail_args *); int freebsd32_sigtimedwait(struct thread *, struct freebsd32_sigtimedwait_args *); int freebsd32_sigwaitinfo(struct thread *, struct freebsd32_sigwaitinfo_args *); +int freebsd32_aio_waitcomplete(struct thread *, struct freebsd32_aio_waitcomplete_args *); int freebsd32_kevent(struct thread *, struct freebsd32_kevent_args *); int freebsd32_nmount(struct thread *, struct freebsd32_nmount_args *); int freebsd32_sendfile(struct thread *, struct freebsd32_sendfile_args *); @@ -447,6 +505,7 @@ int freebsd32_umtx_unlock(struct thread int freebsd32_thr_suspend(struct thread *, struct freebsd32_thr_suspend_args *); int freebsd32_umtx_op(struct thread *, struct freebsd32_umtx_op_args *); int freebsd32_thr_new(struct thread *, struct freebsd32_thr_new_args *); +int freebsd32_aio_fsync(struct thread *, struct freebsd32_aio_fsync_args *); int freebsd32_pread(struct thread *, struct freebsd32_pread_args *); int freebsd32_pwrite(struct thread *, struct freebsd32_pwrite_args *); int freebsd32_mmap(struct thread *, struct freebsd32_mmap_args *); @@ -641,13 +700,24 @@ int freebsd6_freebsd32_ftruncate(struct #define FREEBSD32_SYS_AUE_freebsd32_clock_settime AUE_CLOCK_SETTIME #define FREEBSD32_SYS_AUE_freebsd32_clock_getres AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_nanosleep AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_aio_read AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_aio_write AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_lio_listio AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_lutimes AUE_LUTIMES #define FREEBSD32_SYS_AUE_freebsd32_preadv AUE_PREADV #define FREEBSD32_SYS_AUE_freebsd32_pwritev AUE_PWRITEV #define FREEBSD32_SYS_AUE_freebsd32_modstat AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_aio_return AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_aio_suspend AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_aio_cancel AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_aio_error AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_oaio_read AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_oaio_write AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_olio_listio AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_jail AUE_JAIL #define FREEBSD32_SYS_AUE_freebsd32_sigtimedwait AUE_SIGWAIT #define FREEBSD32_SYS_AUE_freebsd32_sigwaitinfo AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_aio_waitcomplete AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_kevent AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_nmount AUE_NMOUNT #define FREEBSD32_SYS_AUE_freebsd32_sendfile AUE_SENDFILE @@ -661,6 +731,7 @@ int freebsd6_freebsd32_ftruncate(struct #define FREEBSD32_SYS_AUE_freebsd32_thr_suspend AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_umtx_op AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_thr_new AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_aio_fsync AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_pread AUE_PREAD #define FREEBSD32_SYS_AUE_freebsd32_pwrite AUE_PWRITE #define FREEBSD32_SYS_AUE_freebsd32_mmap AUE_MMAP Modified: user/kmacy/HEAD_fast_multi_xmit/sys/compat/freebsd32/freebsd32_signal.h ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/compat/freebsd32/freebsd32_signal.h Thu Dec 11 07:39:06 2008 (r185918) +++ user/kmacy/HEAD_fast_multi_xmit/sys/compat/freebsd32/freebsd32_signal.h Thu Dec 11 07:43:02 2008 (r185919) @@ -36,6 +36,9 @@ struct sigaltstack32 { }; union sigval32 { + int sival_int; + u_int32_t sival_ptr; + /* 6.0 compatibility */ int sigval_int; u_int32_t sigval_ptr; }; @@ -70,6 +73,29 @@ struct siginfo32 { } _reason; }; +struct osigevent32 { + int sigev_notify; /* Notification type */ + union { + int __sigev_signo; /* Signal number */ + int __sigev_notify_kqueue; + } __sigev_u; + union sigval32 sigev_value; /* Signal value */ +}; + +struct sigevent32 { + int sigev_notify; /* Notification type */ + int sigev_signo; /* Signal number */ + union sigval32 sigev_value; /* Signal value */ + union { + __lwpid_t _threadid; + struct { + uint32_t _function; + uint32_t _attribute; + } _sigev_thread; + uint32_t __spare__[8]; + } _sigev_un; +}; + void siginfo_to_siginfo32(siginfo_t *src, struct siginfo32 *dst); #endif /* !_COMPAT_FREEBSD32_SIGNAL_H_ */ Modified: user/kmacy/HEAD_fast_multi_xmit/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/compat/freebsd32/freebsd32_syscall.h Thu Dec 11 07:39:06 2008 (r185918) +++ user/kmacy/HEAD_fast_multi_xmit/sys/compat/freebsd32/freebsd32_syscall.h Thu Dec 11 07:43:02 2008 (r185919) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 185435 2008-11-29 14:32:14Z bz + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 185878 2008-12-10 20:56:19Z jhb */ #define FREEBSD32_SYS_syscall 0 @@ -210,6 +210,9 @@ #define FREEBSD32_SYS_openbsd_poll 252 #define FREEBSD32_SYS_issetugid 253 #define FREEBSD32_SYS_lchown 254 +#define FREEBSD32_SYS_freebsd32_aio_read 255 +#define FREEBSD32_SYS_freebsd32_aio_write 256 +#define FREEBSD32_SYS_freebsd32_lio_listio 257 #define FREEBSD32_SYS_getdents 272 #define FREEBSD32_SYS_lchmod 274 #define FREEBSD32_SYS_netbsd_lchown 275 @@ -237,6 +240,13 @@ #define FREEBSD32_SYS_setresuid 311 #define FREEBSD32_SYS_setresgid 312 /* 313 is obsolete signanosleep */ +#define FREEBSD32_SYS_freebsd32_aio_return 314 +#define FREEBSD32_SYS_freebsd32_aio_suspend 315 +#define FREEBSD32_SYS_freebsd32_aio_cancel 316 +#define FREEBSD32_SYS_freebsd32_aio_error 317 +#define FREEBSD32_SYS_freebsd32_oaio_read 318 +#define FREEBSD32_SYS_freebsd32_oaio_write 319 +#define FREEBSD32_SYS_freebsd32_olio_listio 320 #define FREEBSD32_SYS_yield 321 /* 322 is obsolete thr_sleep */ /* 323 is obsolete thr_wakeup */ @@ -274,6 +284,7 @@ #define FREEBSD32_SYS_extattr_set_file 356 #define FREEBSD32_SYS_extattr_get_file 357 #define FREEBSD32_SYS_extattr_delete_file 358 +#define FREEBSD32_SYS_freebsd32_aio_waitcomplete 359 #define FREEBSD32_SYS_getresuid 360 #define FREEBSD32_SYS_getresgid 361 #define FREEBSD32_SYS_kqueue 362 @@ -321,6 +332,7 @@ #define FREEBSD32_SYS_sigqueue 456 #define FREEBSD32_SYS_abort2 463 #define FREEBSD32_SYS_thr_set_name 464 +#define FREEBSD32_SYS_freebsd32_aio_fsync 465 #define FREEBSD32_SYS_rtprio_thread 466 #define FREEBSD32_SYS_sctp_peeloff 471 #define FREEBSD32_SYS_sctp_generic_sendmsg 472 Modified: user/kmacy/HEAD_fast_multi_xmit/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/compat/freebsd32/freebsd32_syscalls.c Thu Dec 11 07:39:06 2008 (r185918) +++ user/kmacy/HEAD_fast_multi_xmit/sys/compat/freebsd32/freebsd32_syscalls.c Thu Dec 11 07:43:02 2008 (r185919) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 185435 2008-11-29 14:32:14Z bz + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 185878 2008-12-10 20:56:19Z jhb */ const char *freebsd32_syscallnames[] = { @@ -262,9 +262,9 @@ const char *freebsd32_syscallnames[] = { "openbsd_poll", /* 252 = openbsd_poll */ "issetugid", /* 253 = issetugid */ "lchown", /* 254 = lchown */ - "#255", /* 255 = nosys */ - "#256", /* 256 = nosys */ - "#257", /* 257 = nosys */ + "freebsd32_aio_read", /* 255 = freebsd32_aio_read */ + "freebsd32_aio_write", /* 256 = freebsd32_aio_write */ + "freebsd32_lio_listio", /* 257 = freebsd32_lio_listio */ "#258", /* 258 = nosys */ "#259", /* 259 = nosys */ "#260", /* 260 = nosys */ @@ -321,13 +321,13 @@ const char *freebsd32_syscallnames[] = { "setresuid", /* 311 = setresuid */ "setresgid", /* 312 = setresgid */ "obs_signanosleep", /* 313 = obsolete signanosleep */ - "#314", /* 314 = aio_return */ - "#315", /* 315 = aio_suspend */ - "#316", /* 316 = aio_cancel */ - "#317", /* 317 = aio_error */ - "#318", /* 318 = aio_read */ - "#319", /* 319 = aio_write */ - "#320", /* 320 = lio_listio */ + "freebsd32_aio_return", /* 314 = freebsd32_aio_return */ + "freebsd32_aio_suspend", /* 315 = freebsd32_aio_suspend */ + "freebsd32_aio_cancel", /* 316 = freebsd32_aio_cancel */ + "freebsd32_aio_error", /* 317 = freebsd32_aio_error */ + "freebsd32_oaio_read", /* 318 = freebsd32_oaio_read */ + "freebsd32_oaio_write", /* 319 = freebsd32_oaio_write */ + "freebsd32_olio_listio", /* 320 = freebsd32_olio_listio */ "yield", /* 321 = yield */ "obs_thr_sleep", /* 322 = obsolete thr_sleep */ "obs_thr_wakeup", /* 323 = obsolete thr_wakeup */ @@ -366,7 +366,7 @@ const char *freebsd32_syscallnames[] = { "extattr_set_file", /* 356 = extattr_set_file */ "extattr_get_file", /* 357 = extattr_get_file */ "extattr_delete_file", /* 358 = extattr_delete_file */ - "#359", /* 359 = aio_waitcomplete */ + "freebsd32_aio_waitcomplete", /* 359 = freebsd32_aio_waitcomplete */ "getresuid", /* 360 = getresuid */ "getresgid", /* 361 = getresgid */ "kqueue", /* 362 = kqueue */ @@ -472,7 +472,7 @@ const char *freebsd32_syscallnames[] = { "#462", /* 462 = kmq_unlink */ "abort2", /* 463 = abort2 */ "thr_set_name", /* 464 = thr_set_name */ - "#465", /* 465 = aio_fsync */ + "freebsd32_aio_fsync", /* 465 = freebsd32_aio_fsync */ "rtprio_thread", /* 466 = rtprio_thread */ "#467", /* 467 = nosys */ "#468", /* 468 = nosys */ Modified: user/kmacy/HEAD_fast_multi_xmit/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/compat/freebsd32/freebsd32_sysent.c Thu Dec 11 07:39:06 2008 (r185918) +++ user/kmacy/HEAD_fast_multi_xmit/sys/compat/freebsd32/freebsd32_sysent.c Thu Dec 11 07:43:02 2008 (r185919) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 185435 2008-11-29 14:32:14Z bz + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 185878 2008-12-10 20:56:19Z jhb */ #include "opt_compat.h" @@ -293,9 +293,9 @@ struct sysent freebsd32_sysent[] = { { AS(openbsd_poll_args), (sy_call_t *)openbsd_poll, AUE_POLL, NULL, 0, 0 }, /* 252 = openbsd_poll */ { 0, (sy_call_t *)issetugid, AUE_ISSETUGID, NULL, 0, 0 }, /* 253 = issetugid */ { AS(lchown_args), (sy_call_t *)lchown, AUE_LCHOWN, NULL, 0, 0 }, /* 254 = lchown */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 255 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 256 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 257 = nosys */ + { AS(freebsd32_aio_read_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 255 = freebsd32_aio_read */ + { AS(freebsd32_aio_write_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 256 = freebsd32_aio_write */ + { AS(freebsd32_lio_listio_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 257 = freebsd32_lio_listio */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 258 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 259 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 260 = nosys */ @@ -352,13 +352,13 @@ struct sysent freebsd32_sysent[] = { { AS(setresuid_args), (sy_call_t *)setresuid, AUE_SETRESUID, NULL, 0, 0 }, /* 311 = setresuid */ { AS(setresgid_args), (sy_call_t *)setresgid, AUE_SETRESGID, NULL, 0, 0 }, /* 312 = setresgid */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 313 = obsolete signanosleep */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 314 = aio_return */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 315 = aio_suspend */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 316 = aio_cancel */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 317 = aio_error */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 318 = aio_read */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 319 = aio_write */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 320 = lio_listio */ + { AS(freebsd32_aio_return_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 314 = freebsd32_aio_return */ + { AS(freebsd32_aio_suspend_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 315 = freebsd32_aio_suspend */ + { AS(freebsd32_aio_cancel_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 316 = freebsd32_aio_cancel */ + { AS(freebsd32_aio_error_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 317 = freebsd32_aio_error */ + { AS(freebsd32_oaio_read_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 318 = freebsd32_oaio_read */ + { AS(freebsd32_oaio_write_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 319 = freebsd32_oaio_write */ + { AS(freebsd32_olio_listio_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 320 = freebsd32_olio_listio */ { 0, (sy_call_t *)yield, AUE_NULL, NULL, 0, 0 }, /* 321 = yield */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 322 = obsolete thr_sleep */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 323 = obsolete thr_wakeup */ @@ -397,7 +397,7 @@ struct sysent freebsd32_sysent[] = { { AS(extattr_set_file_args), (sy_call_t *)extattr_set_file, AUE_EXTATTR_SET_FILE, NULL, 0, 0 }, /* 356 = extattr_set_file */ { AS(extattr_get_file_args), (sy_call_t *)extattr_get_file, AUE_EXTATTR_GET_FILE, NULL, 0, 0 }, /* 357 = extattr_get_file */ { AS(extattr_delete_file_args), (sy_call_t *)extattr_delete_file, AUE_EXTATTR_DELETE_FILE, NULL, 0, 0 }, /* 358 = extattr_delete_file */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 359 = aio_waitcomplete */ + { AS(freebsd32_aio_waitcomplete_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 359 = freebsd32_aio_waitcomplete */ { AS(getresuid_args), (sy_call_t *)getresuid, AUE_GETRESUID, NULL, 0, 0 }, /* 360 = getresuid */ { AS(getresgid_args), (sy_call_t *)getresgid, AUE_GETRESGID, NULL, 0, 0 }, /* 361 = getresgid */ { 0, (sy_call_t *)kqueue, AUE_KQUEUE, NULL, 0, 0 }, /* 362 = kqueue */ @@ -503,7 +503,7 @@ struct sysent freebsd32_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 462 = kmq_unlink */ { AS(abort2_args), (sy_call_t *)abort2, AUE_NULL, NULL, 0, 0 }, /* 463 = abort2 */ { AS(thr_set_name_args), (sy_call_t *)thr_set_name, AUE_NULL, NULL, 0, 0 }, /* 464 = thr_set_name */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 465 = aio_fsync */ + { AS(freebsd32_aio_fsync_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 465 = freebsd32_aio_fsync */ { AS(rtprio_thread_args), (sy_call_t *)rtprio_thread, AUE_RTPRIO, NULL, 0, 0 }, /* 466 = rtprio_thread */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 467 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 468 = nosys */ Modified: user/kmacy/HEAD_fast_multi_xmit/sys/compat/freebsd32/syscalls.master ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/compat/freebsd32/syscalls.master Thu Dec 11 07:39:06 2008 (r185918) +++ user/kmacy/HEAD_fast_multi_xmit/sys/compat/freebsd32/syscalls.master Thu Dec 11 07:43:02 2008 (r185919) @@ -454,9 +454,13 @@ u_int nfds, int timeout); } 253 AUE_ISSETUGID NOPROTO { int issetugid(void); } 254 AUE_LCHOWN NOPROTO { int lchown(char *path, int uid, int gid); } -255 AUE_NULL UNIMPL nosys -256 AUE_NULL UNIMPL nosys -257 AUE_NULL UNIMPL nosys +255 AUE_NULL NOSTD { int freebsd32_aio_read( \ + struct aiocb32 *aiocbp); } +256 AUE_NULL NOSTD { int freebsd32_aio_write( \ + struct aiocb32 *aiocbp); } +257 AUE_NULL NOSTD { int freebsd32_lio_listio(int mode, \ + struct aiocb32 * const *acb_list, \ + int nent, struct sigevent *sig); } 258 AUE_NULL UNIMPL nosys 259 AUE_NULL UNIMPL nosys 260 AUE_NULL UNIMPL nosys @@ -535,13 +539,22 @@ 312 AUE_SETRESGID NOPROTO { int setresgid(gid_t rgid, gid_t egid, \ gid_t sgid); } 313 AUE_NULL OBSOL signanosleep -314 AUE_NULL UNIMPL aio_return -315 AUE_NULL UNIMPL aio_suspend -316 AUE_NULL UNIMPL aio_cancel -317 AUE_NULL UNIMPL aio_error -318 AUE_NULL UNIMPL aio_read -319 AUE_NULL UNIMPL aio_write -320 AUE_NULL UNIMPL lio_listio +314 AUE_NULL NOSTD { int freebsd32_aio_return( \ + struct aiocb32 *aiocbp); } +315 AUE_NULL NOSTD { int freebsd32_aio_suspend( \ + struct aiocb32 * const * aiocbp, int nent, \ + const struct timespec32 *timeout); } +316 AUE_NULL NOSTD { int freebsd32_aio_cancel(int fd, \ + struct aiocb32 *aiocbp); } +317 AUE_NULL NOSTD { int freebsd32_aio_error( \ + struct aiocb32 *aiocbp); } +318 AUE_NULL NOSTD { int freebsd32_oaio_read( \ + struct oaiocb32 *aiocbp); } +319 AUE_NULL NOSTD { int freebsd32_oaio_write( \ + struct oaiocb32 *aiocbp); } +320 AUE_NULL NOSTD { int freebsd32_olio_listio(int mode, \ + struct oaiocb32 * const *acb_list, \ + int nent, struct osigevent32 *sig); } 321 AUE_NULL NOPROTO { int yield(void); } 322 AUE_NULL OBSOL thr_sleep 323 AUE_NULL OBSOL thr_wakeup @@ -618,7 +631,9 @@ 358 AUE_EXTATTR_DELETE_FILE NOPROTO { int extattr_delete_file( \ const char *path, int attrnamespace, \ const char *attrname); } -359 AUE_NULL UNIMPL aio_waitcomplete +359 AUE_NULL NOSTD { int freebsd32_aio_waitcomplete( \ + struct aiocb32 **aiocbp, \ + struct timespec32 *timeout); } 360 AUE_GETRESUID NOPROTO { int getresuid(uid_t *ruid, uid_t *euid, \ uid_t *suid); } 361 AUE_GETRESGID NOPROTO { int getresgid(gid_t *rgid, gid_t *egid, \ @@ -766,7 +781,8 @@ 462 AUE_NULL UNIMPL kmq_unlink 463 AUE_NULL NOPROTO { int abort2(const char *why, int nargs, void **args); } 464 AUE_NULL NOPROTO { int thr_set_name(long id, const char *name); } -465 AUE_NULL UNIMPL aio_fsync +465 AUE_NULL NOSTD { int freebsd32_aio_fsync(int op, \ + struct aiocb32 *aiocbp); } 466 AUE_RTPRIO NOPROTO { int rtprio_thread(int function, \ lwpid_t lwpid, struct rtprio *rtp); } 467 AUE_NULL UNIMPL nosys Modified: user/kmacy/HEAD_fast_multi_xmit/sys/compat/linprocfs/linprocfs.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/compat/linprocfs/linprocfs.c Thu Dec 11 07:39:06 2008 (r185918) +++ user/kmacy/HEAD_fast_multi_xmit/sys/compat/linprocfs/linprocfs.c Thu Dec 11 07:43:02 2008 (r185919) @@ -969,11 +969,11 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) ); if (freename) free(freename, M_TEMP); + vm_map_lock_read(map); if (error == -1) { error = 0; break; } - vm_map_lock_read(map); if (last_timestamp + 1 != map->timestamp) { /* * Look again for the entry because the map was Modified: user/kmacy/HEAD_fast_multi_xmit/sys/conf/files ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/conf/files Thu Dec 11 07:39:06 2008 (r185918) +++ user/kmacy/HEAD_fast_multi_xmit/sys/conf/files Thu Dec 11 07:43:02 2008 (r185919) @@ -1953,6 +1953,7 @@ kern/kern_timeout.c standard kern/kern_umtx.c standard kern/kern_uuid.c standard kern/kern_xxx.c standard +kern/kern_vimage.c standard kern/link_elf.c standard kern/linker_if.m standard kern/md4c.c optional netsmb Modified: user/kmacy/HEAD_fast_multi_xmit/sys/conf/options ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/conf/options Thu Dec 11 07:39:06 2008 (r185918) +++ user/kmacy/HEAD_fast_multi_xmit/sys/conf/options Thu Dec 11 07:43:02 2008 (r185919) @@ -415,6 +415,7 @@ TCPDEBUG TCP_OFFLOAD_DISABLE opt_inet.h #Disable code to dispatch tcp offloading TCP_SIGNATURE opt_inet.h VLAN_ARRAY opt_vlan.h +VIMAGE_GLOBALS opt_global.h XBONEHACK # Modified: user/kmacy/HEAD_fast_multi_xmit/sys/contrib/pf/net/pf_subr.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/contrib/pf/net/pf_subr.c Thu Dec 11 07:39:06 2008 (r185918) +++ user/kmacy/HEAD_fast_multi_xmit/sys/contrib/pf/net/pf_subr.c Thu Dec 11 07:43:02 2008 (r185919) @@ -124,15 +124,14 @@ static MD5_CTX isn_ctx; u_int32_t pf_new_isn(struct pf_state *s) { - INIT_VNET_INET(curvnet); u_int32_t md5_buffer[4]; u_int32_t new_isn; struct pf_state_host *src, *dst; /* Seed if this is the first use, reseed if requested. */ - if (V_isn_last_reseed == 0) { - read_random(&V_isn_secret, sizeof(V_isn_secret)); - V_isn_last_reseed = ticks; + if (isn_last_reseed == 0) { + read_random(&isn_secret, sizeof(isn_secret)); + isn_last_reseed = ticks; } if (s->direction == PF_IN) { @@ -144,28 +143,28 @@ pf_new_isn(struct pf_state *s) } /* Compute the md5 hash and return the ISN. */ - MD5Init(&V_isn_ctx); - MD5Update(&V_isn_ctx, (u_char *) &dst->port, sizeof(u_short)); - MD5Update(&V_isn_ctx, (u_char *) &src->port, sizeof(u_short)); + MD5Init(&isn_ctx); + MD5Update(&isn_ctx, (u_char *) &dst->port, sizeof(u_short)); + MD5Update(&isn_ctx, (u_char *) &src->port, sizeof(u_short)); #ifdef INET6 if (s->af == AF_INET6) { - MD5Update(&V_isn_ctx, (u_char *) &dst->addr, + MD5Update(&isn_ctx, (u_char *) &dst->addr, sizeof(struct in6_addr)); - MD5Update(&V_isn_ctx, (u_char *) &src->addr, + MD5Update(&isn_ctx, (u_char *) &src->addr, sizeof(struct in6_addr)); } else #endif { - MD5Update(&V_isn_ctx, (u_char *) &dst->addr, + MD5Update(&isn_ctx, (u_char *) &dst->addr, sizeof(struct in_addr)); - MD5Update(&V_isn_ctx, (u_char *) &src->addr, + MD5Update(&isn_ctx, (u_char *) &src->addr, sizeof(struct in_addr)); } - MD5Update(&V_isn_ctx, (u_char *) &V_isn_secret, sizeof(V_isn_secret)); - MD5Final((u_char *) &md5_buffer, &V_isn_ctx); + MD5Update(&isn_ctx, (u_char *) &isn_secret, sizeof(isn_secret)); + MD5Final((u_char *) &md5_buffer, &isn_ctx); new_isn = (tcp_seq) md5_buffer[0]; - V_isn_offset += ISN_STATIC_INCREMENT + + isn_offset += ISN_STATIC_INCREMENT + (arc4random() & ISN_RANDOM_INCREMENT); - new_isn += V_isn_offset; + new_isn += isn_offset; return (new_isn); } Modified: user/kmacy/HEAD_fast_multi_xmit/sys/dev/ath/ath_hal/ah_eeprom_v14.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/dev/ath/ath_hal/ah_eeprom_v14.c Thu Dec 11 07:39:06 2008 (r185918) +++ user/kmacy/HEAD_fast_multi_xmit/sys/dev/ath/ath_hal/ah_eeprom_v14.c Thu Dec 11 07:43:02 2008 (r185919) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ah_eeprom_v14.c,v 1.4 2008/11/10 19:04:26 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" @@ -54,6 +54,7 @@ v14EepromGet(struct ath_hal *ah, int par __func__, ath_hal_ether_sprintf(macaddr)); return HAL_EEBADMAC; } + return HAL_OK; case AR_EEP_REGDMN_0: return pBase->regDmn[0]; case AR_EEP_REGDMN_1: Modified: user/kmacy/HEAD_fast_multi_xmit/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Thu Dec 11 07:39:06 2008 (r185918) +++ user/kmacy/HEAD_fast_multi_xmit/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Thu Dec 11 07:43:02 2008 (r185919) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5212_misc.c,v 1.12 2008/11/27 22:30:00 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" @@ -803,6 +803,7 @@ ar5212GetCapability(struct ath_hal *ah, return (ahp->ah_staId1Defaults & AR_STA_ID1_CRPT_MIC_ENABLE) ? HAL_OK : HAL_ENXIO; } + return HAL_EINVAL; case HAL_CAP_TKIP_SPLIT: /* hardware TKIP uses split keys */ switch (capability) { case 0: /* hardware capability */ Modified: user/kmacy/HEAD_fast_multi_xmit/sys/dev/pccbb/pccbb_pci.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/dev/pccbb/pccbb_pci.c Thu Dec 11 07:39:06 2008 (r185918) +++ user/kmacy/HEAD_fast_multi_xmit/sys/dev/pccbb/pccbb_pci.c Thu Dec 11 07:43:02 2008 (r185919) @@ -682,40 +682,67 @@ cbb_pci_shutdown(device_t brdev) return (0); } -#define DELTA (CBB_SOCKET_MASK_CD) static int cbb_pci_filt(void *arg) { struct cbb_softc *sc = arg; uint32_t sockevent; + uint8_t csc; int retval = FILTER_STRAY; /* - * Read the socket event. Sometimes, the theory goes, the PCI - * bus is so loaded that it cannot satisfy the read request, so - * we get garbage back from the following read. We have to filter - * out the garbage so that we don't spontaneously reset the card - * under high load. PCI isn't supposed to act like this. No doubt - * this is a bug in the PCI bridge chipset (or cbb brige) that's being - * used in certain amd64 laptops today. Work around the issue by - * assuming that any bits we don't know about being set means that - * we got garbage. + * Some chips also require us to read the old ExCA registe for card + * status change when we route CSC vis PCI. This isn't supposed to be + * required, but it clears the interrupt state on some chipsets. + * Maybe there's a setting that would obviate its need. Maybe we + * should test the status bits and deal with them, but so far we've + * not found any machines that don't also give us the socket status + * indication above. + * + * This call used to be unconditional. However, further research + * suggests that we hit this condition when the card READY interrupt + * fired. So now we only read it for 16-bit cards, and we only claim + * the interrupt if READY is set. If this still causes problems, then + * the next step would be to read this if we have a 16-bit card *OR* + * we have no card. We treat the READY signal as if it were the power + * completion signal. Some bridges may double signal things here, bit + * signalling twice should be OK since we only sleep on the powerintr + * in one place and a double wakeup would be benign there. + */ + if (sc->flags & CBB_16BIT_CARD) { + csc = exca_getb(&sc->exca[0], EXCA_CSC); + if (csc & EXCA_CSC_READY) { + atomic_add_int(&sc->powerintr, 1); + wakeup((void *)&sc->powerintr); + retval = FILTER_HANDLED; + } + } + + /* + * Read the socket event. Sometimes, the theory goes, the PCI bus is + * so loaded that it cannot satisfy the read request, so we get + * garbage back from the following read. We have to filter out the + * garbage so that we don't spontaneously reset the card under high + * load. PCI isn't supposed to act like this. No doubt this is a bug + * in the PCI bridge chipset (or cbb brige) that's being used in + * certain amd64 laptops today. Work around the issue by assuming + * that any bits we don't know about being set means that we got + * garbage. */ sockevent = cbb_get(sc, CBB_SOCKET_EVENT); if (sockevent != 0 && (sockevent & ~CBB_SOCKET_EVENT_VALID_MASK) == 0) { /* - * If anything has happened to the socket, we assume that - * the card is no longer OK, and we shouldn't call its - * ISR. We set cardok as soon as we've attached the - * card. This helps in a noisy eject, which happens - * all too often when users are ejecting their PC Cards. + * If anything has happened to the socket, we assume that the + * card is no longer OK, and we shouldn't call its ISR. We + * set cardok as soon as we've attached the card. This helps + * in a noisy eject, which happens all too often when users + * are ejecting their PC Cards. * - * We use this method in preference to checking to see if - * the card is still there because the check suffers from - * a race condition in the bouncing case. Prior versions - * of the pccard software used a similar trick and achieved - * excellent results. + * We use this method in preference to checking to see if the + * card is still there because the check suffers from a race + * condition in the bouncing case. */ +#define DELTA (CBB_SOCKET_MASK_CD) if (sockevent & DELTA) { cbb_clrb(sc, CBB_SOCKET_MASK, DELTA); cbb_set(sc, CBB_SOCKET_EVENT, DELTA); @@ -723,9 +750,11 @@ cbb_pci_filt(void *arg) cbb_disable_func_intr(sc); wakeup(&sc->intrhand); } +#undef DELTA + /* - * If we get a power interrupt, wakeup anybody that might - * be waiting for one. + * Wakeup anybody waiting for a power interrupt. We have to + * use atomic_add_int for wakups on other cores. */ if (sockevent & CBB_SOCKET_EVENT_POWER) { cbb_clrb(sc, CBB_SOCKET_MASK, CBB_SOCKET_EVENT_POWER); @@ -733,21 +762,15 @@ cbb_pci_filt(void *arg) atomic_add_int(&sc->powerintr, 1); wakeup((void *)&sc->powerintr); } + + /* + * Status change interrupts aren't presently used in the + * rest of the driver. For now, just ACK them. + */ + if (sockevent & CBB_SOCKET_EVENT_CSTS) + cbb_set(sc, CBB_SOCKET_EVENT, CBB_SOCKET_EVENT_CSTS); retval = FILTER_HANDLED; } - /* - * Some chips also require us to read the old ExCA registe for - * card status change when we route CSC vis PCI. This isn't supposed - * to be required, but it clears the interrupt state on some chipsets. - * Maybe there's a setting that would obviate its need. Maybe we - * should test the status bits and deal with them, but so far we've - * not found any machines that don't also give us the socket status - * indication above. - * - * We have to call this unconditionally because some bridges deliver - * the event independent of the CBB_SOCKET_EVENT_CD above. - */ - exca_getb(&sc->exca[0], EXCA_CSC); return retval; } Modified: user/kmacy/HEAD_fast_multi_xmit/sys/dev/re/if_re.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/dev/re/if_re.c Thu Dec 11 07:39:06 2008 (r185918) +++ user/kmacy/HEAD_fast_multi_xmit/sys/dev/re/if_re.c Thu Dec 11 07:43:02 2008 (r185919) @@ -419,10 +419,10 @@ re_gmii_readreg(device_t dev, int phy, i CSR_WRITE_4(sc, RL_PHYAR, reg << 16); for (i = 0; i < RL_TIMEOUT; i++) { - DELAY(30); rval = CSR_READ_4(sc, RL_PHYAR); if (rval & RL_PHYAR_BUSY) break; + DELAY(100); } if (i == RL_TIMEOUT) { @@ -446,10 +446,10 @@ re_gmii_writereg(device_t dev, int phy, (data & RL_PHYAR_PHYDATA) | RL_PHYAR_BUSY); for (i = 0; i < RL_TIMEOUT; i++) { - DELAY(30); rval = CSR_READ_4(sc, RL_PHYAR); if (!(rval & RL_PHYAR_BUSY)) break; + DELAY(100); } if (i == RL_TIMEOUT) { @@ -700,7 +700,12 @@ re_reset(struct rl_softc *sc) if (i == RL_TIMEOUT) device_printf(sc->rl_dev, "reset never completed!\n"); - CSR_WRITE_1(sc, 0x82, 1); + if ((sc->rl_flags & RL_FLAG_PHY8169) != 0) + CSR_WRITE_1(sc, 0x82, 1); + if ((sc->rl_flags & RL_FLAG_PHY8110S) != 0) { + CSR_WRITE_1(sc, 0x82, 1); + re_gmii_writereg(sc->rl_dev, 1, 0x0B, 0); + } } #ifdef RE_DIAG @@ -756,7 +761,6 @@ re_diag(struct rl_softc *sc) ifp->if_flags |= IFF_PROMISC; sc->rl_testmode = 1; - re_reset(sc); re_init_locked(sc); sc->rl_flags |= RL_FLAG_LINK; if (sc->rl_type == RL_8169) @@ -1236,6 +1240,9 @@ re_attach(device_t dev) case RL_HWREV_8139CPLUS: sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_FASTETHER; break; + case RL_HWREV_8110S: + sc->rl_flags |= RL_FLAG_PHY8110S; + break; case RL_HWREV_8100E: case RL_HWREV_8101E: sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_INVMAR | @@ -1245,10 +1252,12 @@ re_attach(device_t dev) case RL_HWREV_8102EL: sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_INVMAR | RL_FLAG_PHYWAKE | RL_FLAG_PAR | RL_FLAG_DESCV2 | - RL_FLAG_MACSTAT | RL_FLAG_FASTETHER; + RL_FLAG_MACSTAT | RL_FLAG_FASTETHER | RL_FLAG_CMDSTOP; break; case RL_HWREV_8168_SPIN1: case RL_HWREV_8168_SPIN2: + sc->rl_flags |= RL_FLAG_WOLRXENB; + /* FALLTHROUGH */ case RL_HWREV_8168_SPIN3: sc->rl_flags |= RL_FLAG_INVMAR | RL_FLAG_PHYWAKE | RL_FLAG_MACSTAT; @@ -1258,7 +1267,8 @@ re_attach(device_t dev) case RL_HWREV_8168CP: case RL_HWREV_8168D: sc->rl_flags |= RL_FLAG_INVMAR | RL_FLAG_PHYWAKE | - RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT; + RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | + RL_FLAG_CMDSTOP; /* * These controllers support jumbo frame but it seems * that enabling it requires touching additional magic @@ -1271,10 +1281,14 @@ re_attach(device_t dev) */ sc->rl_flags |= RL_FLAG_NOJUMBO; break; + case RL_HWREV_8169: + case RL_HWREV_8169S: + sc->rl_flags |= RL_FLAG_PHY8169; + break; case RL_HWREV_8169_8110SB: case RL_HWREV_8169_8110SC: case RL_HWREV_8169_8110SBL: - sc->rl_flags |= RL_FLAG_PHYWAKE; + sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PHY8169; break; default: break; @@ -2091,10 +2105,8 @@ re_poll_locked(struct ifnet *ifp, enum p * XXX check behaviour on receiver stalls. */ - if (status & RL_ISR_SYSTEM_ERR) { - re_reset(sc); + if (status & RL_ISR_SYSTEM_ERR) re_init_locked(sc); - } } } #endif /* DEVICE_POLLING */ @@ -2158,10 +2170,8 @@ re_int_task(void *arg, int npending) RL_ISR_TX_ERR|RL_ISR_TX_DESC_UNAVAIL)) re_txeof(sc); - if (status & RL_ISR_SYSTEM_ERR) { - re_reset(sc); + if (status & RL_ISR_SYSTEM_ERR) re_init_locked(sc); - } if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) taskqueue_enqueue_fast(taskqueue_fast, &sc->rl_txtask); @@ -2482,6 +2492,9 @@ re_init_locked(struct rl_softc *sc) */ re_stop(sc); + /* Put controller into known state. */ + re_reset(sc); + /* * Enable C+ RX and TX mode, as well as VLAN stripping and * RX checksum offload. We must configure the C+ register @@ -2870,7 +2883,12 @@ re_stop(struct rl_softc *sc) callout_stop(&sc->rl_stat_callout); ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); - CSR_WRITE_1(sc, RL_COMMAND, 0x00); + if ((sc->rl_flags & RL_FLAG_CMDSTOP) != 0) + CSR_WRITE_1(sc, RL_COMMAND, RL_CMD_STOPREQ | RL_CMD_TX_ENB | + RL_CMD_RX_ENB); + else + CSR_WRITE_1(sc, RL_COMMAND, 0x00); + DELAY(1000); CSR_WRITE_2(sc, RL_IMR, 0x0000); CSR_WRITE_2(sc, RL_ISR, 0xFFFF); @@ -3000,6 +3018,9 @@ re_setwol(struct rl_softc *sc) return; ifp = sc->rl_ifp; + if ((ifp->if_capenable & IFCAP_WOL) != 0 && + (sc->rl_flags & RL_FLAG_WOLRXENB) != 0) + CSR_WRITE_1(sc, RL_COMMAND, RL_CMD_RX_ENB); /* Enable config register write. */ CSR_WRITE_1(sc, RL_EECMD, RL_EE_MODE); Modified: user/kmacy/HEAD_fast_multi_xmit/sys/fs/procfs/procfs_map.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/fs/procfs/procfs_map.c Thu Dec 11 07:39:06 2008 (r185918) +++ user/kmacy/HEAD_fast_multi_xmit/sys/fs/procfs/procfs_map.c Thu Dec 11 07:43:02 2008 (r185919) @@ -219,12 +219,11 @@ procfs_doprocmap(PFS_FILL_ARGS) if (freepath != NULL) free(freepath, M_TEMP); - + vm_map_lock_read(map); if (error == -1) { error = 0; break; } - vm_map_lock_read(map); if (last_timestamp + 1 != map->timestamp) { /* * Look again for the entry because the map was Modified: user/kmacy/HEAD_fast_multi_xmit/sys/kern/kern_jail.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/kern/kern_jail.c Thu Dec 11 07:39:06 2008 (r185918) +++ user/kmacy/HEAD_fast_multi_xmit/sys/kern/kern_jail.c Thu Dec 11 07:43:02 2008 (r185919) @@ -1574,13 +1574,13 @@ DB_SHOW_COMMAND(jails, db_show_jails) pr->pr_ip4s, pr->pr_ip6s); db_printf("%6s %-29.29s %.74s\n", "", pr->pr_host, pr->pr_path); - if (pr->pr_state < 0 || pr->pr_state > (int)((sizeof( + if (pr->pr_state < 0 || pr->pr_state >= (int)((sizeof( prison_states) / sizeof(struct prison_state)))) state = "(bogus)"; else state = prison_states[pr->pr_state].state_name; db_printf("%6s %-29.29s %.74s\n", - "", (pr->pr_name != NULL) ? pr->pr_name : "", state); + "", (pr->pr_name[0] != '\0') ? pr->pr_name : "", state); db_printf("%6s %-6d\n", "", pr->pr_cpuset->cs_id); #ifdef INET *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Thu Dec 11 09:13:31 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A19BC1065672; Thu, 11 Dec 2008 09:13:31 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A7D88FC1F; Thu, 11 Dec 2008 09:13:31 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBB9DVeS060358; Thu, 11 Dec 2008 09:13:31 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBB9DVAZ060357; Thu, 11 Dec 2008 09:13:31 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <200812110913.mBB9DVAZ060357@svn.freebsd.org> From: Qing Li Date: Thu, 11 Dec 2008 09:13:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185926 - user/qingli/l2l3-rewrite X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Dec 2008 09:13:31 -0000 Author: qingli Date: Thu Dec 11 09:13:30 2008 New Revision: 185926 URL: http://svn.freebsd.org/changeset/base/185926 Log: use the /base/projects/arpv2_merge_1 tree instead Deleted: user/qingli/l2l3-rewrite/ From owner-svn-src-user@FreeBSD.ORG Fri Dec 12 03:23:52 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40C461065670; Fri, 12 Dec 2008 03:23:52 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2CCC28FC08; Fri, 12 Dec 2008 03:23:52 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBC3NqNh085180; Fri, 12 Dec 2008 03:23:52 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBC3Nobr085151; Fri, 12 Dec 2008 03:23:50 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812120323.mBC3Nobr085151@svn.freebsd.org> From: Kip Macy Date: Fri, 12 Dec 2008 03:23:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185967 - in user/kmacy/HEAD_fast_multi_xmit: contrib/binutils/bfd contrib/binutils/gas/config contrib/binutils/ld/emulparams gnu/usr.bin/binutils/as gnu/usr.bin/binutils/as/mips-freebs... X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Dec 2008 03:23:52 -0000 Author: kmacy Date: Fri Dec 12 03:23:50 2008 New Revision: 185967 URL: http://svn.freebsd.org/changeset/base/185967 Log: IFC 185919:185966 daily merge from -CURRENT Added: user/kmacy/HEAD_fast_multi_xmit/contrib/binutils/ld/emulparams/elf32bmip_fbsd.sh user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/binutils/as/mips-freebsd/ user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/binutils/as/mips-freebsd/itbl-cpu.h user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/binutils/as/mips-freebsd/targ-cpu.h user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/binutils/ld/Makefile.mips user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/binutils/ld/elf32btsmip_fbsd.sh user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/binutils/ld/elf32ltsmip_fbsd.sh user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/binutils/ld/elf64btsmip_fbsd.sh user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/binutils/ld/elf64ltsmip_fbsd.sh user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/binutils/libbfd/Makefile.mips user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/binutils/libopcodes/Makefile.mips user/kmacy/HEAD_fast_multi_xmit/share/man/man9/VOP_VPTOCNP.9 Modified: user/kmacy/HEAD_fast_multi_xmit/contrib/binutils/bfd/config.bfd user/kmacy/HEAD_fast_multi_xmit/contrib/binutils/gas/config/tc-mips.c user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/binutils/as/Makefile user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/binutils/libbfd/bfd.h user/kmacy/HEAD_fast_multi_xmit/share/man/man9/Makefile user/kmacy/HEAD_fast_multi_xmit/share/man/man9/ifnet.9 user/kmacy/HEAD_fast_multi_xmit/sys/amd64/amd64/local_apic.c user/kmacy/HEAD_fast_multi_xmit/sys/amd64/include/apicreg.h user/kmacy/HEAD_fast_multi_xmit/sys/amd64/include/apicvar.h user/kmacy/HEAD_fast_multi_xmit/sys/boot/zfs/zfs.c user/kmacy/HEAD_fast_multi_xmit/sys/conf/options user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb/usbdevs user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/bluetooth/ng_ubt2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/bluetooth/ubtbcmfw2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/controller/at91dci.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/controller/at91dci_atmelarm.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/controller/ehci2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/controller/ehci2_pci.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/controller/musb2_otg.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/controller/musb2_otg_atmelarm.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/controller/ohci2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/controller/uhci2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/controller/usb2_controller.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/controller/uss820dci.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/core/usb2_busdma.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/core/usb2_busdma.h user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/core/usb2_compat_linux.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/core/usb2_compat_linux.h user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/core/usb2_config_td.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/core/usb2_config_td.h user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/core/usb2_core.h user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/core/usb2_debug.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/core/usb2_dev.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/core/usb2_dev.h user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/core/usb2_device.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/core/usb2_device.h user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/core/usb2_dynamic.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/core/usb2_dynamic.h user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/core/usb2_error.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/core/usb2_generic.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/core/usb2_handle_request.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/core/usb2_hid.h user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/core/usb2_hub.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/core/usb2_hub.h user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/core/usb2_lookup.h user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/core/usb2_mbuf.h user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/core/usb2_msctest.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/core/usb2_msctest.h user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/core/usb2_parse.h user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/core/usb2_process.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/core/usb2_process.h user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/core/usb2_request.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/core/usb2_request.h user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/core/usb2_sw_transfer.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/core/usb2_sw_transfer.h user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/core/usb2_transfer.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/core/usb2_transfer.h user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/core/usb2_util.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/ethernet/if_aue2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/ethernet/if_axe2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/ethernet/if_cdce2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/ethernet/if_cue2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/ethernet/if_kue2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/ethernet/if_rue2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/ethernet/if_udav2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/ethernet/usb2_ethernet.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/ethernet/usb2_ethernet.h user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/image/uscanner2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/input/uhid2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/input/ukbd2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/input/ums2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/misc/udbp2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/misc/ufm2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/quirk/usb2_quirk.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/serial/uark2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/serial/ubsa2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/serial/ubser2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/serial/uchcom2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/serial/ucycom2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/serial/ufoma2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/serial/uftdi2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/serial/ugensa2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/serial/uipaq2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/serial/ulpt2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/serial/umct2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/serial/umodem2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/serial/umoscom2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/serial/uplcom2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/serial/usb2_serial.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/serial/usb2_serial.h user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/serial/uvisor2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/serial/uvscom2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/sound/uaudio2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/sound/uaudio2.h user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/storage/ata-usb2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/storage/umass2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/storage/urio2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/storage/ustorage2_fs.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/template/usb2_template.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/wlan/if_rum2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/wlan/if_ural2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/wlan/if_zyd2.c user/kmacy/HEAD_fast_multi_xmit/sys/dev/vr/if_vr.c user/kmacy/HEAD_fast_multi_xmit/sys/fs/deadfs/dead_vnops.c user/kmacy/HEAD_fast_multi_xmit/sys/fs/devfs/devfs_vnops.c user/kmacy/HEAD_fast_multi_xmit/sys/i386/i386/local_apic.c user/kmacy/HEAD_fast_multi_xmit/sys/i386/include/apicreg.h user/kmacy/HEAD_fast_multi_xmit/sys/i386/include/apicvar.h user/kmacy/HEAD_fast_multi_xmit/sys/kern/kern_poll.c user/kmacy/HEAD_fast_multi_xmit/sys/kern/tty_pts.c user/kmacy/HEAD_fast_multi_xmit/sys/kern/vfs_cache.c user/kmacy/HEAD_fast_multi_xmit/sys/kern/vfs_default.c user/kmacy/HEAD_fast_multi_xmit/sys/kern/vnode_if.src user/kmacy/HEAD_fast_multi_xmit/sys/net/if.c user/kmacy/HEAD_fast_multi_xmit/sys/net/if_tun.c user/kmacy/HEAD_fast_multi_xmit/sys/net/raw_cb.h user/kmacy/HEAD_fast_multi_xmit/sys/netinet/in_pcb.h user/kmacy/HEAD_fast_multi_xmit/sys/netinet/ip_fw2.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/ip_fw_nat.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/ip_fw_pfil.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/ip_var.h user/kmacy/HEAD_fast_multi_xmit/sys/netinet/tcp_subr.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet/tcp_var.h user/kmacy/HEAD_fast_multi_xmit/sys/netinet/udp_var.h user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/in6_ifattach.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/in6_proto.c user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/in6_var.h user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/ip6_var.h user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/nd6.h user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/tcp6_var.h user/kmacy/HEAD_fast_multi_xmit/sys/netinet6/vinet6.h user/kmacy/HEAD_fast_multi_xmit/sys/netipx/ipx_usrreq.c user/kmacy/HEAD_fast_multi_xmit/sys/sys/resource.h user/kmacy/HEAD_fast_multi_xmit/sys/sys/vimage.h user/kmacy/HEAD_fast_multi_xmit/sys/sys/vnode.h Modified: user/kmacy/HEAD_fast_multi_xmit/contrib/binutils/bfd/config.bfd ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/contrib/binutils/bfd/config.bfd Fri Dec 12 02:11:49 2008 (r185966) +++ user/kmacy/HEAD_fast_multi_xmit/contrib/binutils/bfd/config.bfd Fri Dec 12 03:23:50 2008 (r185967) @@ -768,6 +768,10 @@ case "${targ}" in targ_defvec=bfd_elf32_littlemips_vec targ_selvecs="bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_little_vec ecoff_big_vec" ;; + mips*-*-freebsd*) + targ_defvec=bfd_elf32_tradbigmips_vec + targ_selvecs="bfd_elf32_tradlittlemips_vec bfd_elf32_ntradbigmisp_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec ecoff_big_vec ecoff_little_vec" + ;; mips*-*-netbsd*) targ_defvec=bfd_elf32_bigmips_vec targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_big_vec ecoff_little_vec" Modified: user/kmacy/HEAD_fast_multi_xmit/contrib/binutils/gas/config/tc-mips.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/contrib/binutils/gas/config/tc-mips.c Fri Dec 12 02:11:49 2008 (r185966) +++ user/kmacy/HEAD_fast_multi_xmit/contrib/binutils/gas/config/tc-mips.c Fri Dec 12 03:23:50 2008 (r185967) @@ -281,6 +281,9 @@ static int mips_32bitmode = 0; #define HAVE_64BIT_OBJECTS (mips_abi == N64_ABI) +/* True if relocations are stored in-place. */ +#define HAVE_IN_PLACE_ADDENDS (!HAVE_NEWABI) + /* We can only have 64bit addresses if the object file format supports it. */ #define HAVE_32BIT_ADDRESSES \ @@ -13020,6 +13023,26 @@ mips_fix_adjustable (fixS *fixp) if (fixp->fx_addsy == NULL) return 1; + /* If symbol SYM is in a mergeable section, relocations of the form + SYM + 0 can usually be made section-relative. The mergeable data + is then identified by the section offset rather than by the symbol. + + However, if we're generating REL LO16 relocations, the offset is split + between the LO16 and parterning high part relocation. The linker will + need to recalculate the complete offset in order to correctly identify + the merge data. + + The linker has traditionally not looked for the parterning high part + relocation, and has thus allowed orphaned R_MIPS_LO16 relocations to be + placed anywhere. Rather than break backwards compatibility by changing + this, it seems better not to force the issue, and instead keep the + original symbol. This will work with either linker behavior. */ + if ((fixp->fx_r_type == BFD_RELOC_LO16 + || reloc_needs_lo_p (fixp->fx_r_type)) + && HAVE_IN_PLACE_ADDENDS + && (S_GET_SEGMENT (fixp->fx_addsy)->flags & SEC_MERGE) != 0) + return 0; + #ifdef OBJ_ELF if (OUTPUT_FLAVOR == bfd_target_elf_flavour && S_GET_OTHER (fixp->fx_addsy) == STO_MIPS16 Added: user/kmacy/HEAD_fast_multi_xmit/contrib/binutils/ld/emulparams/elf32bmip_fbsd.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/kmacy/HEAD_fast_multi_xmit/contrib/binutils/ld/emulparams/elf32bmip_fbsd.sh Fri Dec 12 03:23:50 2008 (r185967) @@ -0,0 +1,3 @@ +. ${srcdir}/emulparams/elf32bmip.sh +. ${srcdir}/emulparams/elf_fbsd.sh +GENERATE_PIE_SCRIPT=yes Modified: user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/binutils/as/Makefile ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/binutils/as/Makefile Fri Dec 12 02:11:49 2008 (r185966) +++ user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/binutils/as/Makefile Fri Dec 12 03:23:50 2008 (r185967) @@ -20,6 +20,10 @@ SRCS+= app.c as.c atof-generic.c atof-ie # DEO: why not used? #SRCS+= itbl-ops.c +.if ${TARGET_ARCH} == "mips" +SRCS+= itbl-ops.c itbl-parse.y itbl-lex.l +.endif + .if ${TARGET_ARCH} == "amd64" SRCS+= tc-i386.c .elif ${TARGET_ARCH} == "powerpc" Added: user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/binutils/as/mips-freebsd/itbl-cpu.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/binutils/as/mips-freebsd/itbl-cpu.h Fri Dec 12 03:23:50 2008 (r185967) @@ -0,0 +1,19 @@ +/* $FreeBSD$ */ + +#include "itbl-mips.h" + +/* Choose a default ABI for MIPS targets. */ +/* XXX: Where should this be ? */ +#define MIPS_DEFAULT_ABI NO_ABI + +/* Default CPU for MIPS targets. */ +#define MIPS_CPU_STRING_DEFAULT "from-abi" + +/* Generate 64-bit code by default on MIPS targets. */ +#define MIPS_DEFAULT_64BIT 0 + +/* Allow use of E_MIPS_ABI_O32 on MIPS targets. */ +#define USE_E_MIPS_ABI_O32 1 + +/* Use traditional mips */ +#define TE_TMIPS 1 Added: user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/binutils/as/mips-freebsd/targ-cpu.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/binutils/as/mips-freebsd/targ-cpu.h Fri Dec 12 03:23:50 2008 (r185967) @@ -0,0 +1,4 @@ +/* $FreeBSD$ */ +#define TE_TMIPS 1 + +#include "tc-mips.h" Added: user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/binutils/ld/Makefile.mips ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/binutils/ld/Makefile.mips Fri Dec 12 03:23:50 2008 (r185967) @@ -0,0 +1,24 @@ +# $FreeBSD$ + +#xxxIMPxxx: size? +#xxxIMPxxx: TARGET_BIG_ENDIAN is lame. We should use the netbsd convention +# of mipsel and mips. +_sz?=32 +.if defined(TARGET_BIG_ENDIAN) +NATIVE_EMULATION=elf${_sz}btsmip_fbsd +.else +NATIVE_EMULATION=elf${_sz}ltsmip_fbsd +.endif + +SRCS+= e${NATIVE_EMULATION}.c +CLEANFILES+= e${NATIVE_EMULATION}.c + +# nb: elf32 handles both elf32 and elf64 targets +e${NATIVE_EMULATION}.c: ${.CURDIR}/${NATIVE_EMULATION}.sh emultempl/elf32.em \ + scripttempl/elf.sc genscripts.sh stringify.sed + sh ${.CURDIR}/genscripts.sh ${SRCDIR}/ld ${LIBSERACHPATH} \ + ${TOOLS_PREFIX}/usr \ + ${HOST} ${TARGET_TUPLE} ${TARGET_TUPLE} \ + ${NATIVE_EMULATION} "" no ${NATIVE_EMULATION} ${TARGET_TUPLE} \ + ${.CURDIR}/${NATIVE_EMULATION}.sh + Added: user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/binutils/ld/elf32btsmip_fbsd.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/binutils/ld/elf32btsmip_fbsd.sh Fri Dec 12 03:23:50 2008 (r185967) @@ -0,0 +1,4 @@ +# $FreeBSD$ +. ${srcdir}/emulparams/elf32btsmip.sh +. ${srcdir}/emulparams/elf_fbsd.sh +GENERATE_PIE_SCRIPT=yes Added: user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/binutils/ld/elf32ltsmip_fbsd.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/binutils/ld/elf32ltsmip_fbsd.sh Fri Dec 12 03:23:50 2008 (r185967) @@ -0,0 +1,4 @@ +# $FreeBSD$ +. ${srcdir}/emulparams/elf32ltsmip.sh +. ${srcdir}/emulparams/elf_fbsd.sh +GENERATE_PIE_SCRIPT=yes Added: user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/binutils/ld/elf64btsmip_fbsd.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/binutils/ld/elf64btsmip_fbsd.sh Fri Dec 12 03:23:50 2008 (r185967) @@ -0,0 +1,4 @@ +# $FreeBSD$ +. ${srcdir}/emulparams/elf64btsmip.sh +. ${srcdir}/emulparams/elf_fbsd.sh +GENERATE_PIE_SCRIPT=yes Added: user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/binutils/ld/elf64ltsmip_fbsd.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/binutils/ld/elf64ltsmip_fbsd.sh Fri Dec 12 03:23:50 2008 (r185967) @@ -0,0 +1,4 @@ +# $FreeBSD$ +. ${srcdir}/emulparams/elf64ltsmip.sh +. ${srcdir}/emulparams/elf_fbsd.sh +GENERATE_PIE_SCRIPT=yes Added: user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/binutils/libbfd/Makefile.mips ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/binutils/libbfd/Makefile.mips Fri Dec 12 03:23:50 2008 (r185967) @@ -0,0 +1,27 @@ +# $FreeBSD$ + +#xxxIMPxxx: endian and size +DEFAULT_VECTOR= bfd_elf32_tradbigmips_vec + +SRCS+= coff-mips.c \ + cpu-mips.c \ + ecoff.c \ + ecofflink.c \ + elf32.c \ + elf64.c \ + elfn32-mips.c \ + elf32-mips.c \ + elf64-mips.c \ + elfxx-mips.c \ + elf32-target.h \ + elf64-target.h \ + elflink.c + +VECS= bfd_elf32_tradbigmips_vec \ + bfd_elf32_tradlittlemips_vec \ + bfd_elf32_ntradbigmips_vec \ + bfd_elf32_ntradlittlemips_vec \ + bfd_elf64_tradbigmips_vec \ + bfd_elf64_tradlittlemips_vec \ + ecoff_little_vec \ + ecoff_big_vec Modified: user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/binutils/libbfd/bfd.h ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/binutils/libbfd/bfd.h Fri Dec 12 02:11:49 2008 (r185966) +++ user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/binutils/libbfd/bfd.h Fri Dec 12 03:23:50 2008 (r185967) @@ -57,7 +57,7 @@ extern "C" { #define BFD_ARCH_SIZE 64 -#if defined(__i386__) || defined(__powerpc__) || defined(__arm__) +#if defined(__i386__) || defined(__powerpc__) || defined(__arm__) || defined(__mips__) #define BFD_HOST_64BIT_LONG 0 #define BFD_HOST_64_BIT long long #define BFD_HOST_U_64_BIT unsigned long long Added: user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/binutils/libopcodes/Makefile.mips ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/kmacy/HEAD_fast_multi_xmit/gnu/usr.bin/binutils/libopcodes/Makefile.mips Fri Dec 12 03:23:50 2008 (r185967) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +SRCS+= mips-dis.c mips-opc.c mips16-opc.c +CFLAGS+= -DARCH_mips Modified: user/kmacy/HEAD_fast_multi_xmit/share/man/man9/Makefile ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/share/man/man9/Makefile Fri Dec 12 02:11:49 2008 (r185966) +++ user/kmacy/HEAD_fast_multi_xmit/share/man/man9/Makefile Fri Dec 12 03:23:50 2008 (r185967) @@ -348,6 +348,7 @@ MAN= accept_filter.9 \ VOP_SETACL.9 \ VOP_SETEXTATTR.9 \ VOP_STRATEGY.9 \ + VOP_VPTOCNP.9 \ VOP_VPTOFH.9 \ vput.9 \ vref.9 \ Added: user/kmacy/HEAD_fast_multi_xmit/share/man/man9/VOP_VPTOCNP.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/kmacy/HEAD_fast_multi_xmit/share/man/man9/VOP_VPTOCNP.9 Fri Dec 12 03:23:50 2008 (r185967) @@ -0,0 +1,110 @@ +.\" -*- nroff -*- +.\" +.\" Copyright (c) 2008 Joe Marcus Clarke +.\" +.\" All rights reserved. +.\" +.\" This program is free software. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``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 DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd December 7, 2008 +.Os +.Dt VOP_VPTOCNP 9 +.Sh NAME +.Nm VOP_VPTOCNP +.Nd translate a vnode to its component name +.Sh SYNOPSIS +.In sys/param.h +.In sys/vnode.h +.Ft int +.Fn VOP_VPTOCNP "struct vnode *vp" "struct vnode **dvp" "char *buf" "int *buflen" +.Sh DESCRIPTION +This translates a vnode into its component name, and writes that name to +the head of the buffer specified by +.Fa buf +.Bl -tag -width buflen +.It Fa vp +The vnode to translate. +.It Fa dvp +The vnode of the parent directory of +.Fa vp . +.It Fa buf +The buffer into which to preprend the component name. +.It Fa buflen +The remaining size of the buffer. +.El +.Pp +The default implementation of +.Nm +simply returns ENOENT. +.Sh LOCKS +The vnode should be locked on entry and will still be locked on exit. The +parent directory vnode will be unlocked on a successful exit. However, it +will have its hold count incremented. +.Sh RETURN VALUES +Zero is returned on success, otherwise an error code is returned. +.Sh PSEUDOCODE +.Bd -literal +int +vop_vptocnp(struct vnode *vp, struct vnode **dvp, char *buf, int *buflen) +{ + int error = 0; + + /* + * Translate the vnode to its component name. + * + * Decrement the component name's length from buflen. + * + * Obtain the vnode's parent directory vnode. + */ + ...; + + /* + * Increment the parent directory's hold count. + */ + vhold(*dvp); + + return error; +} +.Ed +.Sh ERRORS +.Bl -tag -width Er +.It Bq Er ENOMEM +The buffer was not large enough to hold the vnode's component name. +.It Bq Er ENOENT +The vnode was not found on the file system. +.El +.Sh SEE ALSO +.Xr VOP_LOOKUP 9 , +.Xr vnode 9 +.Sh NOTES +This interface is a work in progress. +.Sh HISTORY +The function +.Nm +appeared in +.Fx 8.0 . +.Sh AUTHORS +This manual page was written by +.An Joe Marcus Clarke . Modified: user/kmacy/HEAD_fast_multi_xmit/share/man/man9/ifnet.9 ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/share/man/man9/ifnet.9 Fri Dec 12 02:11:49 2008 (r185966) +++ user/kmacy/HEAD_fast_multi_xmit/share/man/man9/ifnet.9 Fri Dec 12 03:23:50 2008 (r185967) @@ -103,6 +103,10 @@ .Ft void .Fn \*(lp*if_start\*(rp "struct ifnet *ifp" .Ft int +.Fn \*(lp*if_transmit\*(rp "struct ifnet *ifp" "struct mbuf *m" +.Ft void +.Fn \*(lp*if_qflush\*(rp "struct ifnet *ifp" +.Ft int .Fn \*(lp*if_ioctl\*(rp "struct ifnet *ifp" "int cmd" "caddr_t data" .Ft void .Fn \*(lp*if_watchdog\*(rp "struct ifnet *ifp" @@ -350,6 +354,20 @@ framing, e.g., Ethernet. Output a packet on interface .Fa ifp , or queue it on the output queue if the interface is already active. +.It Fn if_transmit +Transmit a packet on an interface or queue it if the interface is +in use. This function will return +.Dv ENOBUFS +if the devices software and hardware queues are both full. This +function must be installed after +.It Fn if_qflush +Free mbufs in internally managed queues when the interface is marked down. +This function must be installed after +.Fn if_attach +to override the default implementation. This function is exposed in order +to allow drivers to manage their own queues and to reduce the latency +caused by a frequently gratuitous enqueue / dequeue pair to ifq. The +suggested internal software queueing mechanism is buf_ring. .It Fn if_start Start queued output on an interface. This function is exposed in @@ -363,7 +381,8 @@ flag is not set. (Thus, .Dv IFF_OACTIVE does not literally mean that output is active, but rather that the -device's internal output queue is full.) +device's internal output queue is full.) Please note that this function +will soon be deprecated. .It Fn if_done Not used. We are not even sure what it was ever for. Modified: user/kmacy/HEAD_fast_multi_xmit/sys/amd64/amd64/local_apic.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/amd64/amd64/local_apic.c Fri Dec 12 02:11:49 2008 (r185966) +++ user/kmacy/HEAD_fast_multi_xmit/sys/amd64/amd64/local_apic.c Fri Dec 12 03:23:50 2008 (r185967) @@ -299,6 +299,7 @@ lapic_setup(int boot) /* Program LINT[01] LVT entries. */ lapic->lvt_lint0 = lvt_mode(la, LVT_LINT0, lapic->lvt_lint0); lapic->lvt_lint1 = lvt_mode(la, LVT_LINT1, lapic->lvt_lint1); + #ifdef HWPMC_HOOKS /* Program the PMC LVT entry if present. */ if (maxlvt >= LVT_PMC) @@ -644,6 +645,18 @@ lapic_eoi(void) lapic->eoi = 0; } +/* + * Read the contents of the error status register. We have to write + * to the register first before reading from it. + */ +u_int +lapic_error(void) +{ + + lapic->esr = 0; + return (lapic->esr); +} + void lapic_handle_intr(int vector, struct trapframe *frame) { Modified: user/kmacy/HEAD_fast_multi_xmit/sys/amd64/include/apicreg.h ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/amd64/include/apicreg.h Fri Dec 12 02:11:49 2008 (r185966) +++ user/kmacy/HEAD_fast_multi_xmit/sys/amd64/include/apicreg.h Fri Dec 12 03:23:50 2008 (r185967) @@ -260,6 +260,14 @@ typedef struct IOAPIC ioapic_t; # define APIC_TPR_INT 0x000000f0 # define APIC_TPR_SUB 0x0000000f +/* fields in ESR */ +#define APIC_ESR_SEND_CS_ERROR 0x00000001 +#define APIC_ESR_RECEIVE_CS_ERROR 0x00000002 +#define APIC_ESR_SEND_ACCEPT 0x00000004 +#define APIC_ESR_RECEIVE_ACCEPT 0x00000008 +#define APIC_ESR_SEND_ILLEGAL_VECTOR 0x00000020 +#define APIC_ESR_RECEIVE_ILLEGAL_VECTOR 0x00000040 +#define APIC_ESR_ILLEGAL_REGISTER 0x00000080 /* fields in ICR_LOW */ #define APIC_VECTOR_MASK 0x000000ff Modified: user/kmacy/HEAD_fast_multi_xmit/sys/amd64/include/apicvar.h ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/amd64/include/apicvar.h Fri Dec 12 02:11:49 2008 (r185966) +++ user/kmacy/HEAD_fast_multi_xmit/sys/amd64/include/apicvar.h Fri Dec 12 03:23:50 2008 (r185967) @@ -200,6 +200,7 @@ void lapic_create(u_int apic_id, int boo void lapic_disable(void); void lapic_dump(const char *str); void lapic_eoi(void); +u_int lapic_error(void); int lapic_id(void); void lapic_init(vm_paddr_t addr); int lapic_intr_pending(u_int vector); Modified: user/kmacy/HEAD_fast_multi_xmit/sys/boot/zfs/zfs.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/boot/zfs/zfs.c Fri Dec 12 02:11:49 2008 (r185966) +++ user/kmacy/HEAD_fast_multi_xmit/sys/boot/zfs/zfs.c Fri Dec 12 03:23:50 2008 (r185967) @@ -486,6 +486,7 @@ zfs_dev_open(struct open_file *f, ...) } f->f_devdata = spa; + free(dev); return (0); } Modified: user/kmacy/HEAD_fast_multi_xmit/sys/conf/options ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/conf/options Fri Dec 12 02:11:49 2008 (r185966) +++ user/kmacy/HEAD_fast_multi_xmit/sys/conf/options Fri Dec 12 03:23:50 2008 (r185967) @@ -415,7 +415,6 @@ TCPDEBUG TCP_OFFLOAD_DISABLE opt_inet.h #Disable code to dispatch tcp offloading TCP_SIGNATURE opt_inet.h VLAN_ARRAY opt_vlan.h -VIMAGE_GLOBALS opt_global.h XBONEHACK # @@ -786,3 +785,4 @@ IEEE80211_AMPDU_AGE opt_wlan.h # Virtualize the network stack VIMAGE opt_global.h +VIMAGE_GLOBALS opt_global.h Modified: user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb/usbdevs ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb/usbdevs Fri Dec 12 02:11:49 2008 (r185966) +++ user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb/usbdevs Fri Dec 12 03:23:50 2008 (r185967) @@ -620,6 +620,7 @@ vendor AMIT 0x18c5 AMIT vendor QCOM 0x18e8 Qcom vendor LINKSYS3 0x1915 Linksys vendor QUALCOMMINC 0x19d2 Qualcomm, Incorporated +vendor STELERA 0x1a8d Stelera Wireless vendor DLINK 0x2001 D-Link vendor PLANEX2 0x2019 Planex Communications vendor ERICSSON 0x2282 Ericsson @@ -1876,6 +1877,7 @@ product OPTION VODAFONEMC3G 0x5000 Vodaf product OPTION GT3G 0x6000 GlobeTrotter 3G datacard product OPTION GT3GQUAD 0x6300 GlobeTrotter 3G QUAD datacard product OPTION GT3GPLUS 0x6600 GlobeTrotter 3G+ datacard +product OPTION GTICON322 0xd033 GlobeTrotter Icon322 storage product OPTION GTMAX36 0x6701 GlobeTrotter Max 3.6 Modem product OPTION GTMAXHSUPA 0x7001 GlobeTrotter HSUPA @@ -2125,12 +2127,14 @@ product SIERRA AIRCARD595 0x0019 Sierra product SIERRA AC595U 0x0120 Sierra Wireless AirCard 595U product SIERRA AC597E 0x0021 Sierra Wireless AirCard 597E product SIERRA C597 0x0023 Sierra Wireless Compass 597 +product SIERRA AC875 0x6820 Sierra Wireless AirCard 875 product SIERRA AC880 0x6850 Sierra Wireless AirCard 880 product SIERRA AC881 0x6851 Sierra Wireless AirCard 881 product SIERRA AC880E 0x6852 Sierra Wireless AirCard 880E product SIERRA AC881E 0x6853 Sierra Wireless AirCard 881E product SIERRA AC880U 0x6855 Sierra Wireless AirCard 880U product SIERRA AC881U 0x6856 Sierra Wireless AirCard 881U +product SIERRA AC885U 0x6880 Sierra Wireless AirCard 885U product SIERRA EM5625 0x0017 EM5625 product SIERRA MC5720 0x0218 MC5720 Wireless Modem product SIERRA MC5720_2 0x0018 MC5720 @@ -2253,6 +2257,10 @@ product SPARKLAN RT2573 0x0004 RT2573 /* Sphairon Access Systems GmbH products */ product SPHAIRON UB801R 0x0110 UB801R +/* Stelera Wireless products */ +product STELERA ZEROCD 0x1000 Zerocd Installer +product STELERA C105 0x1002 Stelera/Bandrish C105 USB + /* STMicroelectronics products */ product STMICRO BIOCPU 0x2016 Biometric Coprocessor product STMICRO COMMUNICATOR 0x7554 USB Communicator Modified: user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/bluetooth/ng_ubt2.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/bluetooth/ng_ubt2.c Fri Dec 12 02:11:49 2008 (r185966) +++ user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/bluetooth/ng_ubt2.c Fri Dec 12 03:23:50 2008 (r185967) @@ -193,10 +193,10 @@ static usb2_callback_t ubt_bulk_write_cl static usb2_callback_t ubt_isoc_read_callback; static usb2_callback_t ubt_isoc_write_callback; -static int ubt_modevent(module_t mod, int event, void *data); -static void ubt_intr_read_complete(node_p node, hook_p hook, void *arg1, int arg2); -static void ubt_bulk_read_complete(node_p node, hook_p hook, void *arg1, int arg2); -static void ubt_isoc_read_complete(node_p node, hook_p hook, void *arg1, int arg2); +static int ubt_modevent(module_t, int, void *); +static void ubt_intr_read_complete(node_p, hook_p, void *, int); +static void ubt_bulk_read_complete(node_p, hook_p, void *, int); +static void ubt_isoc_read_complete(node_p, hook_p, void *, int); /* USB config */ static const struct usb2_config ubt_config_if_0[UBT_IF_0_N_TRANSFER] = { @@ -818,7 +818,6 @@ ubt_intr_read_clear_stall_callback(struc sc->sc_flags &= ~UBT_FLAG_INTR_STALL; usb2_transfer_start(xfer_other); } - return; } static void @@ -883,8 +882,6 @@ done: usb2_transfer_start(sc->sc_xfer_if_0[2]); mtx_unlock(&sc->sc_mtx); - - return; } static void @@ -972,7 +969,6 @@ ubt_bulk_read_clear_stall_callback(struc sc->sc_flags &= ~UBT_FLAG_READ_STALL; usb2_transfer_start(xfer_other); } - return; } static void @@ -1040,8 +1036,6 @@ done: usb2_transfer_start(sc->sc_xfer_if_0[1]); mtx_unlock(&sc->sc_mtx); - - return; } static void @@ -1121,7 +1115,6 @@ ubt_bulk_write_clear_stall_callback(stru sc->sc_flags &= ~UBT_FLAG_WRITE_STALL; usb2_transfer_start(xfer_other); } - return; } static void @@ -1265,8 +1258,6 @@ done: } mtx_unlock(&sc->sc_mtx); - - return; } static void Modified: user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/bluetooth/ubtbcmfw2.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/bluetooth/ubtbcmfw2.c Fri Dec 12 02:11:49 2008 (r185966) +++ user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/bluetooth/ubtbcmfw2.c Fri Dec 12 03:23:50 2008 (r185967) @@ -305,7 +305,6 @@ ubtbcmfw_write_clear_stall_callback(stru sc->sc_flags &= ~UBTBCMFW_FLAG_WRITE_STALL; usb2_transfer_start(xfer_other); } - return; } static void @@ -351,7 +350,6 @@ ubtbcmfw_read_clear_stall_callback(struc sc->sc_flags &= ~UBTBCMFW_FLAG_READ_STALL; usb2_transfer_start(xfer_other); } - return; } static void @@ -360,7 +358,6 @@ ubtbcmfw_start_read(struct usb2_fifo *fi struct ubtbcmfw_softc *sc = fifo->priv_sc0; usb2_transfer_start(sc->sc_xfer[1]); - return; } static void @@ -370,7 +367,6 @@ ubtbcmfw_stop_read(struct usb2_fifo *fif usb2_transfer_stop(sc->sc_xfer[3]); usb2_transfer_stop(sc->sc_xfer[1]); - return; } static void @@ -379,7 +375,6 @@ ubtbcmfw_start_write(struct usb2_fifo *f struct ubtbcmfw_softc *sc = fifo->priv_sc0; usb2_transfer_start(sc->sc_xfer[0]); - return; } static void @@ -389,7 +384,6 @@ ubtbcmfw_stop_write(struct usb2_fifo *fi usb2_transfer_stop(sc->sc_xfer[2]); usb2_transfer_stop(sc->sc_xfer[0]); - return; } static int @@ -424,7 +418,6 @@ ubtbcmfw_close(struct usb2_fifo *fifo, i if (fflags & (FREAD | FWRITE)) { usb2_fifo_free_buffer(fifo); } - return; } static int Modified: user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/controller/at91dci.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/controller/at91dci.c Fri Dec 12 02:11:49 2008 (r185966) +++ user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/controller/at91dci.c Fri Dec 12 03:23:50 2008 (r185967) @@ -99,10 +99,10 @@ static at91dci_cmd_t at91dci_setup_rx; static at91dci_cmd_t at91dci_data_rx; static at91dci_cmd_t at91dci_data_tx; static at91dci_cmd_t at91dci_data_tx_sync; -static void at91dci_device_done(struct usb2_xfer *xfer, usb2_error_t error); -static void at91dci_do_poll(struct usb2_bus *bus); -static void at91dci_root_ctrl_poll(struct at91dci_softc *sc); -static void at91dci_standard_done(struct usb2_xfer *xfer); +static void at91dci_device_done(struct usb2_xfer *, usb2_error_t); +static void at91dci_do_poll(struct usb2_bus *); +static void at91dci_root_ctrl_poll(struct at91dci_softc *); +static void at91dci_standard_done(struct usb2_xfer *); static usb2_sw_transfer_func_t at91dci_root_intr_done; static usb2_sw_transfer_func_t at91dci_root_ctrl_done; @@ -200,7 +200,6 @@ at91dci_get_hw_ep_profile(struct usb2_de } else { *ppf = NULL; } - return; } static void @@ -219,7 +218,6 @@ at91dci_clocks_on(struct at91dci_softc * /* enable Transceiver */ AT91_UDP_WRITE_4(sc, AT91_UDP_TXVC, 0); } - return; } static void @@ -237,7 +235,6 @@ at91dci_clocks_off(struct at91dci_softc } sc->sc_flags.clocks_off = 1; } - return; } static void @@ -250,7 +247,6 @@ at91dci_pull_up(struct at91dci_softc *sc sc->sc_flags.d_pulled_up = 1; (sc->sc_pull_up) (sc->sc_pull_arg); } - return; } static void @@ -262,7 +258,6 @@ at91dci_pull_down(struct at91dci_softc * sc->sc_flags.d_pulled_up = 0; (sc->sc_pull_down) (sc->sc_pull_arg); } - return; } static void @@ -279,8 +274,6 @@ at91dci_wakeup_peer(struct at91dci_softc return; } AT91_UDP_WRITE_4(sc, AT91_UDP_GSTATE, temp); - - return; } static void @@ -304,8 +297,6 @@ at91dci_rem_wakeup_set(struct usb2_devic } AT91_UDP_WRITE_4(sc, AT91_UDP_GSTATE, temp); - - return; } static void @@ -315,8 +306,6 @@ at91dci_set_address(struct at91dci_softc AT91_UDP_WRITE_4(sc, AT91_UDP_FADDR, addr | AT91_UDP_FADDR_EN); - - return; } static uint8_t @@ -756,7 +745,6 @@ repeat: goto repeat; } } - return; } static void @@ -792,8 +780,6 @@ at91dci_vbus_interrupt(struct usb2_bus * } USB_BUS_UNLOCK(&sc->sc_bus); - - return; } void @@ -880,8 +866,6 @@ at91dci_interrupt(struct at91dci_softc * at91dci_interrupt_poll(sc); } USB_BUS_UNLOCK(&sc->sc_bus); - - return; } static void @@ -906,7 +890,6 @@ at91dci_setup_standard_chain_sub(struct td->did_stall = 0; td->short_pkt = temp->short_pkt; td->alt_next = temp->setup_alt_next; - return; } static void @@ -1054,7 +1037,6 @@ at91dci_setup_standard_chain(struct usb2 td = xfer->td_transfer_first; td->fifo_bank = 1; } - return; } static void @@ -1071,8 +1053,6 @@ at91dci_timeout(void *arg) at91dci_device_done(xfer, USB_ERR_TIMEOUT); USB_BUS_UNLOCK(&sc->sc_bus); - - return; } static void @@ -1104,7 +1084,6 @@ at91dci_start_standard_chain(struct usb2 &at91dci_timeout, xfer->timeout); } } - return; } static void @@ -1240,7 +1219,6 @@ at91dci_standard_done(struct usb2_xfer * } done: at91dci_device_done(xfer, err); - return; } /*------------------------------------------------------------------------* @@ -1270,7 +1248,6 @@ at91dci_device_done(struct usb2_xfer *xf } /* dequeue transfer and start next transfer */ usb2_transfer_done(xfer, error); - return; } static void @@ -1296,7 +1273,6 @@ at91dci_set_stall(struct usb2_device *ud csr_val = AT91_UDP_READ_4(sc, csr_reg); AT91_CSR_ACK(csr_val, AT91_UDP_CSR_FORCESTALL); AT91_UDP_WRITE_4(sc, csr_reg, csr_val); - return; } static void @@ -1393,8 +1369,6 @@ at91dci_clear_stall_sub(struct at91dci_s /* enable endpoint */ AT91_UDP_WRITE_4(sc, AT91_UDP_CSR(ep_no), csr_val); - - return; } static void @@ -1423,7 +1397,6 @@ at91dci_clear_stall(struct usb2_device * (ed->bEndpointAddress & UE_ADDR), (ed->bmAttributes & UE_XFERTYPE), (ed->bEndpointAddress & (UE_DIR_IN | UE_DIR_OUT))); - return; } usb2_error_t @@ -1511,8 +1484,6 @@ at91dci_uninit(struct at91dci_softc *sc) at91dci_pull_down(sc); at91dci_clocks_off(sc); USB_BUS_UNLOCK(&sc->sc_bus); - - return; } void @@ -1536,7 +1507,6 @@ at91dci_do_poll(struct usb2_bus *bus) at91dci_interrupt_poll(sc); at91dci_root_ctrl_poll(sc); USB_BUS_UNLOCK(&sc->sc_bus); - return; } /*------------------------------------------------------------------------* @@ -1552,7 +1522,6 @@ static void at91dci_device_bulk_close(struct usb2_xfer *xfer) { at91dci_device_done(xfer, USB_ERR_CANCELLED); - return; } static void @@ -1567,7 +1536,6 @@ at91dci_device_bulk_start(struct usb2_xf /* setup TDs */ at91dci_setup_standard_chain(xfer); at91dci_start_standard_chain(xfer); - return; } struct usb2_pipe_methods at91dci_device_bulk_methods = @@ -1593,7 +1561,6 @@ static void at91dci_device_ctrl_close(struct usb2_xfer *xfer) { at91dci_device_done(xfer, USB_ERR_CANCELLED); - return; } static void @@ -1608,7 +1575,6 @@ at91dci_device_ctrl_start(struct usb2_xf /* setup TDs */ at91dci_setup_standard_chain(xfer); at91dci_start_standard_chain(xfer); - return; } struct usb2_pipe_methods at91dci_device_ctrl_methods = @@ -1634,7 +1600,6 @@ static void at91dci_device_intr_close(struct usb2_xfer *xfer) { at91dci_device_done(xfer, USB_ERR_CANCELLED); - return; } static void @@ -1649,7 +1614,6 @@ at91dci_device_intr_start(struct usb2_xf /* setup TDs */ at91dci_setup_standard_chain(xfer); at91dci_start_standard_chain(xfer); - return; } struct usb2_pipe_methods at91dci_device_intr_methods = @@ -1675,7 +1639,6 @@ static void at91dci_device_isoc_fs_close(struct usb2_xfer *xfer) { at91dci_device_done(xfer, USB_ERR_CANCELLED); - return; } static void @@ -1728,7 +1691,6 @@ at91dci_device_isoc_fs_enter(struct usb2 /* setup TDs */ at91dci_setup_standard_chain(xfer); - return; } static void @@ -1736,7 +1698,6 @@ at91dci_device_isoc_fs_start(struct usb2 { /* start TD chain */ at91dci_start_standard_chain(xfer); - return; } struct usb2_pipe_methods at91dci_device_isoc_fs_methods = @@ -1771,7 +1732,6 @@ at91dci_root_ctrl_close(struct usb2_xfer sc->sc_root_ctrl.xfer = NULL; } at91dci_device_done(xfer, USB_ERR_CANCELLED); - return; } /* @@ -1876,8 +1836,6 @@ at91dci_root_ctrl_start(struct usb2_xfer usb2_config_td_queue_command( &sc->sc_config_td, NULL, &at91dci_root_ctrl_task, 0, 0); - - return; } static void @@ -1885,7 +1843,6 @@ at91dci_root_ctrl_task(struct at91dci_so struct at91dci_config_copy *cc, uint16_t refcount) { at91dci_root_ctrl_poll(sc); - return; } static void @@ -2294,7 +2251,6 @@ at91dci_root_ctrl_poll(struct at91dci_so { usb2_sw_transfer(&sc->sc_root_ctrl, &at91dci_root_ctrl_done); - return; } struct usb2_pipe_methods at91dci_root_ctrl_methods = @@ -2325,7 +2281,6 @@ at91dci_root_intr_close(struct usb2_xfer sc->sc_root_intr.xfer = NULL; } at91dci_device_done(xfer, USB_ERR_CANCELLED); - return; } static void @@ -2340,7 +2295,6 @@ at91dci_root_intr_start(struct usb2_xfer struct at91dci_softc *sc = xfer->usb2_sc; sc->sc_root_intr.xfer = xfer; - return; } struct usb2_pipe_methods at91dci_root_intr_methods = @@ -2465,7 +2419,6 @@ at91dci_xfer_setup(struct usb2_setup_par } xfer->td_start[0] = last_obj; - return; } static void @@ -2530,7 +2483,6 @@ at91dci_pipe_init(struct usb2_device *ud break; } } - return; } struct usb2_bus_methods at91dci_bus_methods = Modified: user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/controller/at91dci_atmelarm.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/controller/at91dci_atmelarm.c Fri Dec 12 02:11:49 2008 (r185966) +++ user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/controller/at91dci_atmelarm.c Fri Dec 12 03:23:50 2008 (r185967) @@ -87,7 +87,6 @@ at91_vbus_interrupt(struct at91_udp_soft vbus_val = at91_pio_gpio_get(VBUS_BASE, VBUS_MASK); (sc->sc_dci.sc_bus.methods->vbus_interrupt) (&sc->sc_dci.sc_bus, vbus_val); - return; } static void @@ -97,7 +96,6 @@ at91_udp_clocks_on(void *arg) at91_pmc_clock_enable(sc->sc_iclk); at91_pmc_clock_enable(sc->sc_fclk); - return; } static void @@ -107,21 +105,18 @@ at91_udp_clocks_off(void *arg) at91_pmc_clock_disable(sc->sc_fclk); at91_pmc_clock_disable(sc->sc_iclk); - return; } static void at91_udp_pull_up(void *arg) { at91_pio_gpio_set(PULLUP_BASE, PULLUP_MASK); - return; } static void at91_udp_pull_down(void *arg) { at91_pio_gpio_clear(PULLUP_BASE, PULLUP_MASK); - return; } static int Modified: user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/controller/ehci2.c ============================================================================== --- user/kmacy/HEAD_fast_multi_xmit/sys/dev/usb2/controller/ehci2.c Fri Dec 12 02:11:49 2008 (r185966) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Fri Dec 12 14:06:21 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EDC9106567B; Fri, 12 Dec 2008 14:06:21 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E29C8FC16; Fri, 12 Dec 2008 14:06:21 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBCE6Lhs099489; Fri, 12 Dec 2008 14:06:21 GMT (envelope-from dfr@svn.freebsd.org) Received: (from dfr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBCE6LBk099487; Fri, 12 Dec 2008 14:06:21 GMT (envelope-from dfr@svn.freebsd.org) Message-Id: <200812121406.mBCE6LBk099487@svn.freebsd.org> From: Doug Rabson Date: Fri, 12 Dec 2008 14:06:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185988 - user/dfr/xenhvm/6/sys/dev/xen/xenpci X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Dec 2008 14:06:21 -0000 Author: dfr Date: Fri Dec 12 14:06:21 2008 New Revision: 185988 URL: http://svn.freebsd.org/changeset/base/185988 Log: Mark the evtchn interrupt as MPSAFE and respect the INTR_MPSAFE flags passed when binding event channels to handlers. Add svn:keywords to the files in sys/dev/xen/xenpci. Modified: user/dfr/xenhvm/6/sys/dev/xen/xenpci/evtchn.c (contents, props changed) user/dfr/xenhvm/6/sys/dev/xen/xenpci/machine_reboot.c (contents, props changed) user/dfr/xenhvm/6/sys/dev/xen/xenpci/xenpci.c (props changed) user/dfr/xenhvm/6/sys/dev/xen/xenpci/xenpcivar.h (props changed) Modified: user/dfr/xenhvm/6/sys/dev/xen/xenpci/evtchn.c ============================================================================== --- user/dfr/xenhvm/6/sys/dev/xen/xenpci/evtchn.c Fri Dec 12 14:03:04 2008 (r185987) +++ user/dfr/xenhvm/6/sys/dev/xen/xenpci/evtchn.c Fri Dec 12 14:06:21 2008 (r185988) @@ -29,7 +29,7 @@ */ #include -__FBSDID("$FreeBSD: user/dfr/xenhvm/6/sys/xen/evtchn/evtchn.c 184235 2008-10-25 00:25:25Z kmacy $"); +__FBSDID("$FreeBSD$"); #include #include @@ -70,6 +70,7 @@ static struct { int close:1; /* close on unbind_from_irqhandler()? */ int inuse:1; int in_handler:1; + int mpsafe:1; } irq_evtchn[256]; static int evtchn_to_irq[NR_EVENT_CHANNELS] = { [0 ... NR_EVENT_CHANNELS-1] = -1 }; @@ -167,6 +168,7 @@ bind_listening_port_to_irqhandler(unsign irq_evtchn[irq].arg = arg; irq_evtchn[irq].evtchn = alloc_unbound.port; irq_evtchn[irq].close = 1; + irq_evtchn[irq].mpsafe = (irqflags & INTR_MPSAFE) != 0; evtchn_to_irq[alloc_unbound.port] = irq; @@ -196,6 +198,7 @@ bind_caller_port_to_irqhandler(unsigned irq_evtchn[irq].arg = arg; irq_evtchn[irq].evtchn = caller_port; irq_evtchn[irq].close = 0; + irq_evtchn[irq].mpsafe = (irqflags & INTR_MPSAFE) != 0; evtchn_to_irq[caller_port] = irq; @@ -262,7 +265,7 @@ evtchn_interrupt(void *arg) int cpu = 0; /*smp_processor_id();*/ driver_intr_t *handler; void *handler_arg; - int irq; + int irq, handler_mpsafe; shared_info_t *s = HYPERVISOR_shared_info; vcpu_info_t *v = &s->vcpu_info[cpu]; struct pcpu *pc = pcpu_find(cpu); @@ -317,6 +320,7 @@ evtchn_interrupt(void *arg) mtx_lock(&irq_evtchn[irq].lock); handler = irq_evtchn[irq].handler; handler_arg = irq_evtchn[irq].arg; + handler_mpsafe = irq_evtchn[irq].mpsafe; if (unlikely(handler == NULL)) { printf("Xen IRQ%d (port %d) has no handler!\n", irq, port); @@ -327,7 +331,11 @@ evtchn_interrupt(void *arg) mtx_unlock(&irq_evtchn[irq].lock); //local_irq_enable(); + if (!handler_mpsafe) + mtx_lock(&Giant); handler(handler_arg); + if (!handler_mpsafe) + mtx_unlock(&Giant); //local_irq_disable(); mtx_lock(&irq_evtchn[irq].lock); @@ -399,7 +407,7 @@ xenpci_irq_init(device_t device, struct } error = BUS_SETUP_INTR(device_get_parent(device), device, - scp->res_irq, INTR_TYPE_MISC, evtchn_interrupt, NULL, + scp->res_irq, INTR_MPSAFE|INTR_TYPE_MISC, evtchn_interrupt, NULL, &scp->intr_cookie); if (error) return (error); Modified: user/dfr/xenhvm/6/sys/dev/xen/xenpci/machine_reboot.c ============================================================================== --- user/dfr/xenhvm/6/sys/dev/xen/xenpci/machine_reboot.c Fri Dec 12 14:03:04 2008 (r185987) +++ user/dfr/xenhvm/6/sys/dev/xen/xenpci/machine_reboot.c Fri Dec 12 14:06:21 2008 (r185988) @@ -1,5 +1,5 @@ #include -__FBSDID("$FreeBSD: user/dfr/xenhvm/6/sys/xen/evtchn/evtchn.c 184235 2008-10-25 00:25:25Z kmacy $"); +__FBSDID("$FreeBSD$"); #include #include