Date: Wed, 11 Aug 2010 18:26:21 GMT From: Alexandre Fiveg <afiveg@skunkworks.freebsd.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 182215 for review Message-ID: <201008111826.o7BIQLZA084520@skunkworks.freebsd.org>
next in thread | raw e-mail | index | archive | help
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) ====
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201008111826.o7BIQLZA084520>