From owner-p4-projects@FreeBSD.ORG Wed Aug 11 18:25:58 2010 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7C4AD1065D86; Wed, 11 Aug 2010 18:25:58 +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 5D324106596A for ; Wed, 11 Aug 2010 18:25:54 +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 1FD158FC13 for ; Wed, 11 Aug 2010 18:25:54 +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 o7BIPsR1083890 for ; Wed, 11 Aug 2010 18:25:54 GMT (envelope-from afiveg@FreeBSD.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id o7BIPrMk083886 for perforce@freebsd.org; Wed, 11 Aug 2010 18:25:53 GMT (envelope-from afiveg@FreeBSD.org) Date: Wed, 11 Aug 2010 18:25:53 GMT Message-Id: <201008111825.o7BIPrMk083886@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 182126 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:25:58 -0000 http://p4web.freebsd.org/@@182126?ac=10 Change 182126 by afiveg@ringmap-2 on 2010/08/09 11:53:41 ringmap_open fixed. capt_object is passed to the set_slot function instead of ring, que, etc... Affected files ... .. //depot/projects/soc2010/ringmap/current/contrib/libpcap/ringmap_pcap.c#28 edit .. //depot/projects/soc2010/ringmap/current/sys/dev/ixgbe/ixgbe.h#12 edit .. //depot/projects/soc2010/ringmap/current/sys/dev/ixgbe/ringmap_8259.h#11 edit .. //depot/projects/soc2010/ringmap/current/sys/dev/ixgbe/ringmap_ixgbe.c#12 edit .. //depot/projects/soc2010/ringmap/current/sys/modules/ringmap/Makefile#4 edit .. //depot/projects/soc2010/ringmap/current/sys/modules/ringmap/Makefile.em#2 edit .. //depot/projects/soc2010/ringmap/current/sys/modules/ringmap/Makefile.ixgbe#2 edit .. //depot/projects/soc2010/ringmap/current/sys/net/ringmap.c#42 edit .. //depot/projects/soc2010/ringmap/current/sys/net/ringmap.h#42 edit .. //depot/projects/soc2010/ringmap/current/sys/net/ringmap_kernel.h#12 edit .. //depot/projects/soc2010/ringmap/scripts/build_ringmap.sh#24 edit .. //depot/projects/soc2010/ringmap/scripts/set_ringmap.sh#25 edit .. //depot/projects/soc2010/ringmap/scripts/tailf_ringmap_msgs.sh#19 edit .. //depot/projects/soc2010/ringmap/stable_8/sys/dev/ixgbe/ixgbe.h#2 edit .. //depot/projects/soc2010/ringmap/stable_8/sys/i386/conf/I686_STABLE#1 add .. //depot/projects/soc2010/ringmap/tests/ringmap/close.c#11 edit .. //depot/projects/soc2010/ringmap/tests/ringmap/ioctl.c#11 edit .. //depot/projects/soc2010/ringmap/tests/ringmap/main.c#13 edit .. //depot/projects/soc2010/ringmap/tests/ringmap/mmap.c#13 edit .. //depot/projects/soc2010/ringmap/tests/ringmap/open.c#13 edit .. //depot/projects/soc2010/ringmap/tests/ringmap/tests.h#11 edit Differences ... ==== //depot/projects/soc2010/ringmap/current/contrib/libpcap/ringmap_pcap.c#28 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/ixgbe/ixgbe.h#12 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/ixgbe/ringmap_8259.h#11 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/ixgbe/ringmap_ixgbe.c#12 (text+ko) ==== @@ -38,7 +38,7 @@ device_t rm_8259_get_device_p(struct cdev *); void rm_8259_enable_intr(device_t); void rm_8259_disable_intr(device_t); -int rm_8259_set_slot(struct ring *, void *, unsigned int); +int rm_8259_set_slot(struct capt_object*, unsigned int); int rm_8259_set_queue(struct capt_object *, unsigned int); void rm_8259_interrupt(void *); void rm_8259_delayed_interrupt(void *); @@ -143,6 +143,7 @@ struct adapter *adapter = (struct adapter *)que->adapter; struct capt_object *co = NULL; + RINGMAP_LOCK(adapter->rm); adapter->rm->interrupts_counter++; @@ -177,18 +178,18 @@ goto out; } + rm_8259_print_ring_pointers(que); + if (adapter->rm->open_cnt) { co = get_capt_obj(que); if (co != NULL) { - co->ring->slot[slot_num].intr_num = co->ring->intr_num; co->ring->slot[slot_num].ts = co->ring->last_ts; co->ring->slot[slot_num].is_ok = 1; rxbuf = &que->rxr->rx_buffers[slot_num]; - #if (RINGMAP_INTR_DEB) rxbuf->m_pack = (struct mbuf *)K_MBUF(co->ring, slot_num); rxbuf->m_pack->m_data = (void *)K_PACKET(co->ring, slot_num); @@ -218,9 +219,10 @@ int -rm_8259_set_slot(struct ring *ring, void *context, unsigned int slot_num) +rm_8259_set_slot(struct capt_object *co, unsigned int slot_num) { - struct ix_queue *que = (struct ix_queue *)context; + struct ix_queue *que = co->que; + struct ring *ring = co->ring; #if (__RINGMAP_DEB) printf("[%s] Set slot: %d\n", __func__, slot_num); ==== //depot/projects/soc2010/ringmap/current/sys/modules/ringmap/Makefile#4 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/modules/ringmap/Makefile.em#2 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/modules/ringmap/Makefile.ixgbe#2 (text+ko) ==== @@ -2,9 +2,9 @@ .PATH: ${.CURDIR}/../../dev/ixgbe : ${.CURDIR}/../../net KMOD = if_ringmap SRCS = device_if.h bus_if.h pci_if.h -SRCS += ixgbe.c $(RINGMAP_SRC) +SRCS += ixgbe.c # $(RINGMAP_SRC) -RINGMAP_SRC = ringmap.c ringmap_ixgbe.c +# RINGMAP_SRC = ringmap.c ringmap_ixgbe.c # Shared source SRCS += ixgbe_common.c ixgbe_api.c ixgbe_phy.c ==== //depot/projects/soc2010/ringmap/current/sys/net/ringmap.c#42 (text+ko) ==== @@ -79,11 +79,6 @@ return (-1); } - rm->funcs = rf; - - get_ringmap_p = rf->dev_to_ringmap; - get_device_p = rf->cdev_to_dev; - /* * Create char device for communication with user-space. The user-space * process wich want to capture packets should first open this device. @@ -96,6 +91,15 @@ rm->cdev = make_dev(&ringmap_devsw, device_get_unit(dev), UID_ROOT, GID_WHEEL, 0666, RINGMAP_DEVICE"%d", device_get_unit(dev)); + if (rm->cdev == NULL) { + RINGMAP_ERROR(Can not create char device); + return (-1); + } + + /* Set function pointers */ + rm->funcs = rf; + get_ringmap_p = rf->dev_to_ringmap; + get_device_p = rf->cdev_to_dev; /* Store adapters device structure */ rm->dev = dev; @@ -109,10 +113,6 @@ /* set the pointer to ringmap into the adapters structure */ rm->funcs->set_ringmap_to_adapter(dev, rm); -#if (__RINGMAP_DEB) - printf("Page Size: %d \n", PAGE_SIZE); -#endif - RINGMAP_FUNC_DEBUG(end); return (0); @@ -133,13 +133,15 @@ return (-1); } + /* Remove all capturing objects properly */ while (!SLIST_EMPTY(&rm->object_list)) { co = SLIST_FIRST(&rm->object_list); SLIST_REMOVE_HEAD(&rm->object_list, objects); clear_capt_object((void *)co); } - destroy_dev(rm->cdev); + if (rm->cdev != NULL) + destroy_dev(rm->cdev); RINGMAP_LOCK_DESTROY(rm); @@ -211,7 +213,7 @@ } /* - * create the capturing instance wich will represent + * create the capturing object wich will represent * current thread and packets ring */ MALLOC( co, struct capt_object *, @@ -238,10 +240,11 @@ err = EIO; goto out; } +#endif /* Init ring-slots with mbufs and packets adrresses */ for (i = 0 ; i < SLOTS_NUMBER ; i++){ - if (rm->funcs->set_slot(ring, co->que, i) == -1){ + if (rm->funcs->set_slot(co, i) == -1){ RINGMAP_ERROR(Ring initialization failed!); contigfree(ring, sizeof(struct ring), M_DEVBUF); @@ -251,7 +254,6 @@ PRINT_SLOT(ring, i); #endif } -#endif /* * Insert the capturing object in the single linked list ==== //depot/projects/soc2010/ringmap/current/sys/net/ringmap.h#42 (text+ko) ==== @@ -13,7 +13,7 @@ /* * Default queue number */ -#define DEFAULT_QUEUE 0 +#define DEFAULT_QUEUE 1 /* * Driver works only with device wich has the following device ID. If 0 ==== //depot/projects/soc2010/ringmap/current/sys/net/ringmap_kernel.h#12 (text+ko) ==== @@ -104,7 +104,7 @@ void (*sync_head)(void *); /* Initialize the ring slot */ - int (*set_slot)(struct ring *, void *, unsigned int); + int (*set_slot)(struct capt_object *, unsigned int); /* Associate the capturing objec with a hardware queue */ int (*set_queue)(struct capt_object *, unsigned int); ==== //depot/projects/soc2010/ringmap/scripts/build_ringmap.sh#24 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/scripts/set_ringmap.sh#25 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/scripts/tailf_ringmap_msgs.sh#19 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/stable_8/sys/dev/ixgbe/ixgbe.h#2 (text+ko) ==== @@ -124,6 +124,11 @@ #define MAX_RXD 4096 #define MIN_RXD 64 +//#define DEFAULT_RXD 64 +//#define PERFORM_RXD 64 +//#define MAX_RXD 64 +//#define MIN_RXD 64 + /* Alignment for rings */ #define DBA_ALIGN 128 ==== //depot/projects/soc2010/ringmap/tests/ringmap/close.c#11 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/tests/ringmap/ioctl.c#11 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/tests/ringmap/main.c#13 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/tests/ringmap/mmap.c#13 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/tests/ringmap/open.c#13 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/tests/ringmap/tests.h#11 (text+ko) ====