From owner-p4-projects@FreeBSD.ORG Mon Jun 14 16:32:45 2010 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id F2DB41065675; Mon, 14 Jun 2010 16:32:44 +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 B6D1A1065679 for ; Mon, 14 Jun 2010 16:32:44 +0000 (UTC) (envelope-from afiveg@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id A437C8FC1A for ; Mon, 14 Jun 2010 16:32:44 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id o5EGWihF038869 for ; Mon, 14 Jun 2010 16:32:44 GMT (envelope-from afiveg@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id o5EGWiwQ038867 for perforce@freebsd.org; Mon, 14 Jun 2010 16:32:44 GMT (envelope-from afiveg@FreeBSD.org) Date: Mon, 14 Jun 2010 16:32:44 GMT Message-Id: <201006141632.o5EGWiwQ038867@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to afiveg@FreeBSD.org using -f From: Alexandre Fiveg To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 179605 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: Mon, 14 Jun 2010 16:32:45 -0000 http://p4web.freebsd.org/@@179605?ac=10 Change 179605 by afiveg@cottonmouth on 2010/06/14 16:31:50 not important fixes: refresh e1000 Affected files ... .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/LICENSE#2 integrate .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/README#2 integrate .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_80003es2lan.c#2 integrate .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_80003es2lan.h#2 integrate .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_82540.c#2 integrate .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_82541.c#2 integrate .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_82541.h#2 integrate .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_82542.c#2 integrate .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_82543.c#2 integrate .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_82543.h#2 integrate .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_82571.c#2 integrate .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_82571.h#2 integrate .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_82575.c#2 integrate .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_82575.h#2 integrate .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_api.c#2 integrate .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_api.h#2 integrate .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_defines.h#2 integrate .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_hw.h#2 integrate .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_ich8lan.c#2 integrate .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_ich8lan.h#2 integrate .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_mac.c#2 integrate .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_mac.h#2 integrate .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_manage.c#2 integrate .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_manage.h#2 integrate .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_nvm.c#2 integrate .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_nvm.h#2 integrate .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_osdep.c#2 integrate .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_osdep.h#2 integrate .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_phy.c#2 integrate .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_phy.h#2 integrate .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_regs.h#2 integrate .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/if_em.c#4 integrate .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/if_em.h#4 integrate .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/if_igb.c#3 integrate .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/if_igb.h#2 integrate .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/if_lem.c#2 integrate .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/if_lem.h#2 integrate Differences ... ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/LICENSE#2 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/README#2 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_80003es2lan.c#2 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_80003es2lan.h#2 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_82540.c#2 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_82541.c#2 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_82541.h#2 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_82542.c#2 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_82543.c#2 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_82543.h#2 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_82571.c#2 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_82571.h#2 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_82575.c#2 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_82575.h#2 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_api.c#2 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_api.h#2 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_defines.h#2 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_hw.h#2 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_ich8lan.c#2 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_ich8lan.h#2 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_mac.c#2 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_mac.h#2 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_manage.c#2 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_manage.h#2 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_nvm.c#2 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_nvm.h#2 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_osdep.c#2 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_osdep.h#2 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_phy.c#2 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_phy.h#2 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/e1000_regs.h#2 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/if_em.c#4 (text+ko) ==== @@ -81,11 +81,6 @@ #include #include -#ifdef __RINGMAP__ -#include -#endif - - #include "e1000_api.h" #include "e1000_82571.h" #include "if_em.h" @@ -100,6 +95,7 @@ *********************************************************************/ char em_driver_version[] = "7.0.5"; + /********************************************************************* * PCI Device ID Table * @@ -195,13 +191,7 @@ static int em_suspend(device_t); static int em_resume(device_t); static void em_start(struct ifnet *); - -#ifndef __RINGMAP__ static void em_start_locked(struct ifnet *, struct tx_ring *); -#else -void em_start_locked(struct ifnet *, struct tx_ring *); -#endif - #ifdef EM_MULTIQUEUE static int em_mq_start(struct ifnet *, struct mbuf *); static int em_mq_start_locked(struct ifnet *, @@ -240,15 +230,8 @@ static void em_enable_intr(struct adapter *); static void em_disable_intr(struct adapter *); static void em_update_stats_counters(struct adapter *); - -#ifndef __RINGMAP__ static bool em_txeof(struct tx_ring *); static int em_rxeof(struct rx_ring *, int); -#else -int em_rxeof(struct rx_ring *, int); -bool em_txeof(struct tx_ring *); -#endif - #ifndef __NO_STRICT_ALIGNMENT static int em_fixup_rx(struct rx_ring *); #endif @@ -269,13 +252,7 @@ static int em_dma_malloc(struct adapter *, bus_size_t, struct em_dma_alloc *, int); static void em_dma_free(struct adapter *, struct em_dma_alloc *); - -#ifndef __RINGMAP__ static void em_print_debug_info(struct adapter *); -#else -void em_print_debug_info(struct adapter *); -#endif - static void em_print_nvm_info(struct adapter *); static int em_is_valid_ether_addr(u8 *); static int em_sysctl_stats(SYSCTL_HANDLER_ARGS); @@ -310,16 +287,6 @@ static poll_handler_t em_poll; #endif /* POLLING */ - -#ifdef __RINGMAP__ -extern int ringmap_attach(struct adapter *); -extern int ringmap_detach(struct adapter *); -extern int ringmap_print_ring_pointers(struct adapter *); -extern void ringmap_handle_que(void *context, int pending); -#endif - - - /********************************************************************* * FreeBSD Device Interface Entry Points *********************************************************************/ @@ -335,29 +302,14 @@ {0, 0} }; -#ifndef __RINGMAP__ static driver_t em_driver = { "em", em_methods, sizeof(struct adapter), }; -#else -static driver_t em_driver = { - "ringmap", em_methods, sizeof(struct adapter), -}; -#endif - devclass_t em_devclass; - - -#ifndef __RINGMAP__ DRIVER_MODULE(em, pci, em_driver, em_devclass, 0, 0); MODULE_DEPEND(em, pci, 1, 1, 1); MODULE_DEPEND(em, ether, 1, 1, 1); -#else -DRIVER_MODULE(ringmap, pci, em_driver, em_devclass, 0, 0); -MODULE_DEPEND(ringmap, pci, 1, 1, 1); -MODULE_DEPEND(ringmap, ether, 1, 1, 1); -#endif /********************************************************************* * Tunable default values. @@ -453,37 +405,6 @@ pci_subvendor_id = pci_get_subvendor(dev); pci_subdevice_id = pci_get_subdevice(dev); -//TODO: Fix it. Dirty implemented -#ifdef __RINGMAP__ - if (DEV_ID) { - if (pci_device_id == DEV_ID) - return 0; - else - return 1; - } else { - - ent = em_vendor_info_array; - while (ent->vendor_id != 0) { - if ((pci_vendor_id == ent->vendor_id) && - (pci_device_id == ent->device_id) && - - ((pci_subvendor_id == ent->subvendor_id) || - (ent->subvendor_id == PCI_ANY_ID)) && - - ((pci_subdevice_id == ent->subdevice_id) || - (ent->subdevice_id == PCI_ANY_ID))) { - sprintf(adapter_name, "%s %s", - em_strings[ent->index], - em_driver_version); - device_set_desc_copy(dev, adapter_name); - RINGMAP_FUNC_DEBUG(Supported device found!); - return (BUS_PROBE_DEFAULT); - } - ent++; - } - RINGMAP_FUNC_DEBUG(Probe failed!); - } -#else ent = em_vendor_info_array; while (ent->vendor_id != 0) { if ((pci_vendor_id == ent->vendor_id) && @@ -502,7 +423,7 @@ } ent++; } -#endif + return (ENXIO); } @@ -745,23 +666,6 @@ adapter->led_dev = led_create(em_led_func, adapter, device_get_nameunit(dev)); - - -#ifdef __RINGMAP__ - if (ringmap_attach(adapter) < 0) - return (EIO); - -#if (__RINGMAP_DEB) - printf("\n\n[%s] DEBUG INFO FOR INTERFACE %s\n", __func__, device_get_nameunit(dev)); - printf("=============================================================\n\n"); - em_print_debug_info(adapter); - printf("\n=============================================================\n\n"); - INIT_DEBUGOUT2("[%s]:%s END.",__func__, device_get_nameunit(dev)); -#endif - -#endif /* __RINGMAP__ */ - - INIT_DEBUGOUT("em_attach: end"); return (0); @@ -795,22 +699,6 @@ INIT_DEBUGOUT("em_detach: begin"); - -#ifdef __RINGMAP__ - ringmap_detach(adapter); - -#if (__RINGMAP_DEB) - printf("\n\n[%s] DEBUG INFO FOR INTERFACE %s\n", __func__, device_get_nameunit(dev)); - printf("=============================================================\n\n"); - em_print_debug_info(adapter); - printf("\n=============================================================\n\n"); - INIT_DEBUGOUT2("[%s]:%s END.",__func__, device_get_nameunit(dev)); -#endif - -#endif - - - /* Make sure VLANS are not using driver */ if (adapter->ifp->if_vlantrunk != NULL) { device_printf(dev,"Vlan in use, detach first\n"); @@ -1019,11 +907,7 @@ #endif /* EM_MULTIQUEUE */ -#ifndef __RINGMAP__ static void -#else -void -#endif em_start_locked(struct ifnet *ifp, struct tx_ring *txr) { struct adapter *adapter = ifp->if_softc; @@ -1543,20 +1427,6 @@ return FILTER_STRAY; em_disable_intr(adapter); - - -#ifdef __RINGMAP__ - /* Print it if interrupt debugging is enabled */ - RINGMAP_INTR(NOW SET rxtx_task IN QUEUE); - - /* Count interuppts. (for statistics) */ - adapter->rm->ring->interrupts_counter++; - - /* Compute the time stamp */ - getmicrotime(&adapter->intr_ts); -#endif - - taskqueue_enqueue(adapter->tq, &adapter->que_task); /* Link status change */ @@ -1570,7 +1440,6 @@ return FILTER_HANDLED; } -#ifndef __RINGMAP__ /* Combined RX/TX handler, used by Legacy and MSI */ static void em_handle_que(void *context, int pending) @@ -1604,7 +1473,6 @@ em_enable_intr(adapter); return; } -#endif /********************************************************************* @@ -2417,7 +2285,6 @@ device_t dev = adapter->dev; int error, rid = 0; - /* Manually turn off all interrupts */ E1000_WRITE_REG(&adapter->hw, E1000_IMC, 0xffffffff); @@ -2436,12 +2303,7 @@ * Allocate a fast interrupt and the associated * deferred processing contexts. */ -#ifndef __RINGMAP__ TASK_INIT(&adapter->que_task, 0, em_handle_que, adapter); -#else - TASK_INIT(&adapter->que_task, 0, ringmap_handle_que, adapter); -#endif - TASK_INIT(&adapter->link_task, 0, em_handle_link, adapter); adapter->tq = taskqueue_create_fast("em_taskq", M_NOWAIT, taskqueue_thread_enqueue, &adapter->tq); @@ -3703,11 +3565,7 @@ * tx_buffer is put back on the free queue. * **********************************************************************/ -#ifndef __RINGMAP__ static bool -#else -bool -#endif em_txeof(struct tx_ring *txr) { struct adapter *adapter = txr->adapter; @@ -4190,11 +4048,7 @@ E1000_WRITE_REG(hw, E1000_RDBAL(i), (u32)bus_addr); /* Setup the Head and Tail Descriptor Pointers */ E1000_WRITE_REG(hw, E1000_RDH(i), 0); -#ifndef __RINGMAP__ - E1000_WRITE_REG(hw, E1000_RDT(i), adapter->num_rx_desc - 1); -#else - E1000_WRITE_REG(hw, E1000_RDT(i), adapter->num_rx_desc - RING_SAFETY_MARGIN); -#endif + E1000_WRITE_REG(hw, E1000_RDT(i), adapter->num_rx_desc - 1); } /* Setup the Receive Control Register */ @@ -4233,11 +4087,7 @@ * * For polling we also now return the number of cleaned packets *********************************************************************/ -#ifndef __RINGMAP__ static int -#else -int -#endif em_rxeof(struct rx_ring *rxr, int count) { struct adapter *adapter = rxr->adapter; @@ -4249,28 +4099,6 @@ bool eop; struct e1000_rx_desc *cur; - -#ifdef __RINGMAP__ - struct ringmap *rm = adapter->rm; - - RINGMAP_INTR(start); - - /* Set RDT (user pointer aka. TAIL) */ - if (rm->procp != NULL) { - SET_RDT(adapter); - } - else { - RINGMAP_WARN("No process want capture!"); - } - - /* Print dubugging info if INTR_DEB set */ -#if (INTR_DEB) - printf("[%s] Print Ring Pointers\n", __func__); - ringmap_print_ring_pointers(adapter); -#endif -#endif /* __RINGMAP__ */ - - EM_RX_LOCK(rxr); for (i = rxr->next_to_check, processed = 0; count != 0;) { @@ -4288,7 +4116,6 @@ if ((status & E1000_RXD_STAT_DD) == 0) break; - len = le16toh(cur->length); eop = (status & E1000_RXD_STAT_EOP) != 0; count--; @@ -4361,11 +4188,6 @@ ++rxdone; /* cumulative for POLL */ ++processed; -#ifdef __RINGMAP__ - /* Time stamp */ - rm->ring->slot[i].ts = adapter->intr_ts; -#endif - /* Advance our pointers to the next descriptor. */ if (++i == adapter->num_rx_desc) i = 0; @@ -4373,43 +4195,17 @@ /* Send to the stack */ if (sendmp != NULL) { rxr->next_to_check = i; - -#ifndef __RINGMAP__ -/* ****************************************************** - * We dont want to do now with protocol stack We want - * only to map mbufs, pkts and descriptors into space of - * user process. - * ******************************************************/ - EM_RX_UNLOCK(rxr); (*ifp->if_input)(ifp, sendmp); EM_RX_LOCK(rxr); - -#else - /* Set kern pointer in ring structure */ - rm->ring->kernrp = rxr->next_to_check; - rm->pkts_counter++; -#endif - - i = rxr->next_to_check; } -/* - * RINGMAP: I don't whether we need to refrash mbufs. Refreshing - * causes memory allocation - it is expensive in term of CPU cycles. - * Probably we can use old mbufs ??? - */ /* Only refresh mbufs every 8 descriptors */ if (processed == 8) { em_refresh_mbufs(rxr, i); processed = 0; } - -#ifndef __RINGMAP__ - E1000_WRITE_REG(&adapter->hw, E1000_RDT(0), i); -#endif - } /* Catch any remaining refresh work */ @@ -5083,11 +4879,7 @@ * maintained by the driver and hardware. * **********************************************************************/ -#ifndef __RINGMAP__ static void -#else -void -#endif em_print_debug_info(struct adapter *adapter) { device_t dev = adapter->dev; ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/if_em.h#4 (text+ko) ==== @@ -69,15 +69,8 @@ * (num_tx_desc * sizeof(struct e1000_tx_desc)) % 128 == 0 */ #define EM_MIN_RXD 80 - -#ifndef __RINGMAP__ #define EM_MAX_RXD 4096 #define EM_DEFAULT_RXD 1024 -#else -#define EM_MAX_RXD SLOTS_NUMBER -#define EM_DEFAULT_RXD SLOTS_NUMBER -#endif - /* * EM_TIDV - Transmit Interrupt Delay Value @@ -216,7 +209,7 @@ #define EM_MSIX_BAR 3 /* On 82575 */ /* Defines for printing debug information */ -#define DEBUG_INIT 1 +#define DEBUG_INIT 0 #define DEBUG_IOCTL 0 #define DEBUG_HW 0 @@ -419,11 +412,6 @@ unsigned long link_irq; struct e1000_hw_stats stats; - -#ifdef __RINGMAP__ - struct ringmap *rm; - struct timeval intr_ts; -#endif }; /******************************************************************************** ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/if_igb.c#3 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/if_igb.h#2 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/if_lem.c#2 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/if_lem.h#2 (text+ko) ====