From owner-p4-projects@FreeBSD.ORG Wed Aug 11 18:26:24 2010 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 960C61066A8A; Wed, 11 Aug 2010 18:26:24 +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 07E111066949 for ; Wed, 11 Aug 2010 18:26:23 +0000 (UTC) (envelope-from afiveg@FreeBSD.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id B22FB8FC22 for ; Wed, 11 Aug 2010 18:26:21 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id o7BIQLFJ084523 for ; Wed, 11 Aug 2010 18:26:21 GMT (envelope-from afiveg@FreeBSD.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id o7BIQLZA084520 for perforce@freebsd.org; Wed, 11 Aug 2010 18:26:21 GMT (envelope-from afiveg@FreeBSD.org) Date: Wed, 11 Aug 2010 18:26:21 GMT Message-Id: <201008111826.o7BIQLZA084520@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to afiveg@FreeBSD.org using -f From: Alexandre Fiveg To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 182215 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Aug 2010 18:26:25 -0000 http://p4web.freebsd.org/@@182215?ac=10 Change 182215 by afiveg@cottonmouth on 2010/08/10 19:30:53 cosmetic fixes Affected files ... .. //depot/projects/soc2010/ringmap/current/contrib/libpcap/pcap-bpf.c#15 edit .. //depot/projects/soc2010/ringmap/current/contrib/libpcap/pcap-int.h#15 edit .. //depot/projects/soc2010/ringmap/current/contrib/libpcap/pcap.c#18 edit .. //depot/projects/soc2010/ringmap/current/contrib/libpcap/ringmap_pcap.c#30 edit .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/if_lem.c#31 edit .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/ringmap_8254.c#30 edit .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/ringmap_8254.h#28 edit .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/ringmap_e1000.h#20 edit .. //depot/projects/soc2010/ringmap/current/sys/dev/ixgbe/ringmap_8259.h#13 edit .. //depot/projects/soc2010/ringmap/current/sys/dev/ixgbe/ringmap_ixgbe.c#14 edit .. //depot/projects/soc2010/ringmap/current/sys/net/ringmap.c#44 edit .. //depot/projects/soc2010/ringmap/current/sys/net/ringmap.h#44 edit .. //depot/projects/soc2010/ringmap/current/sys/net/ringmap_kernel.h#14 edit .. //depot/projects/soc2010/ringmap/scripts/build_ringmap.sh#26 edit .. //depot/projects/soc2010/ringmap/scripts/set_ringmap.sh#27 edit .. //depot/projects/soc2010/ringmap/scripts/tailf_ringmap_msgs.sh#21 edit .. //depot/projects/soc2010/ringmap/tests/libpcap/easy_pcap.c#12 edit Differences ... ==== //depot/projects/soc2010/ringmap/current/contrib/libpcap/pcap-bpf.c#15 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/contrib/libpcap/pcap-int.h#15 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/contrib/libpcap/pcap.c#18 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/contrib/libpcap/ringmap_pcap.c#30 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/if_lem.c#31 (text+ko) ==== @@ -1436,10 +1436,6 @@ */ lem_disable_intr(adapter); -#ifdef RINGMAP - adapter->rm->funcs->isr(arg); -#endif - taskqueue_enqueue(adapter->tq, &adapter->rxtx_task); /* Link status change */ @@ -3518,8 +3514,10 @@ #ifdef RINGMAP /* Call our ringmap-isr only in case any process captures (open_cnt > 0) */ - if ((adapter->rm != NULL) && (adapter->rm->open_cnt > 0)) + RINGMAP_LOCK(adapter->rm); + if (adapter->rm->open_cnt > 0) adapter->rm->funcs->delayed_isr(adapter); + RINGMAP_UNLOCK(adapter->rm); #endif while ((current_desc->status & E1000_RXD_STAT_DD) && @@ -3576,8 +3574,10 @@ if (accept_frame) { #ifdef RINGMAP - if ((adapter->rm != NULL) && (adapter->rm->open_cnt > 0)) + RINGMAP_LOCK(adapter->rm); + if (adapter->rm->open_cnt) adapter->rm->funcs->delayed_isr_per_packet(adapter->dev, i); + RINGMAP_UNLOCK(adapter->rm); #endif #ifndef RINGMAP @@ -3704,8 +3704,8 @@ if (--i < 0) i = adapter->num_rx_desc - 1; + /* RINGMAP: Don't write RDT. We do it in sync_tail() */ #ifndef RINGMAP - /* Tail pointer will be with userrp synchronized */ E1000_WRITE_REG(&adapter->hw, E1000_RDT(0), i); #endif ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/ringmap_8254.c#30 (text+ko) ==== @@ -102,7 +102,6 @@ struct timeval last_ts; RINGMAP_INTR(start); - RINGMAP_LOCK(adapter->rm); getmicrotime(&last_ts); @@ -118,7 +117,6 @@ } } - RINGMAP_UNLOCK(adapter->rm); RINGMAP_INTR(end); } @@ -157,7 +155,6 @@ RINGMAP_INTR(start); - RINGMAP_LOCK(rm); SLIST_FOREACH(co, &rm->object_list, objects) { if (co->ring != NULL) { co->ring->slot[slot_num].is_ok = 1; @@ -172,7 +169,6 @@ #endif } } - RINGMAP_UNLOCK(rm); RINGMAP_INTR(end); } ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/ringmap_8254.h#28 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/ringmap_e1000.h#20 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/ixgbe/ringmap_8259.h#13 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/ixgbe/ringmap_ixgbe.c#14 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/net/ringmap.c#44 (text+ko) ==== @@ -61,7 +61,7 @@ }; -struct ringmap_global_list ringmap_list_head = +static struct ringmap_global_list ringmap_list_head = SLIST_HEAD_INITIALIZER(ringmap_list_head); @@ -125,6 +125,10 @@ } +/* + * Should be called from driver detach function. It is a little dangerous + * place. Probably we shoul protect our data here with mutexes. + */ int ringmap_detach(device_t dev) { @@ -138,7 +142,7 @@ RINGMAP_WARN(Can not get pointer to ringmap structure); return (-1); } - + /* Remove all capturing objects associated with ringmap */ while (!SLIST_EMPTY(&rm->object_list)) { co = SLIST_FIRST(&rm->object_list); @@ -185,7 +189,6 @@ rm = cdev2ringmap(cdev); if ( rm == NULL ) { RINGMAP_ERROR(Null pointer to ringmap structure); - return (EIO); } @@ -194,7 +197,6 @@ /* TODO: set max number of threads in the ringmap struct as a variable */ if (rm->open_cnt == RINGMAP_MAX_THREADS) { RINGMAP_ERROR(Can not open device!); - err = EIO; goto out; } @@ -214,7 +216,6 @@ M_DEVBUF, M_ZERO, 0, -1L, PAGE_SIZE, 0); if (ring == NULL) { RINGMAP_ERROR(Can not allocate space for ring); - err = EIO; goto out; } @@ -302,7 +303,6 @@ int ringmap_close(struct cdev *cdev, int flag, int otyp, struct thread *td) { - RINGMAP_FUNC_DEBUG(start); #if (__RINGMAP_DEB) @@ -338,15 +338,14 @@ SLIST_REMOVE(&rm->object_list, co, capt_object, objects); FREE(co, M_DEVBUF); data = NULL; + + rm->open_cnt--; + RINGMAP_UNLOCK(rm); + } else { RINGMAP_FUNC_DEBUG(NULL pointer to the capturing object!); } - if (rm->open_cnt) - --rm->open_cnt; - - RINGMAP_UNLOCK(rm); - RINGMAP_FUNC_DEBUG(end); } @@ -454,7 +453,7 @@ RINGMAP_IOCTL(start); -#if (__RINGMAP_DEB) +#if (RINGMAP_IOCTL_DEB) printf("[%s] pid = %d\n", __func__, td->td_proc->p_pid); #endif @@ -488,7 +487,7 @@ /* Set adapter TAIL register */ rm->funcs->sync_tail(co); -#if (__RINGMAP_DEB) +#if (RINGMAP_IOCTL_DEB) print_capt_obj(co); PRINT_RING_PTRS(co->ring); #endif ==== //depot/projects/soc2010/ringmap/current/sys/net/ringmap.h#44 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/net/ringmap_kernel.h#14 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/scripts/build_ringmap.sh#26 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/scripts/set_ringmap.sh#27 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/scripts/tailf_ringmap_msgs.sh#21 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/tests/libpcap/easy_pcap.c#12 (text+ko) ====