From owner-p4-projects@FreeBSD.ORG Fri Mar 21 01:08:27 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 408561065670; Fri, 21 Mar 2008 01:08:27 +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 F32C11065679 for ; Fri, 21 Mar 2008 01:08:26 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id DB64E8FC3B for ; Fri, 21 Mar 2008 01:08:26 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m2L18Q9e070689 for ; Fri, 21 Mar 2008 01:08:26 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m2L18Q6j070687 for perforce@freebsd.org; Fri, 21 Mar 2008 01:08:26 GMT (envelope-from imp@freebsd.org) Date: Fri, 21 Mar 2008 01:08:26 GMT Message-Id: <200803210108.m2L18Q6j070687@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 138222 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Mar 2008 01:08:27 -0000 http://perforce.freebsd.org/chv.cgi?CH=138222 Change 138222 by imp@imp_paco-paco on 2008/03/21 01:07:27 IFC @138221 Affected files ... .. //depot/projects/arm/src/sys/amd64/amd64/nexus.c#14 integrate .. //depot/projects/arm/src/sys/amd64/isa/atpic.c#9 integrate .. //depot/projects/arm/src/sys/arm/conf/AVILA#19 integrate .. //depot/projects/arm/src/sys/compat/linux/linux_futex.c#9 integrate .. //depot/projects/arm/src/sys/compat/linux/linux_futex.h#3 integrate .. //depot/projects/arm/src/sys/dev/aac/aac.c#10 integrate .. //depot/projects/arm/src/sys/dev/ata/ata-raid.c#17 integrate .. //depot/projects/arm/src/sys/dev/cxgb/cxgb_main.c#14 integrate .. //depot/projects/arm/src/sys/dev/cxgb/cxgb_sge.c#13 integrate .. //depot/projects/arm/src/sys/i386/i386/nexus.c#13 integrate .. //depot/projects/arm/src/sys/i386/isa/atpic.c#9 integrate .. //depot/projects/arm/src/sys/kern/bus_if.m#9 integrate .. //depot/projects/arm/src/sys/kern/subr_bus.c#25 integrate .. //depot/projects/arm/src/sys/sys/aac_ioctl.h#2 integrate .. //depot/projects/arm/src/sys/sys/bus.h#13 integrate .. //depot/projects/arm/src/tools/tools/tinybsd/tinybsd#7 integrate .. //depot/projects/mips2/src/sys/amd64/amd64/nexus.c#6 integrate .. //depot/projects/mips2/src/sys/amd64/isa/atpic.c#5 integrate .. //depot/projects/mips2/src/sys/arm/conf/AVILA#7 integrate .. //depot/projects/mips2/src/sys/compat/linux/linux_futex.c#4 integrate .. //depot/projects/mips2/src/sys/compat/linux/linux_futex.h#2 integrate .. //depot/projects/mips2/src/sys/dev/aac/aac.c#6 integrate .. //depot/projects/mips2/src/sys/dev/ata/ata-raid.c#5 integrate .. //depot/projects/mips2/src/sys/dev/cxgb/cxgb_main.c#13 integrate .. //depot/projects/mips2/src/sys/dev/cxgb/cxgb_sge.c#12 integrate .. //depot/projects/mips2/src/sys/i386/i386/nexus.c#5 integrate .. //depot/projects/mips2/src/sys/i386/isa/atpic.c#5 integrate .. //depot/projects/mips2/src/sys/kern/bus_if.m#4 integrate .. //depot/projects/mips2/src/sys/kern/subr_bus.c#10 integrate .. //depot/projects/mips2/src/sys/sys/aac_ioctl.h#2 integrate .. //depot/projects/mips2/src/sys/sys/bus.h#6 integrate .. //depot/projects/mips2/src/tools/tools/tinybsd/tinybsd#5 integrate .. //depot/user/imp/freebsd-imp/tools/tools/tinybsd/tinybsd#8 integrate Differences ... ==== //depot/projects/arm/src/sys/amd64/amd64/nexus.c#14 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/nexus.c,v 1.79 2008/03/13 20:39:03 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/nexus.c,v 1.80 2008/03/20 21:24:32 jhb Exp $"); /* * This code implements a `root nexus' for Intel Architecture @@ -87,6 +87,9 @@ int unit); static struct resource *nexus_alloc_resource(device_t, device_t, int, int *, u_long, u_long, u_long, u_int); +#ifdef SMP +static int nexus_bind_intr(device_t, device_t, struct resource *, int); +#endif static int nexus_config_intr(device_t, int, enum intr_trigger, enum intr_polarity); static int nexus_activate_resource(device_t, device_t, int, int, @@ -128,6 +131,9 @@ DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), DEVMETHOD(bus_setup_intr, nexus_setup_intr), DEVMETHOD(bus_teardown_intr, nexus_teardown_intr), +#ifdef SMP + DEVMETHOD(bus_bind_intr, nexus_bind_intr), +#endif DEVMETHOD(bus_config_intr, nexus_config_intr), DEVMETHOD(bus_get_resource_list, nexus_get_reslist), DEVMETHOD(bus_set_resource, nexus_set_resource), @@ -458,6 +464,14 @@ return (intr_remove_handler(ih)); } +#ifdef SMP +static int +nexus_bind_intr(device_t dev, device_t child, struct resource *irq, int cpu) +{ + return (intr_bind(rman_get_start(irq), cpu)); +} +#endif + static int nexus_config_intr(device_t dev, int irq, enum intr_trigger trig, enum intr_polarity pol) ==== //depot/projects/arm/src/sys/amd64/isa/atpic.c#9 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/isa/atpic.c,v 1.23 2008/03/16 10:58:02 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/isa/atpic.c,v 1.24 2008/03/20 21:53:27 jhb Exp $"); #include "opt_auto_eoi.h" #include "opt_isa.h" @@ -44,7 +44,6 @@ #include #include #include -#include #include #include @@ -208,12 +207,12 @@ struct atpic_intsrc *ai = (struct atpic_intsrc *)isrc; struct atpic *ap = (struct atpic *)isrc->is_pic; - mtx_lock_spin(&icu_lock); + spinlock_enter(); if (*ap->at_imen & IMEN_MASK(ai)) { *ap->at_imen &= ~IMEN_MASK(ai); outb(ap->at_ioaddr + ICU_IMR_OFFSET, *ap->at_imen); } - mtx_unlock_spin(&icu_lock); + spinlock_exit(); } static void @@ -222,7 +221,7 @@ struct atpic_intsrc *ai = (struct atpic_intsrc *)isrc; struct atpic *ap = (struct atpic *)isrc->is_pic; - mtx_lock_spin(&icu_lock); + spinlock_enter(); if (ai->at_trigger != INTR_TRIGGER_EDGE) { *ap->at_imen |= IMEN_MASK(ai); outb(ap->at_ioaddr + ICU_IMR_OFFSET, *ap->at_imen); @@ -240,16 +239,16 @@ _atpic_eoi_slave(isrc); } - mtx_unlock_spin(&icu_lock); + spinlock_exit(); } static void atpic_eoi_master(struct intsrc *isrc) { #ifndef AUTO_EOI_1 - mtx_lock_spin(&icu_lock); + spinlock_enter(); _atpic_eoi_master(isrc); - mtx_unlock_spin(&icu_lock); + spinlock_exit(); #endif } @@ -257,9 +256,9 @@ atpic_eoi_slave(struct intsrc *isrc) { #ifndef AUTO_EOI_2 - mtx_lock_spin(&icu_lock); + spinlock_enter(); _atpic_eoi_slave(isrc); - mtx_unlock_spin(&icu_lock); + spinlock_exit(); #endif } @@ -351,10 +350,10 @@ if (bootverbose) printf("atpic: Programming IRQ%u as %s\n", vector, trig == INTR_TRIGGER_EDGE ? "edge/high" : "level/low"); - mtx_lock_spin(&icu_lock); + spinlock_enter(); elcr_write_trigger(atpic_vector(isrc), trig); ai->at_trigger = trig; - mtx_unlock_spin(&icu_lock); + spinlock_exit(); return (0); } @@ -375,7 +374,7 @@ int imr_addr; /* Reset the PIC and program with next four bytes. */ - mtx_lock_spin(&icu_lock); + spinlock_enter(); outb(pic->at_ioaddr, ICW1_RESET | ICW1_IC4); imr_addr = pic->at_ioaddr + ICU_IMR_OFFSET; @@ -407,7 +406,7 @@ /* OCW2_L1 sets priority order to 3-7, 0-2 (com2 first). */ if (!slave) outb(pic->at_ioaddr, OCW2_R | OCW2_SL | OCW2_L1); - mtx_unlock_spin(&icu_lock); + spinlock_exit(); } void @@ -521,11 +520,11 @@ * pending. Reset read register back to IRR when done. */ port = ((struct atpic *)isrc->is_pic)->at_ioaddr; - mtx_lock_spin(&icu_lock); + spinlock_enter(); outb(port, OCW3_SEL | OCW3_RR | OCW3_RIS); isr = inb(port); outb(port, OCW3_SEL | OCW3_RR); - mtx_unlock_spin(&icu_lock); + spinlock_exit(); if ((isr & IRQ_MASK(7)) == 0) return; } ==== //depot/projects/arm/src/sys/arm/conf/AVILA#19 (text+ko) ==== @@ -16,7 +16,7 @@ # If you are in doubt as to the purpose or necessity of a line, check first # in NOTES. # -# $FreeBSD: src/sys/arm/conf/AVILA,v 1.9 2008/03/12 10:11:55 jeff Exp $ +# $FreeBSD: src/sys/arm/conf/AVILA,v 1.10 2008/03/20 17:44:58 sam Exp $ machine arm ident AVILA @@ -91,7 +91,7 @@ device iicbb device iic -device ixpiic +device ixpiic # I2C bus glue device ixpwdog # watchdog timer device ds1672 # DS1672 on I2C bus device ad7418 # AD7418 on I2C bus @@ -126,9 +126,12 @@ # Wireless NIC cards device wlan # 802.11 support -#device wlan_wep # 802.11 WEP support -#device wlan_ccmp # 802.11 CCMP support -#device wlan_tkip # 802.11 TKIP support +device wlan_wep # 802.11 WEP support +device wlan_ccmp # 802.11 CCMP support +device wlan_tkip # 802.11 TKIP support +device wlan_scan_sta +device wlan_scan_ap +device wlan_xauth device ath # Atheros pci/cardbus NIC's device ath_hal # Atheros HAL (Hardware Access Layer) device ath_rate_sample # SampleRate tx rate control for ath @@ -138,12 +141,15 @@ #device cryptodev #device hifn # NB: Soekris minipci card known to work -#device usb -#options USB_DEBUG -#device uhci -#device ohci -#device ehci -#device ugen -#device umass -#device scbus # SCSI bus (required for SCSI) -#device da # Direct Access (disks) +device usb +options USB_DEBUG +device ohci +device ehci +device ugen +device umass +device scbus # SCSI bus (required for SCSI) +device da # Direct Access (disks) + +device ural +device zyd +device wlan_amrr ==== //depot/projects/arm/src/sys/compat/linux/linux_futex.c#9 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_futex.c,v 1.11 2008/03/02 14:00:50 kib Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_futex.c,v 1.12 2008/03/20 17:03:55 rdivacky Exp $"); #if 0 __KERNEL_RCSID(1, "$NetBSD: linux_futex.c,v 1.7 2006/07/24 19:01:49 manu Exp $"); #endif @@ -118,6 +118,15 @@ args->val, args->uaddr2, args->val3); #endif + /* + * Our implementation provides only privates futexes. Most of the apps + * should use private futexes but don't claim so. Therefore we treat + * all futexes as private by clearing the FUTEX_PRIVATE_FLAG. It works + * in most cases (ie. when futexes are not shared on file descriptor + * or between different processes.). + */ + args->op = (args->op & ~LINUX_FUTEX_PRIVATE_FLAG); + switch (args->op) { case LINUX_FUTEX_WAIT: FUTEX_SYSTEM_LOCK; @@ -264,10 +273,11 @@ break; case LINUX_FUTEX_FD: - /* XXX: Linux plans to remove this operation */ +#ifdef DEBUG printf("linux_sys_futex: unimplemented op %d\n", args->op); - break; +#endif + return (ENOSYS); case LINUX_FUTEX_WAKE_OP: FUTEX_SYSTEM_LOCK; @@ -324,6 +334,18 @@ FUTEX_SYSTEM_UNLOCK; break; + case LINUX_FUTEX_LOCK_PI: + /* not yet implemented */ + return (ENOSYS); + + case LINUX_FUTEX_UNLOCK_PI: + /* not yet implemented */ + return (ENOSYS); + + case LINUX_FUTEX_TRYLOCK_PI: + /* not yet implemented */ + return (ENOSYS); + default: printf("linux_sys_futex: unknown op %d\n", args->op); ==== //depot/projects/arm/src/sys/compat/linux/linux_futex.h#3 (text+ko) ==== @@ -30,7 +30,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/compat/linux/linux_futex.h,v 1.2 2007/02/25 12:40:35 netchild Exp $ + * $FreeBSD: src/sys/compat/linux/linux_futex.h,v 1.3 2008/03/20 17:03:55 rdivacky Exp $ */ #ifndef _LINUX_FUTEX_H @@ -42,6 +42,11 @@ #define LINUX_FUTEX_REQUEUE 3 #define LINUX_FUTEX_CMP_REQUEUE 4 #define LINUX_FUTEX_WAKE_OP 5 +#define LINUX_FUTEX_LOCK_PI 6 +#define LINUX_FUTEX_UNLOCK_PI 7 +#define LINUX_FUTEX_TRYLOCK_PI 8 + +#define LINUX_FUTEX_PRIVATE_FLAG 128 #define FUTEX_OP_SET 0 /* *(int *)UADDR2 = OPARG; */ #define FUTEX_OP_ADD 1 /* *(int *)UADDR2 += OPARG; */ ==== //depot/projects/arm/src/sys/dev/aac/aac.c#10 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/aac/aac.c,v 1.128 2008/03/14 21:59:11 emaste Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/aac/aac.c,v 1.130 2008/03/20 20:33:48 emaste Exp $"); /* * Driver for the Adaptec 'FSA' family of PCI/SCSI RAID adapters. @@ -213,6 +213,7 @@ static d_ioctl_t aac_ioctl; static d_poll_t aac_poll; static int aac_ioctl_sendfib(struct aac_softc *sc, caddr_t ufib); +static int aac_ioctl_send_raw_srb(struct aac_softc *sc, caddr_t arg); static void aac_handle_aif(struct aac_softc *sc, struct aac_fib *fib); static int aac_rev_check(struct aac_softc *sc, caddr_t udata); @@ -1693,6 +1694,11 @@ sc->aac_max_fib_size = PAGE_SIZE; sc->aac_max_fibs_alloc = PAGE_SIZE / sc->aac_max_fib_size; + if (sc->aac_max_fib_size > sizeof(struct aac_fib)) { + sc->flags |= AAC_FLAGS_RAW_IO; + device_printf(sc->aac_dev, "Enable Raw I/O\n"); + } + return (0); } @@ -2039,7 +2045,7 @@ fib->Header.XferState |= xferstate; fib->Header.Command = command; fib->Header.StructType = AAC_FIBTYPE_TFIB; - fib->Header.Size = sizeof(struct aac_fib) + datasize; + fib->Header.Size = sizeof(struct aac_fib_header) + datasize; fib->Header.SenderSize = sizeof(struct aac_fib); fib->Header.SenderFibAddress = 0; /* Not needed */ fib->Header.ReceiverFibAddress = sc->aac_common_busaddr + @@ -2887,11 +2893,19 @@ break; case FSACTL_SENDFIB: + case FSACTL_SEND_LARGE_FIB: arg = *(caddr_t*)arg; case FSACTL_LNX_SENDFIB: + case FSACTL_LNX_SEND_LARGE_FIB: debug(1, "FSACTL_SENDFIB"); error = aac_ioctl_sendfib(sc, arg); break; + case FSACTL_SEND_RAW_SRB: + arg = *(caddr_t*)arg; + case FSACTL_LNX_SEND_RAW_SRB: + debug(1, "FSACTL_SEND_RAW_SRB"); + error = aac_ioctl_send_raw_srb(sc, arg); + break; case FSACTL_AIF_THREAD: case FSACTL_LNX_AIF_THREAD: debug(1, "FSACTL_AIF_THREAD"); @@ -3035,10 +3049,10 @@ sizeof(struct aac_fib_header))) != 0) goto out; size = cm->cm_fib->Header.Size + sizeof(struct aac_fib_header); - if (size > sizeof(struct aac_fib)) { - device_printf(sc->aac_dev, "incoming FIB oversized (%d > %zd)\n", - size, sizeof(struct aac_fib)); - size = sizeof(struct aac_fib); + if (size > sc->aac_max_fib_size) { + device_printf(sc->aac_dev, "incoming FIB oversized (%d > %d)\n", + size, sc->aac_max_fib_size); + size = sc->aac_max_fib_size; } if ((error = copyin(ufib, cm->cm_fib, size)) != 0) goto out; @@ -3061,10 +3075,10 @@ * Copy the FIB and data back out to the caller. */ size = cm->cm_fib->Header.Size; - if (size > sizeof(struct aac_fib)) { - device_printf(sc->aac_dev, "outbound FIB oversized (%d > %zd)\n", - size, sizeof(struct aac_fib)); - size = sizeof(struct aac_fib); + if (size > sc->aac_max_fib_size) { + device_printf(sc->aac_dev, "outbound FIB oversized (%d > %d)\n", + size, sc->aac_max_fib_size); + size = sc->aac_max_fib_size; } error = copyout(cm->cm_fib, ufib, size); @@ -3078,6 +3092,15 @@ } /* + * Send a passthrough FIB supplied from userspace + */ +static int +aac_ioctl_send_raw_srb(struct aac_softc *sc, caddr_t arg) +{ + return (EINVAL); +} + +/* * Handle an AIF sent to us by the controller; queue it for later reference. * If the queue fills up, then drop the older entries. */ @@ -3556,7 +3579,7 @@ vmi->IoctlCmd = GetBusInfo; error = aac_sync_fib(sc, ContainerCommand, 0, fib, - sizeof(struct aac_vmioctl)); + sizeof(struct aac_vmi_businf_resp)); if (error) { device_printf(sc->aac_dev, "Error %d sending VMIoctl command\n", error); ==== //depot/projects/arm/src/sys/dev/ata/ata-raid.c#17 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-raid.c,v 1.125 2008/03/20 11:54:26 sos Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-raid.c,v 1.126 2008/03/20 21:21:31 sos Exp $"); #include "opt_ata.h" #include @@ -199,8 +199,9 @@ printf("using %s at ata%d-%s\n", device_get_nameunit(rdp->disks[disk].dev), device_get_unit(device_get_parent(rdp->disks[disk].dev)), - ata_unit2str((struct ata_device *) - device_get_softc(rdp->disks[disk].dev))); + (((struct ata_device *) + device_get_softc(rdp->disks[disk].dev))->unit == + ATA_MASTER) ? "master" : "slave"); } else if (rdp->disks[disk].flags & AR_DF_ASSIGNED) printf("DOWN\n"); @@ -1665,7 +1666,7 @@ struct ata_device *atadev = device_get_softc(parent); struct ata_channel *ch = device_get_softc(GRANDPARENT(dev)); int disk_number = (ch->unit << !(ch->flags & ATA_NO_SLAVE)) + - atadev->unit; + ATA_DEV(atadev->unit); raid->disks[disk_number].dev = parent; raid->disks[disk_number].sectors = @@ -2298,7 +2299,7 @@ bcopy(atadev->param.serial, meta->disk[disk].serial, sizeof(rdp->disks[disk].serial)); meta->disk[disk].sectors = rdp->disks[disk].sectors; - meta->disk[disk].id = (ch->unit << 16) | atadev->unit; + meta->disk[disk].id = (ch->unit << 16) | ATA_DEV(atadev->unit); } else meta->disk[disk].sectors = rdp->total_sectors / rdp->width; @@ -3323,7 +3324,7 @@ device_get_softc(device_get_parent(rdp->disks[disk].dev)); meta->raid.channel = ch->unit; - meta->raid.device = atadev->unit; + meta->raid.device = ATA_DEV(atadev->unit); meta->raid.disk_sectors = rdp->disks[disk].sectors; meta->raid.disk_offset = rdp->offset_sectors; } @@ -3411,7 +3412,7 @@ device_get_softc(rdp->disks[drive].dev); meta->raid.disk[drive].channel = ch->unit; - meta->raid.disk[drive].device = atadev->unit; + meta->raid.disk[drive].device = ATA_DEV(atadev->unit); } meta->raid.disk[drive].magic_0 = PR_MAGIC0(meta->raid.disk[drive]) | timestamp.tv_sec; @@ -3737,7 +3738,7 @@ struct ata_channel *ch = device_get_softc(device_get_parent(rdp->disks[disk].dev)); struct ata_device *atadev = device_get_softc(rdp->disks[disk].dev); - int disk_number = 1 + atadev->unit + (ch->unit << 1); + int disk_number = 1 + ATA_DEV(atadev->unit) + (ch->unit << 1); meta->disks |= disk_number << ((1 - disk) << 2); } @@ -3775,7 +3776,7 @@ bcopy(atadev->param.model, meta->model, sizeof(meta->model)); /* XXX SOS if total_disks > 2 this may not float */ - meta->disk_number = 1 + atadev->unit + (ch->unit << 1); + meta->disk_number = 1 + ATA_DEV(atadev->unit) + (ch->unit << 1); if (testing || bootverbose) ata_raid_sis_print_meta(meta); ==== //depot/projects/arm/src/sys/dev/cxgb/cxgb_main.c#14 (text+ko) ==== @@ -28,7 +28,7 @@ ***************************************************************************/ #include -__FBSDID("$FreeBSD: src/sys/dev/cxgb/cxgb_main.c,v 1.52 2008/03/19 20:56:51 kmacy Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/cxgb/cxgb_main.c,v 1.53 2008/03/20 20:52:37 kmacy Exp $"); #include #include @@ -500,7 +500,7 @@ error = ENODEV; goto out; } - /* Allocate the BAR for doing MSI-X. If it succeeds, try to allocate + /* Allocate the BAR for doing MSI-X. If it succeeds, try to allocate * enough messages for the queue sets. If that fails, try falling * back to MSI. If that fails, then try falling back to the legacy * interrupt pin model. @@ -549,7 +549,9 @@ sc->cxgb_intr = t3b_intr; } - + if ((sc->flags & USING_MSIX) && !singleq) + port_qsets = min((SGE_QSETS/(sc)->params.nports), mp_ncpus); + /* Create a private taskqueue thread for handling driver events */ #ifdef TASKQUEUE_CURRENT sc->tq = taskqueue_create("cxgb_taskq", M_NOWAIT, @@ -594,9 +596,6 @@ sc->flags |= TPS_UPTODATE; } - if ((sc->flags & USING_MSIX) && !singleq) - port_qsets = min((SGE_QSETS/(sc)->params.nports), mp_ncpus); - /* * Create a child device for each MAC. The ethernet attachment * will be done in these children. ==== //depot/projects/arm/src/sys/dev/cxgb/cxgb_sge.c#13 (text+ko) ==== @@ -30,7 +30,7 @@ #include -__FBSDID("$FreeBSD: src/sys/dev/cxgb/cxgb_sge.c,v 1.51 2008/02/25 19:28:27 keramida Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/cxgb/cxgb_sge.c,v 1.52 2008/03/20 20:52:37 kmacy Exp $"); #include #include @@ -83,10 +83,18 @@ int cxgb_cached; int cxgb_ext_freed = 0; int cxgb_ext_inited = 0; +int fl_q_size = 0; +int jumbo_q_size = 0; + extern int cxgb_use_16k_clusters; extern int cxgb_pcpu_cache_enable; +extern int nmbjumbo4; +extern int nmbjumbo9; +extern int nmbjumbo16; + + #define USE_GTS 0 #define SGE_RX_SM_BUF_SIZE 1536 @@ -360,8 +368,25 @@ void t3_sge_prep(adapter_t *adap, struct sge_params *p) { - int i; + int i, nqsets; + + nqsets = min(SGE_QSETS, mp_ncpus*4); + + fl_q_size = min(nmbclusters/(3*nqsets), FL_Q_SIZE); + while (!powerof2(fl_q_size)) + fl_q_size--; +#if __FreeBSD_version > 800000 + if (cxgb_use_16k_clusters) + jumbo_q_size = min(nmbjumbo16/(3*nqsets), JUMBO_Q_SIZE); + else + jumbo_q_size = min(nmbjumbo9/(3*nqsets), JUMBO_Q_SIZE); +#else + jumbo_q_size = min(nmbjumbo4/(3*nqsets), JUMBO_Q_SIZE); +#endif + while (!powerof2(jumbo_q_size)) + jumbo_q_size--; + /* XXX Does ETHER_ALIGN need to be accounted for here? */ p->max_pkt_size = adap->sge.qs[0].fl[1].buf_size - sizeof(struct cpl_rx_data); @@ -379,8 +404,8 @@ } q->polling = adap->params.rev > 0; q->rspq_size = RSPQ_Q_SIZE; - q->fl_size = FL_Q_SIZE; - q->jumbo_size = JUMBO_Q_SIZE; + q->fl_size = fl_q_size; + q->jumbo_size = jumbo_q_size; q->txq_size[TXQ_ETH] = TX_ETH_Q_SIZE; q->txq_size[TXQ_OFLD] = 1024; q->txq_size[TXQ_CTRL] = 256; ==== //depot/projects/arm/src/sys/i386/i386/nexus.c#13 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/i386/i386/nexus.c,v 1.74 2008/03/13 20:39:04 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/i386/i386/nexus.c,v 1.75 2008/03/20 21:24:32 jhb Exp $"); /* * This code implements a `root nexus' for Intel Architecture @@ -91,6 +91,9 @@ int unit); static struct resource *nexus_alloc_resource(device_t, device_t, int, int *, u_long, u_long, u_long, u_int); +#ifdef SMP +static int nexus_bind_intr(device_t, device_t, struct resource *, int); +#endif static int nexus_config_intr(device_t, int, enum intr_trigger, enum intr_polarity); static int nexus_activate_resource(device_t, device_t, int, int, @@ -134,6 +137,9 @@ DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), DEVMETHOD(bus_setup_intr, nexus_setup_intr), DEVMETHOD(bus_teardown_intr, nexus_teardown_intr), +#ifdef SMP + DEVMETHOD(bus_bind_intr, nexus_bind_intr), +#endif DEVMETHOD(bus_config_intr, nexus_config_intr), DEVMETHOD(bus_get_resource_list, nexus_get_reslist), DEVMETHOD(bus_set_resource, nexus_set_resource), @@ -505,6 +511,14 @@ return (intr_remove_handler(ih)); } +#ifdef SMP +static int +nexus_bind_intr(device_t dev, device_t child, struct resource *irq, int cpu) +{ + return (intr_bind(rman_get_start(irq), cpu)); +} +#endif + static int nexus_config_intr(device_t dev, int irq, enum intr_trigger trig, enum intr_polarity pol) ==== //depot/projects/arm/src/sys/i386/isa/atpic.c#9 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/i386/isa/atpic.c,v 1.29 2008/03/16 10:58:04 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/i386/isa/atpic.c,v 1.30 2008/03/20 21:53:27 jhb Exp $"); #include "opt_auto_eoi.h" #include "opt_isa.h" @@ -44,7 +44,6 @@ #include #include #include -#include #include #include @@ -226,12 +225,12 @@ struct atpic_intsrc *ai = (struct atpic_intsrc *)isrc; struct atpic *ap = (struct atpic *)isrc->is_pic; - mtx_lock_spin(&icu_lock); + spinlock_enter(); if (*ap->at_imen & IMEN_MASK(ai)) { *ap->at_imen &= ~IMEN_MASK(ai); outb(ap->at_ioaddr + ICU_IMR_OFFSET, *ap->at_imen); } - mtx_unlock_spin(&icu_lock); + spinlock_exit(); } static void @@ -240,7 +239,7 @@ struct atpic_intsrc *ai = (struct atpic_intsrc *)isrc; struct atpic *ap = (struct atpic *)isrc->is_pic; - mtx_lock_spin(&icu_lock); + spinlock_enter(); if (ai->at_trigger != INTR_TRIGGER_EDGE) { *ap->at_imen |= IMEN_MASK(ai); outb(ap->at_ioaddr + ICU_IMR_OFFSET, *ap->at_imen); @@ -258,16 +257,16 @@ _atpic_eoi_slave(isrc); } - mtx_unlock_spin(&icu_lock); + spinlock_exit(); } static void atpic_eoi_master(struct intsrc *isrc) { #ifndef AUTO_EOI_1 - mtx_lock_spin(&icu_lock); + spinlock_enter(); _atpic_eoi_master(isrc); - mtx_unlock_spin(&icu_lock); + spinlock_exit(); #endif } @@ -275,9 +274,9 @@ atpic_eoi_slave(struct intsrc *isrc) { #ifndef AUTO_EOI_2 - mtx_lock_spin(&icu_lock); + spinlock_enter(); _atpic_eoi_slave(isrc); - mtx_unlock_spin(&icu_lock); + spinlock_exit(); #endif } @@ -382,10 +381,10 @@ if (bootverbose) printf("atpic: Programming IRQ%u as %s\n", vector, trig == INTR_TRIGGER_EDGE ? "edge/high" : "level/low"); - mtx_lock_spin(&icu_lock); + spinlock_enter(); elcr_write_trigger(atpic_vector(isrc), trig); ai->at_trigger = trig; - mtx_unlock_spin(&icu_lock); + spinlock_exit(); return (0); #endif /* PC98 */ } @@ -407,7 +406,7 @@ int imr_addr; /* Reset the PIC and program with next four bytes. */ - mtx_lock_spin(&icu_lock); + spinlock_enter(); #ifdef DEV_MCA /* MCA uses level triggered interrupts. */ if (MCA_system) @@ -447,7 +446,7 @@ if (!slave) outb(pic->at_ioaddr, OCW2_R | OCW2_SL | OCW2_L1); #endif - mtx_unlock_spin(&icu_lock); + spinlock_exit(); } void @@ -585,11 +584,11 @@ * pending. Reset read register back to IRR when done. */ port = ((struct atpic *)isrc->is_pic)->at_ioaddr; - mtx_lock_spin(&icu_lock); + spinlock_enter(); outb(port, OCW3_SEL | OCW3_RR | OCW3_RIS); isr = inb(port); outb(port, OCW3_SEL | OCW3_RR); - mtx_unlock_spin(&icu_lock); + spinlock_exit(); if ((isr & IRQ_MASK(7)) == 0) return; } ==== //depot/projects/arm/src/sys/kern/bus_if.m#9 (text+ko) ==== @@ -23,7 +23,7 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $FreeBSD: src/sys/kern/bus_if.m,v 1.34 2007/02/23 12:19:01 piso Exp $ +# $FreeBSD: src/sys/kern/bus_if.m,v 1.35 2008/03/20 21:24:32 jhb Exp $ # #include @@ -494,6 +494,23 @@ }; /** + * @brief Allow drivers to request that an interrupt be bound to a specific + * CPU. + * + * @param _dev the parent device of @p _child + * @param _child the device which allocated the resource + * @param _irq the resource representing the interrupt + * @param _cpu the CPU to bind the interrupt to + */ +METHOD int bind_intr { + device_t _dev; + device_t _child; + struct resource *_irq; + int _cpu; +} DEFAULT bus_generic_bind_intr; + + +/** * @brief Allow (bus) drivers to specify the trigger mode and polarity * of the specified interrupt. * ==== //depot/projects/arm/src/sys/kern/subr_bus.c#25 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/subr_bus.c,v 1.206 2008/03/10 01:48:25 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/subr_bus.c,v 1.207 2008/03/20 21:24:32 jhb Exp $"); #include "opt_bus.h" @@ -3229,6 +3229,23 @@ } /** + * @brief Helper function for implementing BUS_BIND_INTR(). + * + * This simple implementation of BUS_BIND_INTR() simply calls the + * BUS_BIND_INTR() method of the parent of @p dev. + */ +int +bus_generic_bind_intr(device_t dev, device_t child, struct resource *irq, + int cpu) +{ + + /* Propagate up the bus hierarchy until someone handles it. */ + if (dev->parent) + return (BUS_BIND_INTR(dev->parent, child, irq, cpu)); + return (EINVAL); +} + +/** * @brief Helper function for implementing BUS_CONFIG_INTR(). * * This simple implementation of BUS_CONFIG_INTR() simply calls the @@ -3536,6 +3553,20 @@ } /** + * @brief Wrapper function for BUS_BIND_INTR(). + * + * This function simply calls the BUS_BIND_INTR() method of the + * parent of @p dev. + */ +int +bus_bind_intr(device_t dev, struct resource *r, int cpu) +{ + if (dev->parent == NULL) + return (EINVAL); + return (BUS_BIND_INTR(dev->parent, dev, r, cpu)); +} + +/** * @brief Wrapper function for BUS_SET_RESOURCE(). * * This function simply calls the BUS_SET_RESOURCE() method of the ==== //depot/projects/arm/src/sys/sys/aac_ioctl.h#2 (text+ko) ==== @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/sys/aac_ioctl.h,v 1.11 2004/12/09 22:20:25 scottl Exp $ + * $FreeBSD: src/sys/sys/aac_ioctl.h,v 1.12 2008/03/20 17:59:18 emaste Exp $ */ /* @@ -69,6 +69,8 @@ #define FSACTL_LNX_SENDFIB CTL_CODE(FILE_DEVICE_CONTROLLER, 2050, \ METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSACTL_LNX_SEND_RAW_SRB CTL_CODE(FILE_DEVICE_CONTROLLER, 2067, \ + METHOD_BUFFERED, FILE_ANY_ACCESS) #define FSACTL_LNX_GET_COMM_PERF_DATA CTL_CODE(FILE_DEVICE_CONTROLLER, 2084, \ METHOD_BUFFERED, FILE_ANY_ACCESS) #define FSACTL_LNX_OPENCLS_COMM_PERF_DATA CTL_CODE(FILE_DEVICE_CONTROLLER, \ @@ -93,6 +95,8 @@ METHOD_NEITHER, FILE_ANY_ACCESS) #define FSACTL_LNX_AIF_THREAD CTL_CODE(FILE_DEVICE_CONTROLLER, 2127, \ METHOD_NEITHER, FILE_ANY_ACCESS) +#define FSACTL_LNX_SEND_LARGE_FIB CTL_CODE(FILE_DEVICE_CONTROLLER, 2138, \ + METHOD_BUFFERED, FILE_ANY_ACCESS) /* Why these don't follow the previous convention, I don't know */ #define FSACTL_LNX_NULL_IO_TEST 0x43 @@ -116,6 +120,7 @@ * command number. 9 is used for the odd overflow case. */ #define FSACTL_SENDFIB _IO('8', 2) +#define FSACTL_SEND_RAW_SRB _IO('8', 19) #define FSACTL_GET_COMM_PERF_DATA _IO('8', 36) #define FSACTL_OPENCLS_COMM_PERF_DATA _IO('8', 37) #define FSACTL_OPEN_GET_ADAPTER_FIB _IO('8', 52) @@ -128,6 +133,7 @@ #define FSACTL_GET_PCI_INFO _IO('8', 71) #define FSACTL_FORCE_DELETE_DISK _IO('8', 72) #define FSACTL_AIF_THREAD _IO('8', 79) +#define FSACTL_SEND_LARGE_FIB _IO('8', 90) #define FSACTL_NULL_IO_TEST _IO('8', 67) #define FSACTL_SIM_IO_TEST _IO('8', 83) ==== //depot/projects/arm/src/sys/sys/bus.h#13 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/sys/bus.h,v 1.80 2008/03/09 05:10:22 imp Exp $ + * $FreeBSD: src/sys/sys/bus.h,v 1.81 2008/03/20 21:24:32 jhb Exp $ */ #ifndef _SYS_BUS_H_ @@ -286,6 +286,8 @@ int *rid, u_long start, u_long end, u_long count, u_int flags); int bus_generic_attach(device_t dev); +int bus_generic_bind_intr(device_t dev, device_t child, + struct resource *irq, int cpu); int bus_generic_child_present(device_t dev, device_t child); int bus_generic_config_intr(device_t, int, enum intr_trigger, enum intr_polarity); @@ -358,6 +360,7 @@ driver_filter_t filter, driver_intr_t handler, void *arg, void **cookiep); int bus_teardown_intr(device_t dev, struct resource *r, void *cookie); +int bus_bind_intr(device_t dev, struct resource *r, int cpu); int bus_set_resource(device_t dev, int type, int rid, u_long start, u_long count); int bus_get_resource(device_t dev, int type, int rid, ==== //depot/projects/arm/src/tools/tools/tinybsd/tinybsd#7 (text+ko) ==== >>> TRUNCATED FOR MAIL (1000 lines) <<<