From owner-p4-projects@FreeBSD.ORG Thu Aug 12 12:26:50 2010 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1900C10656A4; Thu, 12 Aug 2010 12:26:50 +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 CF3F11065697 for ; Thu, 12 Aug 2010 12:26:49 +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 BAE648FC1C for ; Thu, 12 Aug 2010 12:26:49 +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 o7CCQnbA018340 for ; Thu, 12 Aug 2010 12:26:49 GMT (envelope-from afiveg@FreeBSD.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id o7CCQnfR018337 for perforce@freebsd.org; Thu, 12 Aug 2010 12:26:49 GMT (envelope-from afiveg@FreeBSD.org) Date: Thu, 12 Aug 2010 12:26:49 GMT Message-Id: <201008121226.o7CCQnfR018337@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 182314 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: Thu, 12 Aug 2010 12:26:50 -0000 http://p4web.freebsd.org/@@182314?ac=10 Change 182314 by afiveg@cottonmouth on 2010/08/12 12:26:00 removed enable_-, disable_intr() functions for enabling/disabling interrupts. I think those functionalities was superfluous for ringmap. If we want to stop interrupts or packet receive it should be done by means of generic driver. The names of interfaces have from now its generic names (em, ix, etc..) - as earlier. In the previously ringmap versions they all called ringmap[0-9] - it was for debugging goals. The char devices (in /dev/) for communication with ringmap have same names as the network interfaces. Affected files ... .. //depot/projects/soc2010/ringmap/current/contrib/libpcap/pcap-bpf.c#16 edit .. //depot/projects/soc2010/ringmap/current/contrib/libpcap/pcap-int.h#16 edit .. //depot/projects/soc2010/ringmap/current/contrib/libpcap/pcap.c#19 edit .. //depot/projects/soc2010/ringmap/current/contrib/libpcap/ringmap_pcap.c#31 edit .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/if_lem.c#32 edit .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/ringmap_8254.c#31 edit .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/ringmap_8254.h#29 edit .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/ringmap_e1000.h#21 edit .. //depot/projects/soc2010/ringmap/current/sys/dev/ixgbe/ringmap_8259.h#14 edit .. //depot/projects/soc2010/ringmap/current/sys/dev/ixgbe/ringmap_ixgbe.c#15 edit .. //depot/projects/soc2010/ringmap/current/sys/net/ringmap.c#45 edit .. //depot/projects/soc2010/ringmap/current/sys/net/ringmap.h#45 edit .. //depot/projects/soc2010/ringmap/current/sys/net/ringmap_kernel.h#15 edit .. //depot/projects/soc2010/ringmap/scripts/build_ringmap.sh#27 edit .. //depot/projects/soc2010/ringmap/scripts/set_ringmap.sh#28 edit .. //depot/projects/soc2010/ringmap/scripts/tailf_ringmap_msgs.sh#22 edit .. //depot/projects/soc2010/ringmap/tests/libpcap/easy_pcap.c#13 edit Differences ... ==== //depot/projects/soc2010/ringmap/current/contrib/libpcap/pcap-bpf.c#16 (text+ko) ==== @@ -1143,8 +1143,6 @@ #endif #ifdef RINGMAP - RINGMAP_FUNC_DEBUG(start); - uninit_mmapped_capturing(p); #endif if (p->md.must_clear != 0) { @@ -1342,9 +1340,6 @@ struct bpf_program total_prog; struct utsname osinfo; -#ifdef RINGMAP - RINGMAP_FUNC_DEBUG (start); -#endif #ifdef HAVE_DAG_API if (strstr(device, "dag")) { @@ -1365,9 +1360,6 @@ status = fd; goto bad; } -#ifdef RINGMAP - RINGMAP_FUNC_DEBUG(BPF device is opened); -#endif p->fd = fd; @@ -1487,10 +1479,6 @@ #endif /* __APPLE__ */ #ifdef HAVE_ZEROCOPY_BPF -#ifdef RINGMAP - /* only for debug goals */ - RINGMAP_FUNC_DEBUG(have zerocopy BPF); -#endif /* * If the BPF extension to set buffer mode is present, try setting * the mode to zero-copy. If that fails, use regular buffering. If @@ -2093,9 +2081,6 @@ p->stats_op = pcap_stats_bpf; p->cleanup_op = pcap_cleanup_bpf; -#ifdef RINGMAP - RINGMAP_FUNC_DEBUG(end: Ok); -#endif return (status); bad: #ifdef RINGMAP ==== //depot/projects/soc2010/ringmap/current/contrib/libpcap/pcap-int.h#16 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/contrib/libpcap/pcap.c#19 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/contrib/libpcap/ringmap_pcap.c#31 (text+ko) ==== @@ -50,7 +50,7 @@ RINGMAP_FUNC_DEBUG(start); - sprintf(dev_path, "/dev/%s",device); + sprintf(dev_path, "/dev/%s", device); /* Open /dev/ringmap device for communication with our driver */ if ((ringmap_cdev_fd = open(dev_path, O_RDWR)) == -1) { ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/if_lem.c#32 (text+ko) ==== @@ -194,13 +194,8 @@ static void lem_initialize_transmit_unit(struct adapter *); static int lem_setup_receive_structures(struct adapter *); static void lem_initialize_receive_unit(struct adapter *); -#ifndef RINGMAP static void lem_enable_intr(struct adapter *); static void lem_disable_intr(struct adapter *); -#else -void lem_enable_intr(struct adapter *); -void lem_disable_intr(struct adapter *); -#endif static void lem_free_transmit_structures(struct adapter *); static void lem_free_receive_structures(struct adapter *); static void lem_update_stats_counters(struct adapter *); @@ -298,23 +293,13 @@ }; static driver_t lem_driver = { -#ifndef RINGMAP "em", lem_methods, sizeof(struct adapter), -#else - "ringmap", lem_methods, sizeof(struct adapter), -#endif }; extern devclass_t em_devclass; -#ifndef RINGMAP DRIVER_MODULE(lem, pci, lem_driver, em_devclass, 0, 0); MODULE_DEPEND(lem, pci, 1, 1, 1); MODULE_DEPEND(lem, ether, 1, 1, 1); -#else -DRIVER_MODULE(ringmap, pci, lem_driver, em_devclass, 0, 0); -MODULE_DEPEND(ringmap, pci, 1, 1, 1); -MODULE_DEPEND(ringmap, ether, 1, 1, 1); -#endif /********************************************************************* * Tunable default values. @@ -3891,10 +3876,7 @@ } #endif -#ifndef RINGMAP -static -#endif -void +static void lem_enable_intr(struct adapter *adapter) { struct e1000_hw *hw = &adapter->hw; @@ -3907,10 +3889,7 @@ E1000_WRITE_REG(hw, E1000_IMS, ims_mask); } -#ifndef RINGMAP -static -#endif -void +static void lem_disable_intr(struct adapter *adapter) { struct e1000_hw *hw = &adapter->hw; ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/ringmap_8254.c#31 (text+ko) ==== @@ -20,8 +20,6 @@ struct ringmap * rm_8254_get_ringmap_p(device_t); device_t rm_8254_get_device_p(struct cdev *); -void rm_8254_enable_intr(device_t); -void rm_8254_disable_intr(device_t); int rm_8254_set_slot(struct capt_object *, unsigned int); void rm_8254_interrupt(void *); void rm_8254_delayed_interrupt(void *); @@ -33,15 +31,11 @@ int rm_8254_set_queue(struct capt_object *, unsigned int); extern devclass_t em_devclass; -extern void lem_enable_intr(struct adapter *); -extern void lem_disable_intr(struct adapter *); extern void ringmap_print_slot(struct ring *, unsigned int); extern void print_capt_obj(struct capt_object *); struct ringmap_functions ringmap_8254_f = { - rm_8254_enable_intr, - rm_8254_disable_intr, rm_8254_interrupt, rm_8254_delayed_interrupt, rm_8254_delayed_interrupt_per_packet, @@ -236,34 +230,6 @@ /* - * Disable interrupts on adapter - */ -void -rm_8254_disable_intr(device_t dev) -{ - struct adapter *adapter; - adapter = (struct adapter *)device_get_softc(dev); - - /*Use function implemeted in native (em) driver */ - lem_disable_intr(adapter); -} - - -/* - * Enable interrupts on adapter - */ -void -rm_8254_enable_intr(device_t dev) -{ - struct adapter *adapter; - adapter = (struct adapter *)device_get_softc(dev); - - /*Use function implemeted in native (em) driver */ - lem_enable_intr(adapter); -} - - -/* * Get pointer to device structure of adapter using our ringmap char device. * This is a trick. Our cdev must have the same unit number as dev of adapter. * Look in ringmap.c: ringmap_attach() where we create our cdev. @@ -322,6 +288,7 @@ } +/* 8254x controllers have not multiqueue support: que = NULL */ int rm_8254_set_queue(struct capt_object *co, unsigned int i) { ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/ringmap_8254.h#29 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/ringmap_e1000.h#21 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/ixgbe/ringmap_8259.h#14 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/ixgbe/ringmap_ixgbe.c#15 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/net/ringmap.c#45 (text+ko) ==== @@ -94,7 +94,7 @@ */ rm->cdev = make_dev(&ringmap_devsw, device_get_unit(dev), UID_ROOT, GID_WHEEL, 0666, - RINGMAP_DEVICE"%d", device_get_unit(dev)); + device_get_nameunit(dev)); if (rm->cdev == NULL) { RINGMAP_ERROR(Can not create char device); contigfree(rm, sizeof(struct ringmap), M_DEVBUF); @@ -466,18 +466,6 @@ switch( cmd ){ - /* Enable Interrupts */ - case IOCTL_ENABLE_INTR: - rm->funcs->enable_intr(rm->dev); - RINGMAP_IOCTL(interrupts schould be enabled); - break; - - /* Disable Interrupts */ - case IOCTL_DISABLE_INTR: - rm->funcs->disable_intr(rm->dev); - RINGMAP_IOCTL(interrupts schould be disabled); - break; - /* Sleep and wait for new packets */ case IOCTL_SLEEP_WAIT: ==== //depot/projects/soc2010/ringmap/current/sys/net/ringmap.h#45 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/net/ringmap_kernel.h#15 (text+ko) ==== @@ -47,13 +47,6 @@ struct ringmap_functions { /* - * In some situations it is safe to disable - * interrupts on adapter. - */ - void (*enable_intr)(device_t); - void (*disable_intr)(device_t); - - /* * This function should be calld from ISR. It should contain * the very fast executable operations (don't sleep!). */ ==== //depot/projects/soc2010/ringmap/scripts/build_ringmap.sh#27 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/scripts/set_ringmap.sh#28 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/scripts/tailf_ringmap_msgs.sh#22 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/tests/libpcap/easy_pcap.c#13 (text+ko) ====