From owner-p4-projects@FreeBSD.ORG Thu Apr 10 05:36:15 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 51E2E1065672; Thu, 10 Apr 2008 05:36:15 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1447F1065670 for ; Thu, 10 Apr 2008 05:36:15 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 036798FC25 for ; Thu, 10 Apr 2008 05:36:15 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m3A5aEEH098893 for ; Thu, 10 Apr 2008 05:36:14 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m3A5aEHw098891 for perforce@freebsd.org; Thu, 10 Apr 2008 05:36:14 GMT (envelope-from sam@freebsd.org) Date: Thu, 10 Apr 2008 05:36:14 GMT Message-Id: <200804100536.m3A5aEHw098891@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Cc: Subject: PERFORCE change 139710 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Apr 2008 05:36:15 -0000 http://perforce.freebsd.org/chv.cgi?CH=139710 Change 139710 by sam@sam_ebb on 2008/04/10 05:35:31 IFC @ 139709 Affected files ... .. //depot/projects/vap/etc/rc.d/ppp#6 integrate .. //depot/projects/vap/include/string.h#3 integrate .. //depot/projects/vap/lib/libc/string/Makefile.inc#3 integrate .. //depot/projects/vap/lib/libc/string/Symbol.map#3 integrate .. //depot/projects/vap/lib/libc/string/memchr.3#3 integrate .. //depot/projects/vap/lib/libc/string/memrchr.c#1 branch .. //depot/projects/vap/share/man/man5/rc.conf.5#8 integrate .. //depot/projects/vap/share/mk/bsd.lib.mk#3 integrate .. //depot/projects/vap/sys/dev/nfe/if_nfe.c#6 integrate .. //depot/projects/vap/sys/dev/nfe/if_nfereg.h#4 integrate .. //depot/projects/vap/sys/dev/ral/rt2661.c#24 integrate .. //depot/projects/vap/sys/dev/usb/ubsa.c#7 integrate .. //depot/projects/vap/sys/dev/usb/usbdevs#13 integrate .. //depot/projects/vap/sys/kern/subr_firmware.c#6 integrate .. //depot/projects/vap/sys/kern/vfs_cache.c#10 integrate .. //depot/projects/vap/sys/netgraph/ng_base.c#16 integrate .. //depot/projects/vap/sys/pci/if_rl.c#7 integrate .. //depot/projects/vap/sys/powerpc/include/atomic.h#9 integrate .. //depot/projects/vap/sys/sparc64/include/intr_machdep.h#5 integrate .. //depot/projects/vap/sys/sparc64/include/smp.h#6 integrate .. //depot/projects/vap/sys/sparc64/sparc64/intr_machdep.c#8 integrate .. //depot/projects/vap/sys/sparc64/sparc64/mp_machdep.c#7 integrate .. //depot/projects/vap/sys/sys/param.h#17 integrate Differences ... ==== //depot/projects/vap/etc/rc.d/ppp#6 (text+ko) ==== @@ -1,6 +1,6 @@ #!/bin/sh # -# $FreeBSD: src/etc/rc.d/ppp,v 1.19 2008/04/06 20:39:33 brooks Exp $ +# $FreeBSD: src/etc/rc.d/ppp,v 1.20 2008/04/10 01:32:49 brooks Exp $ # # PROVIDE: ppp @@ -19,6 +19,7 @@ ppp_start_profile() { local _ppp_profile _ppp_mode _ppp_nat _ppp_unit + local _ppp_profile_cleaned _punct _punct_c _ppp_profile=$1 _ppp_profile_cleaned=$1 ==== //depot/projects/vap/include/string.h#3 (text+ko) ==== @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)string.h 8.1 (Berkeley) 6/2/93 - * $FreeBSD: src/include/string.h,v 1.25 2005/11/24 08:30:44 ru Exp $ + * $FreeBSD: src/include/string.h,v 1.26 2008/04/10 00:12:43 delphij Exp $ */ #ifndef _STRING_H_ @@ -59,6 +59,7 @@ void *memccpy(void * __restrict, const void * __restrict, int, size_t); #endif void *memchr(const void *, int, size_t) __pure; +void *memrchr(const void *, int, size_t) __pure; int memcmp(const void *, const void *, size_t) __pure; void *memcpy(void * __restrict, const void * __restrict, size_t); #if __BSD_VISIBLE ==== //depot/projects/vap/lib/libc/string/Makefile.inc#3 (text+ko) ==== @@ -1,5 +1,5 @@ # @(#)Makefile.inc 8.1 (Berkeley) 6/4/93 -# $FreeBSD: src/lib/libc/string/Makefile.inc,v 1.37 2006/03/13 01:15:00 deischen Exp $ +# $FreeBSD: src/lib/libc/string/Makefile.inc,v 1.38 2008/04/10 00:12:44 delphij Exp $ .PATH: ${.CURDIR}/${MACHINE_ARCH}/string ${.CURDIR}/string @@ -7,7 +7,7 @@ # machine-independent string sources MISRCS+=bcmp.c bcopy.c bzero.c ffs.c ffsl.c fls.c flsl.c index.c memccpy.c \ - memchr.c memcmp.c \ + memchr.c memrchr.c memcmp.c \ memcpy.c memmem.c memmove.c memset.c rindex.c stpcpy.c strcasecmp.c \ strcat.c strchr.c strcmp.c strcoll.c strcpy.c strcspn.c strdup.c \ strerror.c strlcat.c strlcpy.c strlen.c strmode.c strncat.c strncmp.c \ @@ -39,6 +39,7 @@ MLINKS+=ffs.3 fls.3 MLINKS+=ffs.3 flsl.3 MLINKS+=index.3 rindex.3 +MLINKS+=memchr.3 memrchr.3 MLINKS+=strcasecmp.3 strncasecmp.3 MLINKS+=strcat.3 strncat.3 MLINKS+=strchr.3 strrchr.3 ==== //depot/projects/vap/lib/libc/string/Symbol.map#3 (text) ==== @@ -1,5 +1,5 @@ /* - * $FreeBSD: src/lib/libc/string/Symbol.map,v 1.2 2007/04/29 14:05:19 deischen Exp $ + * $FreeBSD: src/lib/libc/string/Symbol.map,v 1.3 2008/04/10 00:12:44 delphij Exp $ */ FBSD_1.0 { @@ -77,6 +77,10 @@ wmemset; }; +FBSD_1.1 { + memrchr; +}; + FBSDprivate_1.0 { __strtok_r; }; ==== //depot/projects/vap/lib/libc/string/memchr.3#3 (text+ko) ==== @@ -30,9 +30,9 @@ .\" SUCH DAMAGE. .\" .\" @(#)memchr.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/string/memchr.3,v 1.9 2007/01/09 00:28:12 imp Exp $ +.\" $FreeBSD: src/lib/libc/string/memchr.3,v 1.10 2008/04/10 00:12:44 delphij Exp $ .\" -.Dd June 4, 1993 +.Dd April 9, 2008 .Dt MEMCHR 3 .Os .Sh NAME @@ -44,6 +44,8 @@ .In string.h .Ft void * .Fn memchr "const void *b" "int c" "size_t len" +.Ft void * +.Fn memrchr "const void *b" "int c" "size_t len" .Sh DESCRIPTION The .Fn memchr @@ -53,11 +55,22 @@ (converted to an unsigned char) in string .Fa b . +.Pp +The +.Fn memrchr +function behaves like +.Fn memchr , +except that it locates the last occurrence of +.Fa c +in string +.Fa b . .Sh RETURN VALUES The .Fn memchr -function -returns a pointer to the byte located, +and +.Fn memrchr +functions +return a pointer to the byte located, or NULL if no such byte exists within .Fa len bytes. @@ -77,3 +90,15 @@ function conforms to .St -isoC . +.Pp +The +.Fn memrchr +function is a GNU extension and conforms to no standard. +.Sh HISTORY +The +.Fn memrchr +function first appeared in GNU libc 2.1.91, this implementation +first appeared in +.Fx 8.0 , +coming from +.Ox 4.3 . ==== //depot/projects/vap/share/man/man5/rc.conf.5#8 (text+ko) ==== @@ -22,9 +22,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD: src/share/man/man5/rc.conf.5,v 1.338 2008/04/08 23:34:12 emax Exp $ +.\" $FreeBSD: src/share/man/man5/rc.conf.5,v 1.339 2008/04/09 21:24:11 emax Exp $ .\" -.Dd January 27, 2008 +.Dd April 9, 2008 .Dt RC.CONF 5 .Os .Sh NAME ==== //depot/projects/vap/share/mk/bsd.lib.mk#3 (text+ko) ==== @@ -1,5 +1,5 @@ # from: @(#)bsd.lib.mk 5.26 (Berkeley) 5/2/91 -# $FreeBSD: src/share/mk/bsd.lib.mk,v 1.183 2007/10/20 19:01:49 ru Exp $ +# $FreeBSD: src/share/mk/bsd.lib.mk,v 1.184 2008/04/09 20:27:53 kan Exp $ # .include @@ -106,7 +106,7 @@ .include -# Allow librararies to specify their own version map or have it +# Allow libraries to specify their own version map or have it # automatically generated (see bsd.symver.mk above). .if ${MK_SYMVER} == "yes" && !empty(VERSION_MAP) ${SHLIB_NAME}: ${VERSION_MAP} ==== //depot/projects/vap/sys/dev/nfe/if_nfe.c#6 (text+ko) ==== @@ -21,7 +21,7 @@ /* Driver for NVIDIA nForce MCP Fast Ethernet and Gigabit Ethernet */ #include -__FBSDID("$FreeBSD: src/sys/dev/nfe/if_nfe.c,v 1.27 2008/03/06 01:47:53 yongari Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/nfe/if_nfe.c,v 1.28 2008/04/10 01:25:09 yongari Exp $"); #ifdef HAVE_KERNEL_OPTION_HEADERS #include "opt_device_polling.h" @@ -237,6 +237,14 @@ "NVIDIA nForce MCP67 Networking Adapter"}, {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP67_LAN4, "NVIDIA nForce MCP67 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP73_LAN1, + "NVIDIA nForce MCP73 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP73_LAN2, + "NVIDIA nForce MCP73 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP73_LAN3, + "NVIDIA nForce MCP73 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP73_LAN4, + "NVIDIA nForce MCP73 Networking Adapter"}, {0, 0, NULL} }; @@ -452,6 +460,10 @@ case PCI_PRODUCT_NVIDIA_MCP67_LAN2: case PCI_PRODUCT_NVIDIA_MCP67_LAN3: case PCI_PRODUCT_NVIDIA_MCP67_LAN4: + case PCI_PRODUCT_NVIDIA_MCP73_LAN1: + case PCI_PRODUCT_NVIDIA_MCP73_LAN2: + case PCI_PRODUCT_NVIDIA_MCP73_LAN3: + case PCI_PRODUCT_NVIDIA_MCP73_LAN4: sc->nfe_flags |= NFE_40BIT_ADDR | NFE_PWR_MGMT | NFE_CORRECT_MACADDR | NFE_TX_FLOW_CTRL; break; ==== //depot/projects/vap/sys/dev/nfe/if_nfereg.h#4 (text+ko) ==== @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $FreeBSD: src/sys/dev/nfe/if_nfereg.h,v 1.11 2008/03/06 01:47:53 yongari Exp $ + * $FreeBSD: src/sys/dev/nfe/if_nfereg.h,v 1.12 2008/04/10 01:25:09 yongari Exp $ */ #define NFE_RX_RING_COUNT 256 @@ -291,6 +291,10 @@ #define PCI_PRODUCT_NVIDIA_MCP67_LAN2 0x054d #define PCI_PRODUCT_NVIDIA_MCP67_LAN3 0x054e #define PCI_PRODUCT_NVIDIA_MCP67_LAN4 0x054f +#define PCI_PRODUCT_NVIDIA_MCP73_LAN1 0x07dc +#define PCI_PRODUCT_NVIDIA_MCP73_LAN2 0x07dd +#define PCI_PRODUCT_NVIDIA_MCP73_LAN3 0x07de +#define PCI_PRODUCT_NVIDIA_MCP73_LAN4 0x07df #define PCI_PRODUCT_NVIDIA_NFORCE3_LAN2 PCI_PRODUCT_NVIDIA_NFORCE2_400_LAN1 #define PCI_PRODUCT_NVIDIA_NFORCE3_LAN3 PCI_PRODUCT_NVIDIA_NFORCE2_400_LAN2 ==== //depot/projects/vap/sys/dev/ral/rt2661.c#24 (text) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/ral/rt2661.c,v 1.18 2007/11/06 07:30:11 kevlo Exp $ */ +/* $FreeBSD: src/sys/dev/ral/rt2661.c,v 1.19 2008/04/09 18:40:10 sam Exp $ */ /*- * Copyright (c) 2006 @@ -18,7 +18,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ral/rt2661.c,v 1.18 2007/11/06 07:30:11 kevlo Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ral/rt2661.c,v 1.19 2008/04/09 18:40:10 sam Exp $"); /*- * Ralink Technology RT2561, RT2561S and RT2661 chipset driver ==== //depot/projects/vap/sys/dev/usb/ubsa.c#7 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/usb/ubsa.c,v 1.34 2008/03/28 14:20:06 rpaulo Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/usb/ubsa.c,v 1.35 2008/04/09 22:20:28 flz Exp $"); /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. * All rights reserved. @@ -226,6 +226,8 @@ { USB_VENDOR_PERACOM, USB_PRODUCT_PERACOM_SERIAL1 }, /* Novatel Wireless Merlin cards */ { USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_U740 }, + /* Novatel Wireless Merlin v740 */ + { USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_V740 }, /* Option Vodafone MC3G */ { USB_VENDOR_OPTION, USB_PRODUCT_OPTION_VODAFONEMC3G }, /* Option GlobeTrotter 3G */ ==== //depot/projects/vap/sys/dev/usb/usbdevs#13 (text+ko) ==== @@ -1,4 +1,4 @@ -$FreeBSD: src/sys/dev/usb/usbdevs,v 1.345 2008/03/28 14:20:06 rpaulo Exp $ +$FreeBSD: src/sys/dev/usb/usbdevs,v 1.346 2008/04/09 22:20:28 flz Exp $ /* $NetBSD: usbdevs,v 1.392 2004/12/29 08:38:44 imp Exp $ */ /*- @@ -1786,6 +1786,7 @@ /* Novatel Wireless products */ product NOVATEL CDMA_MODEM 0x1110 Novatel Wireless Merlin CDMA product NOVATEL V620 0x1110 Merlin V620 +product NOVATEL V740 0x1120 Merlin V740 product NOVATEL V720 0x1130 Merlin V720 product NOVATEL U740 0x1400 Merlin U740 product NOVATEL U720 0x2110 Merlin U720 ==== //depot/projects/vap/sys/kern/subr_firmware.c#6 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/subr_firmware.c,v 1.9 2007/02/15 17:21:31 luigi Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/subr_firmware.c,v 1.10 2008/04/09 19:07:48 sam Exp $"); #include #include @@ -263,7 +263,6 @@ mtx_lock(&firmware_mtx); mtx_unlock(&firmware_mtx); - /* XXX unlocked, necessary? */ if (td->td_proc->p_fd->fd_rdir == NULL) { printf("%s: root not mounted yet, no way to load image\n", imagename); @@ -279,12 +278,14 @@ mtx_lock(&firmware_mtx); fp = lookup(imagename, NULL); if (fp == NULL || fp->file != NULL) { + mtx_unlock(&firmware_mtx); if (fp == NULL) printf("%s: firmware image loaded, " "but did not register\n", imagename); (void) linker_release_module(imagename, NULL, NULL); - } else - fp->file = result; /* record the module identity */ + goto done; + } + fp->file = result; /* record the module identity */ mtx_unlock(&firmware_mtx); done: wakeup_one(imagename); /* we're done */ ==== //depot/projects/vap/sys/kern/vfs_cache.c#10 (text+ko) ==== @@ -33,7 +33,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/vfs_cache.c,v 1.120 2008/03/31 11:53:02 kib Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/vfs_cache.c,v 1.121 2008/04/09 20:19:55 pjd Exp $"); #include #include @@ -423,7 +423,7 @@ * When we lookup "." we still can be asked to lock it * differently... */ - ltype = cnp->cn_lkflags & (LK_SHARED | LK_EXCLUSIVE); + ltype = cnp->cn_lkflags & LK_TYPE_MASK; if (ltype == VOP_ISLOCKED(*vpp)) return (-1); else if (ltype == LK_EXCLUSIVE) @@ -440,12 +440,14 @@ error = vget(*vpp, cnp->cn_lkflags | LK_INTERLOCK, cnp->cn_thread); if (cnp->cn_flags & ISDOTDOT) vn_lock(dvp, ltype | LK_RETRY); - if ((cnp->cn_flags & ISLASTCN) && (cnp->cn_lkflags & LK_EXCLUSIVE)) - ASSERT_VOP_ELOCKED(*vpp, "cache_lookup"); if (error) { *vpp = NULL; goto retry; } + if ((cnp->cn_flags & ISLASTCN) && + (cnp->cn_lkflags & LK_TYPE_MASK) == LK_EXCLUSIVE) { + ASSERT_VOP_ELOCKED(*vpp, "cache_lookup"); + } return (-1); } ==== //depot/projects/vap/sys/netgraph/ng_base.c#16 (text+ko) ==== @@ -38,7 +38,7 @@ * Authors: Julian Elischer * Archie Cobbs * - * $FreeBSD: src/sys/netgraph/ng_base.c,v 1.155 2008/04/06 15:26:32 mav Exp $ + * $FreeBSD: src/sys/netgraph/ng_base.c,v 1.156 2008/04/09 19:03:19 mav Exp $ * $Whistle: ng_base.c,v 1.39 1999/01/28 23:54:53 julian Exp $ */ @@ -1806,8 +1806,19 @@ | Active Writer ---------------------------------------+ +Node queue has such semantics: +- All flags modifications are atomic. +- Reader count can be incremented only if there is no writer or pending flags. + As soon as this can't be done with single operation, it is implemented with + spin loop and atomic_cmpset(). +- Writer flag can be set only if there is no any bits set. + It is implemented with atomic_cmpset(). +- Pending flag can be set any time, but to avoid collision on queue processing + all queue fields are protected by the mutex. +- Queue processing thread reads queue holding the mutex, but releases it while + processing. When queue is empty pending flag is removed. +*/ -*/ #define WRITER_ACTIVE 0x00000001 #define OP_PENDING 0x00000002 #define READER_INCREMENT 0x00000004 @@ -1849,19 +1860,16 @@ * nothing we could return, either because there really was nothing there, or * because the node was in a state where it cannot yet process the next item * on the queue. - * - * This MUST MUST MUST be called with the mutex held. */ static __inline item_p ng_dequeue(struct ng_queue *ngq, int *rw) { item_p item; + /* This MUST be called with the mutex held. */ mtx_assert(&ngq->q_mtx, MA_OWNED); - /* - * If there is nothing queued, then just return. - * No point in continuing. - */ + + /* If there is nothing queued, then just return. */ if (!QUEUE_ACTIVE(ngq)) { CTR4(KTR_NET, "%20s: node [%x] (%p) queue empty; " "queue flags 0x%lx", __func__, @@ -1878,22 +1886,25 @@ while (1) { long t = ngq->q_flags; if (t & WRITER_ACTIVE) { - /* It's a reader but we can't use it. */ + /* There is writer, reader can't proceed. */ CTR4(KTR_NET, "%20s: node [%x] (%p) queued reader " "can't proceed; queue flags 0x%lx", __func__, ngq->q_node->nd_ID, ngq->q_node, t); return (NULL); } - if (atomic_cmpset_long(&ngq->q_flags, t, + if (atomic_cmpset_acq_long(&ngq->q_flags, t, t + READER_INCREMENT)) break; cpu_spinwait(); } + /* We have got reader lock for the node. */ *rw = NGQRW_R; - } else if (atomic_cmpset_long(&ngq->q_flags, OP_PENDING, + } else if (atomic_cmpset_acq_long(&ngq->q_flags, OP_PENDING, OP_PENDING + WRITER_ACTIVE)) { + /* We have got writer lock for the node. */ *rw = NGQRW_W; } else { + /* There is somebody other, writer can't proceed. */ CTR4(KTR_NET, "%20s: node [%x] (%p) queued writer " "can't proceed; queue flags 0x%lx", __func__, ngq->q_node->nd_ID, ngq->q_node, ngq->q_flags); @@ -1918,10 +1929,8 @@ } /* - * Queue a packet to be picked up by someone else. - * We really don't care who, but we can't or don't want to hang around - * to process it ourselves. We are probably an interrupt routine.. - * If the queue could be run, flag the netisr handler to start. + * Queue a packet to be picked up later by someone else. + * If the queue could be run now, add node to the queue handler's worklist. */ static __inline void ng_queue_rw(struct ng_queue * ngq, item_p item, int rw) @@ -1950,6 +1959,7 @@ NG_QUEUE_UNLOCK(ngq); } +/* Acquire reader lock on node. If node is busy, queue the packet. */ static __inline item_p ng_acquire_read(struct ng_queue *ngq, item_p item) { @@ -1961,7 +1971,7 @@ long t = ngq->q_flags; if (t & NGQ_RMASK) break; /* Node is not ready for reader. */ - if (atomic_cmpset_long(&ngq->q_flags, t, t + READER_INCREMENT)) { + if (atomic_cmpset_acq_long(&ngq->q_flags, t, t + READER_INCREMENT)) { /* Successfully grabbed node */ CTR4(KTR_NET, "%20s: node [%x] (%p) acquired item %p", __func__, ngq->q_node->nd_ID, ngq->q_node, item); @@ -1976,6 +1986,7 @@ return (NULL); } +/* Acquire writer lock on node. If node is busy, queue the packet. */ static __inline item_p ng_acquire_write(struct ng_queue *ngq, item_p item) { @@ -1983,7 +1994,7 @@ ("%s: working on deadnode", __func__)); /* Writer needs completely idle node. */ - if (atomic_cmpset_long(&ngq->q_flags, 0, WRITER_ACTIVE)) { + if (atomic_cmpset_acq_long(&ngq->q_flags, 0, WRITER_ACTIVE)) { /* Successfully grabbed node */ CTR4(KTR_NET, "%20s: node [%x] (%p) acquired item %p", __func__, ngq->q_node->nd_ID, ngq->q_node, item); @@ -2070,18 +2081,21 @@ #endif +/* Release reader lock. */ static __inline void ng_leave_read(struct ng_queue *ngq) { - atomic_subtract_long(&ngq->q_flags, READER_INCREMENT); + atomic_subtract_rel_long(&ngq->q_flags, READER_INCREMENT); } +/* Release writer lock. */ static __inline void ng_leave_write(struct ng_queue *ngq) { - atomic_clear_long(&ngq->q_flags, WRITER_ACTIVE); + atomic_clear_rel_long(&ngq->q_flags, WRITER_ACTIVE); } +/* Purge node queue. Called on node shutdown. */ static void ng_flush_input_queue(struct ng_queue * ngq) { ==== //depot/projects/vap/sys/pci/if_rl.c#7 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/pci/if_rl.c,v 1.173 2008/03/03 04:15:08 yongari Exp $"); +__FBSDID("$FreeBSD: src/sys/pci/if_rl.c,v 1.174 2008/04/10 01:06:05 yongari Exp $"); /* * RealTek 8129/8139 PCI NIC driver @@ -1117,17 +1117,19 @@ * datasheet makes absolutely no mention of this and * RealTek should be shot for this. */ - if ((uint16_t)(rxstat >> 16) == RL_RXSTAT_UNFINISHED) + total_len = rxstat >> 16; + if (total_len == RL_RXSTAT_UNFINISHED) break; - if (!(rxstat & RL_RXSTAT_RXOK)) { + if (!(rxstat & RL_RXSTAT_RXOK) || + total_len < ETHER_MIN_LEN || + total_len > ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN) { ifp->if_ierrors++; rl_init_locked(sc); return; } /* No errors; receive the packet. */ - total_len = rxstat >> 16; rx_bytes += total_len + 4; /* ==== //depot/projects/vap/sys/powerpc/include/atomic.h#9 (text+ko) ==== @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/powerpc/include/atomic.h,v 1.21 2008/04/09 01:00:35 marcel Exp $ + * $FreeBSD: src/sys/powerpc/include/atomic.h,v 1.22 2008/04/10 02:37:26 marcel Exp $ */ #ifndef _MACHINE_ATOMIC_H_ @@ -113,10 +113,10 @@ */ #define __ATOMIC_CLEAR_8(p, v, t) \ - 8-bit atomic_add not implemented + 8-bit atomic_clear not implemented #define __ATOMIC_CLEAR_16(p, v, t) \ - 16-bit atomic_add not implemented + 16-bit atomic_clear not implemented #define __ATOMIC_CLEAR_32(p, v, t) \ __asm __volatile( \ @@ -130,7 +130,7 @@ /* __ATOMIC_CLEAR_32 */ #define __ATOMIC_CLEAR_64(p, v, t) \ - 64-bit atomic_add not implemented + 64-bit atomic_clear not implemented #define _ATOMIC_CLEAR(width, suffix, type) \ static __inline void \ ==== //depot/projects/vap/sys/sparc64/include/intr_machdep.h#5 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/sparc64/include/intr_machdep.h,v 1.17 2007/09/06 19:16:29 marius Exp $ + * $FreeBSD: src/sys/sparc64/include/intr_machdep.h,v 1.18 2008/04/09 21:14:01 marius Exp $ */ #ifndef _MACHINE_INTR_MACHDEP_H_ @@ -33,7 +33,7 @@ #define PIL_MAX (1 << 4) #define IV_MAX (1 << 11) -#define IV_NAMLEN 1024 +#define IV_NAMLEN 1024 #define IR_FREE (PIL_MAX * 2) @@ -46,6 +46,7 @@ #define PIL_RENDEZVOUS 3 /* smp rendezvous ipi */ #define PIL_AST 4 /* ast ipi */ #define PIL_STOP 5 /* stop cpu ipi */ +#define PIL_PREEMPT 6 /* preempt idle thread cpu ipi */ #define PIL_FAST 13 /* fast interrupts */ #define PIL_TICK 14 ==== //depot/projects/vap/sys/sparc64/include/smp.h#6 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/sparc64/include/smp.h,v 1.22 2007/06/16 23:26:00 marius Exp $ + * $FreeBSD: src/sys/sparc64/include/smp.h,v 1.23 2008/04/09 21:14:01 marius Exp $ */ #ifndef _MACHINE_SMP_H_ @@ -51,6 +51,7 @@ #define IPI_AST PIL_AST #define IPI_RENDEZVOUS PIL_RENDEZVOUS +#define IPI_PREEMPT PIL_PREEMPT #define IPI_STOP PIL_STOP #define IPI_RETRIES 5000 ==== //depot/projects/vap/sys/sparc64/sparc64/intr_machdep.c#8 (text+ko) ==== @@ -59,7 +59,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/sparc64/sparc64/intr_machdep.c,v 1.31 2008/04/05 19:58:29 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/sparc64/sparc64/intr_machdep.c,v 1.32 2008/04/09 21:14:01 marius Exp $"); #include #include @@ -95,7 +95,8 @@ "rndzvs", /* PIL_RENDEZVOUS */ "ast", /* PIL_AST */ "stop", /* PIL_STOP */ - "stray", "stray", "stray", "stray", "stray", "stray", "stray", + "preempt", /* PIL_PREEMPT */ + "stray", "stray", "stray", "stray", "stray", "stray", "fast", /* PIL_FAST */ "tick", /* PIL_TICK */ }; ==== //depot/projects/vap/sys/sparc64/sparc64/mp_machdep.c#7 (text+ko) ==== @@ -29,6 +29,7 @@ */ /*- * Copyright (c) 2002 Jake Burkholder. + * Copyright (c) 2007 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -54,7 +55,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/sparc64/sparc64/mp_machdep.c,v 1.38 2008/03/09 15:53:34 marius Exp $"); +__FBSDID("$FreeBSD: src/sys/sparc64/sparc64/mp_machdep.c,v 1.39 2008/04/09 21:14:01 marius Exp $"); #include #include @@ -91,6 +92,7 @@ #include static ih_func_t cpu_ipi_ast; +static ih_func_t cpu_ipi_preempt; static ih_func_t cpu_ipi_stop; /* @@ -257,6 +259,7 @@ intr_setup(PIL_RENDEZVOUS, (ih_func_t *)smp_rendezvous_action, -1, NULL, NULL); intr_setup(PIL_STOP, cpu_ipi_stop, -1, NULL, NULL); + intr_setup(PIL_PREEMPT, cpu_ipi_preempt, -1, NULL, NULL); cpuid_to_mid[curcpu] = PCPU_GET(mid); @@ -440,6 +443,13 @@ } static void +cpu_ipi_preempt(struct trapframe *tf) +{ + + sched_preempt(curthread); +} + +static void spitfire_ipi_selected(u_int cpus, u_long d0, u_long d1, u_long d2) { u_int cpu; ==== //depot/projects/vap/sys/sys/param.h#17 (text+ko) ==== @@ -32,7 +32,7 @@ * SUCH DAMAGE. * * @(#)param.h 8.3 (Berkeley) 4/4/95 - * $FreeBSD: src/sys/sys/param.h,v 1.349 2008/04/08 17:55:26 jkim Exp $ + * $FreeBSD: src/sys/sys/param.h,v 1.350 2008/04/10 00:12:44 delphij Exp $ */ #ifndef _SYS_PARAM_H_ @@ -57,7 +57,7 @@ * is created, otherwise 1. */ #undef __FreeBSD_version -#define __FreeBSD_version 800033 /* Master, propagated to newvers */ +#define __FreeBSD_version 800034 /* Master, propagated to newvers */ #ifndef LOCORE #include