From owner-p4-projects Tue Nov 26 7:11:28 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E8D0537B401; Tue, 26 Nov 2002 07:11:17 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 91E0837B401 for ; Tue, 26 Nov 2002 07:11:17 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 133F743E88 for ; Tue, 26 Nov 2002 07:11:17 -0800 (PST) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id gAQF7hmV080704 for ; Tue, 26 Nov 2002 07:07:43 -0800 (PST) (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id gAQF7gVC080701 for perforce@freebsd.org; Tue, 26 Nov 2002 07:07:42 -0800 (PST) Date: Tue, 26 Nov 2002 07:07:42 -0800 (PST) Message-Id: <200211261507.gAQF7gVC080701@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin Subject: PERFORCE change 21528 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://perforce.freebsd.org/chv.cgi?CH=21528 Change 21528 by jhb@jhb_laptop on 2002/11/26 07:07:05 IFC. Affected files ... .. //depot/projects/smpng/sys/boot/common/help.common#5 integrate .. //depot/projects/smpng/sys/boot/common/loader.8#17 integrate .. //depot/projects/smpng/sys/boot/forth/loader.conf#15 integrate .. //depot/projects/smpng/sys/dev/acpica/acpi_pcib_acpi.c#4 integrate .. //depot/projects/smpng/sys/dev/em/if_em.c#14 integrate .. //depot/projects/smpng/sys/dev/pci/pci_pci.c#12 integrate .. //depot/projects/smpng/sys/vm/vm_map.c#24 integrate Differences ... ==== //depot/projects/smpng/sys/boot/common/help.common#5 (text+ko) ==== @@ -240,22 +240,6 @@ completely the value determined when the kernel was compiled. - set machdep.pccard.pcic_irq= - - Overrides the IRQ normally assigned to a PCCARD controller. - Typically the first available interrupt will be allocated, - which may conflict with other hardware. If this value is - set to 0, an interrupt will not be assigned and the - controller will operate in polled mode only. - - set machdep.bios.pnp=disable - - Disable the use of the PnP BIOS (i386 only) - - set machdep.bios.pci=disable - - Disable the use of the PCI BIOS (i386 only) - set machdep.disable_mtrrs=1 Disable the use of i686 MTRRs (i386 only) ==== //depot/projects/smpng/sys/boot/common/loader.8#17 (text+ko) ==== @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD: src/sys/boot/common/loader.8,v 1.49 2002/11/13 09:43:53 mdodd Exp $ +.\" $FreeBSD: src/sys/boot/common/loader.8,v 1.50 2002/11/26 13:55:50 yar Exp $ .\" .\" Note: The date here should be updated whenever a non-trivial .\" change is made to the manual page. @@ -487,13 +487,6 @@ .Va VM_BCACHE_SIZE_MAX . .It Va machdep.disable_mtrrs Disable the use of i686 MTRRs (x86 only). -.It Va machdep.pccard.pcic_irq -Overrides the IRQ normally assigned to a PCCARD controller. -Typically the first available interrupt will be allocated, -which may conflict with other hardware. -If this value is set to 0, -an interrupt will not be assigned -and the controller will operate in polled mode only. .It Va net.inet.tcp.tcbhashsize Overrides the compile-time set value of .Va TCBHASHSIZE ==== //depot/projects/smpng/sys/boot/forth/loader.conf#15 (text+ko) ==== @@ -6,7 +6,7 @@ # # All arguments must be in double quotes. # -# $FreeBSD: src/sys/boot/forth/loader.conf,v 1.67 2002/11/22 18:39:30 dcs Exp $ +# $FreeBSD: src/sys/boot/forth/loader.conf,v 1.68 2002/11/26 13:55:50 yar Exp $ ############################################################## ### Basic configuration options ############################ @@ -96,7 +96,6 @@ #kern.ipc.nmbufs="" # Set the maximum number of mbufs #kern.ipc.nsfbufs="" # Set the number of sendfile(2) bufs #kern.vm.kmem.size="" # Sets the size of kernel memory (bytes) -#machdep.pccard.pcic_irq="0" # Assigns PCCARD controller IRQ (0=polled) #net.inet.tcp.tcbhashsize="" # Set the value of TCBHASHSIZE #vfs.root.mountfrom="" # Specify root partition in a way the # kernel understands ==== //depot/projects/smpng/sys/dev/acpica/acpi_pcib_acpi.c#4 (text+ko) ==== @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/acpica/acpi_pcib_acpi.c,v 1.26 2002/11/22 18:11:13 jhb Exp $ + * $FreeBSD: src/sys/dev/acpica/acpi_pcib_acpi.c,v 1.27 2002/11/25 21:55:04 jhb Exp $ */ #include "opt_acpi.h" #include @@ -164,10 +164,10 @@ device_printf(dev, "could not evaluate _BBN - %s\n", AcpiFormatException(status)); return_VALUE(ENXIO); + } else { + /* if it's not found, assume 0 */ + sc->ap_bus = 0; } - } else { - /* if it's not found, assume 0 */ - sc->ap_bus = 0; } /* @@ -176,16 +176,15 @@ */ busok = 1; if (sc->ap_bus == 0 && devclass_get_device(pcib_devclass, 0) != dev) { + busok = 0; status = acpi_EvaluateInteger(sc->ap_handle, "_ADR", &addr); if (ACPI_FAILURE(status)) { if (status != AE_NOT_FOUND) { device_printf(dev, "could not evaluate _ADR - %s\n", AcpiFormatException(status)); return_VALUE(ENXIO); - } else { + } else device_printf(dev, "could not determine config space address\n"); - busok = 0; - } } else { /* XXX: We assume bus 0. */ slot = addr >> 16; @@ -193,11 +192,11 @@ if (bootverbose) device_printf(dev, "reading config registers from 0:%d:%d\n", slot, func); - if (host_pcib_get_busno(pci_cfgregread, 0, slot, func, &busno) == 0) { + if (host_pcib_get_busno(pci_cfgregread, 0, slot, func, &busno) == 0) device_printf(dev, "could not read bus number from config space\n"); - busok = 0; - } else { + else { sc->ap_bus = busno; + busok = 1; } } } ==== //depot/projects/smpng/sys/dev/em/if_em.c#14 (text+ko) ==== @@ -31,7 +31,7 @@ ***************************************************************************/ -/*$FreeBSD: src/sys/dev/em/if_em.c,v 1.14 2002/11/14 23:54:50 sam Exp $*/ +/*$FreeBSD: src/sys/dev/em/if_em.c,v 1.16 2002/11/25 20:00:13 luigi Exp $*/ #include @@ -127,7 +127,7 @@ static void em_clean_transmit_interrupts(struct adapter *); static int em_allocate_receive_structures(struct adapter *); static int em_allocate_transmit_structures(struct adapter *); -static void em_process_receive_interrupts(struct adapter *); +static void em_process_receive_interrupts(struct adapter *, int); static void em_receive_checksum(struct adapter *, struct em_rx_desc * rx_desc, struct mbuf *); @@ -529,14 +529,14 @@ case SIOCSIFFLAGS: IOCTL_DEBUGOUT("ioctl rcv'd: SIOCSIFFLAGS (Set Interface Flags)"); if (ifp->if_flags & IFF_UP) { - if (ifp->if_flags & IFF_RUNNING && - ifp->if_flags & IFF_PROMISC) { - em_set_promisc(adapter); - } else if (ifp->if_flags & IFF_RUNNING && - !(ifp->if_flags & IFF_PROMISC)) { - em_disable_promisc(adapter); - } else + /* + * init adapter if not running, then take care + * of possible changes in IFF_ALLMULTI and IFF_PROMISC + */ + if (!(ifp->if_flags & IFF_RUNNING)) em_init(adapter); + em_disable_promisc(adapter); + em_set_promisc(adapter); } else { if (ifp->if_flags & IFF_RUNNING) { em_stop(adapter); @@ -682,12 +682,55 @@ adapter->timer_handle = timeout(em_local_timer, adapter, 2*hz); em_clear_hw_cntrs(&adapter->hw); +#ifdef DEVICE_POLLING + /* + * Only enable interrupts if we are not polling, make sure + * they are off otherwise. + */ + if (ifp->if_ipending & IFF_POLLING) + em_disable_intr(adapter); + else +#endif /* DEVICE_POLLING */ em_enable_intr(adapter); splx(s); return; } +#ifdef DEVICE_POLLING +static poll_handler_t em_poll; + +static void +em_poll(struct ifnet *ifp, enum poll_cmd cmd, int count) +{ + struct adapter *adapter = ifp->if_softc; + + if (cmd == POLL_DEREGISTER) { /* final call, enable interrupts */ + em_enable_intr(adapter); + return; + } + if (cmd == POLL_AND_CHECK_STATUS) { + u_int32_t reg_icr = E1000_READ_REG(&adapter->hw, ICR); + + if (reg_icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) { + untimeout(em_local_timer, adapter, + adapter->timer_handle); + adapter->hw.get_link_status = 1; + em_check_for_link(&adapter->hw); + em_print_link_status(adapter); + adapter->timer_handle = timeout(em_local_timer, + adapter, 2*hz); + } + } + if (ifp->if_flags & IFF_RUNNING) { + em_process_receive_interrupts(adapter, count); + em_clean_transmit_interrupts(adapter); + } + if (ifp->if_flags & IFF_RUNNING && ifp->if_snd.ifq_head != NULL) + em_start(ifp); +} +#endif /* DEVICE_POLLING */ + /********************************************************************* * * Interrupt Service routine @@ -704,6 +747,17 @@ ifp = &adapter->interface_data.ac_if; +#ifdef DEVICE_POLLING + if (ifp->if_ipending & IFF_POLLING) + return; + + if (ether_poll_register(em_poll, ifp)) { + em_disable_intr(adapter); + em_poll(ifp, 0, 1); + return; + } +#endif /* DEVICE_POLLING */ + em_disable_intr(adapter); while (loop_cnt > 0 && (reg_icr = E1000_READ_REG(&adapter->hw, ICR)) != 0) { @@ -720,7 +774,7 @@ } if (ifp->if_flags & IFF_RUNNING) { - em_process_receive_interrupts(adapter); + em_process_receive_interrupts(adapter, -1); em_clean_transmit_interrupts(adapter); } loop_cnt--; @@ -1993,7 +2047,7 @@ * *********************************************************************/ static void -em_process_receive_interrupts(struct adapter * adapter) +em_process_receive_interrupts(struct adapter * adapter, int count) { struct mbuf *mp; struct ifnet *ifp; @@ -2018,7 +2072,7 @@ return; } - while (current_desc->status & E1000_RXD_STAT_DD) { + while ((current_desc->status & E1000_RXD_STAT_DD) && (count != 0)) { /* Get a pointer to the actual receive buffer */ rx_buffer = STAILQ_FIRST(&adapter->rx_buffer_list); @@ -2032,6 +2086,7 @@ accept_frame = 1; if (current_desc->status & E1000_RXD_STAT_EOP) { + count--; eop = 1; len = current_desc->length - ETHER_CRC_LEN; } else { ==== //depot/projects/smpng/sys/dev/pci/pci_pci.c#12 (text+ko) ==== @@ -27,7 +27,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/pci/pci_pci.c,v 1.20 2002/11/22 17:50:47 jhb Exp $ + * $FreeBSD: src/sys/dev/pci/pci_pci.c,v 1.21 2002/11/25 21:53:14 jhb Exp $ */ /* @@ -457,7 +457,7 @@ u_int32_t id; id = read_config(bus, slot, func, PCIR_DEVVENDOR, 4); - if (id == 0xffff) + if (id == 0xffffffff) return (0); switch (id) { @@ -488,19 +488,19 @@ switch (slot) { case 0x12: /* Intel 82454NX PXB#0, Bus#A */ - *busnum = read_config(bus, 0, func, 0xd0, 1); + *busnum = read_config(bus, 0x10, func, 0xd0, 1); break; case 0x13: /* Intel 82454NX PXB#0, Bus#B */ - *busnum = read_config(bus, 0, func, 0xd1, 1) + 1; + *busnum = read_config(bus, 0x10, func, 0xd1, 1) + 1; break; case 0x14: /* Intel 82454NX PXB#1, Bus#A */ - *busnum = read_config(bus, 0, func, 0xd3, 1); + *busnum = read_config(bus, 0x10, func, 0xd3, 1); break; case 0x15: /* Intel 82454NX PXB#1, Bus#B */ - *busnum = read_config(bus, 0, func, 0xd4, 1) + 1; + *busnum = read_config(bus, 0x10, func, 0xd4, 1) + 1; break; } break; ==== //depot/projects/smpng/sys/vm/vm_map.c#24 (text+ko) ==== @@ -61,7 +61,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $FreeBSD: src/sys/vm/vm_map.c,v 1.271 2002/11/09 21:26:49 alc Exp $ + * $FreeBSD: src/sys/vm/vm_map.c,v 1.272 2002/11/25 22:00:31 alc Exp $ */ /* @@ -1284,12 +1284,14 @@ */ if (current->protection != old_prot) { mtx_lock(&Giant); + vm_page_lock_queues(); #define MASK(entry) (((entry)->eflags & MAP_ENTRY_COW) ? ~VM_PROT_WRITE : \ VM_PROT_ALL) pmap_protect(map->pmap, current->start, current->end, current->protection & MASK(current)); #undef MASK + vm_page_unlock_queues(); mtx_unlock(&Giant); } vm_map_simplify_entry(map, current); @@ -2197,10 +2199,12 @@ * write-protected. */ if ((src_entry->eflags & MAP_ENTRY_NEEDS_COPY) == 0) { + vm_page_lock_queues(); pmap_protect(src_map->pmap, src_entry->start, src_entry->end, src_entry->protection & ~VM_PROT_WRITE); + vm_page_unlock_queues(); } /* To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message