Date: Sat, 26 Jun 2004 16:43:42 GMT From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 55844 for review Message-ID: <200406261643.i5QGhgg7068568@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=55844 Change 55844 by rwatson@rwatson_tislabs on 2004/06/26 16:43:39 Integrate netperf_socket: Slide UNIX domain socket lock before free of unpcb. TTY goop. USB goop. Netgraph cleanup -- no NULL messages passed in, use m_tags for state. Cleanup of SACK. Affected files ... .. //depot/projects/netperf_socket/sys/conf/files#31 integrate .. //depot/projects/netperf_socket/sys/conf/kern.post.mk#7 integrate .. //depot/projects/netperf_socket/sys/conf/options.powerpc#3 integrate .. //depot/projects/netperf_socket/sys/dev/ar/if_ar.c#5 integrate .. //depot/projects/netperf_socket/sys/dev/ata/ata-raid.c#3 integrate .. //depot/projects/netperf_socket/sys/dev/ata/ata-raid.h#3 integrate .. //depot/projects/netperf_socket/sys/dev/cp/if_cp.c#6 integrate .. //depot/projects/netperf_socket/sys/dev/ctau/if_ct.c#7 integrate .. //depot/projects/netperf_socket/sys/dev/cx/if_cx.c#10 integrate .. //depot/projects/netperf_socket/sys/dev/cy/cy.c#9 integrate .. //depot/projects/netperf_socket/sys/dev/digi/digi.c#9 integrate .. //depot/projects/netperf_socket/sys/dev/ofw/ofw_disk.c#3 integrate .. //depot/projects/netperf_socket/sys/dev/rc/rc.c#8 integrate .. //depot/projects/netperf_socket/sys/dev/sab/sab.c#7 integrate .. //depot/projects/netperf_socket/sys/dev/si/si.c#8 integrate .. //depot/projects/netperf_socket/sys/dev/si/si.h#2 integrate .. //depot/projects/netperf_socket/sys/dev/sio/sio.c#13 integrate .. //depot/projects/netperf_socket/sys/dev/sound/pcm/mixer.c#6 integrate .. //depot/projects/netperf_socket/sys/dev/sr/if_sr.c#5 integrate .. //depot/projects/netperf_socket/sys/dev/sx/sx.c#7 integrate .. //depot/projects/netperf_socket/sys/dev/sx/sx.h#2 integrate .. //depot/projects/netperf_socket/sys/dev/uart/uart_tty.c#7 integrate .. //depot/projects/netperf_socket/sys/dev/usb/ehci.c#3 integrate .. //depot/projects/netperf_socket/sys/dev/usb/ehcireg.h#4 integrate .. //depot/projects/netperf_socket/sys/dev/usb/ohci.c#3 integrate .. //depot/projects/netperf_socket/sys/dev/usb/ubser.c#6 integrate .. //depot/projects/netperf_socket/sys/dev/usb/ucom.c#8 integrate .. //depot/projects/netperf_socket/sys/dev/usb/ucomvar.h#3 integrate .. //depot/projects/netperf_socket/sys/dev/usb/udbp.c#3 integrate .. //depot/projects/netperf_socket/sys/dev/usb/ugen.c#4 integrate .. //depot/projects/netperf_socket/sys/dev/usb/uhid.c#5 integrate .. //depot/projects/netperf_socket/sys/dev/usb/usb_quirks.c#2 integrate .. //depot/projects/netperf_socket/sys/dev/usb/usb_subr.c#6 integrate .. //depot/projects/netperf_socket/sys/dev/usb/usbdi_util.h#2 integrate .. //depot/projects/netperf_socket/sys/dev/zs/zs.c#6 integrate .. //depot/projects/netperf_socket/sys/dev/zs/zs_macio.c#3 integrate .. //depot/projects/netperf_socket/sys/geom/vinum/geom_vinum.c#4 integrate .. //depot/projects/netperf_socket/sys/geom/vinum/geom_vinum_subr.c#3 integrate .. //depot/projects/netperf_socket/sys/kern/tty.c#11 integrate .. //depot/projects/netperf_socket/sys/kern/tty_pty.c#10 integrate .. //depot/projects/netperf_socket/sys/kern/uipc_usrreq.c#16 integrate .. //depot/projects/netperf_socket/sys/modules/ar/Makefile#2 integrate .. //depot/projects/netperf_socket/sys/modules/sr/Makefile#2 integrate .. //depot/projects/netperf_socket/sys/net/if_sl.c#7 integrate .. //depot/projects/netperf_socket/sys/net/if_spppsubr.c#7 integrate .. //depot/projects/netperf_socket/sys/net/ppp_tty.c#3 integrate .. //depot/projects/netperf_socket/sys/netgraph/atm/uni/ng_uni_cust.h#2 integrate .. //depot/projects/netperf_socket/sys/netgraph/bluetooth/drivers/h4/ng_h4.c#6 integrate .. //depot/projects/netperf_socket/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c#7 integrate .. //depot/projects/netperf_socket/sys/netgraph/bluetooth/socket/ng_btsocket.c#3 integrate .. //depot/projects/netperf_socket/sys/netgraph/netgraph.h#4 integrate .. //depot/projects/netperf_socket/sys/netgraph/ng_UI.c#3 integrate .. //depot/projects/netperf_socket/sys/netgraph/ng_base.c#5 integrate .. //depot/projects/netperf_socket/sys/netgraph/ng_eiface.c#4 integrate .. //depot/projects/netperf_socket/sys/netgraph/ng_iface.c#4 integrate .. //depot/projects/netperf_socket/sys/netgraph/ng_ksocket.c#9 integrate .. //depot/projects/netperf_socket/sys/netgraph/ng_ksocket.h#2 integrate .. //depot/projects/netperf_socket/sys/netgraph/ng_lmi.c#3 integrate .. //depot/projects/netperf_socket/sys/netgraph/ng_parse.c#4 integrate .. //depot/projects/netperf_socket/sys/netgraph/ng_rfc1490.c#4 integrate .. //depot/projects/netperf_socket/sys/netgraph/ng_sppp.c#3 integrate .. //depot/projects/netperf_socket/sys/netgraph/ng_tty.c#4 integrate .. //depot/projects/netperf_socket/sys/netinet/tcp_input.c#14 integrate .. //depot/projects/netperf_socket/sys/pc98/pc98/sio.c#12 integrate .. //depot/projects/netperf_socket/sys/powerpc/ofw/ofw_pcib_pci.c#2 integrate .. //depot/projects/netperf_socket/sys/powerpc/ofw/ofw_syscons.c#2 integrate .. //depot/projects/netperf_socket/sys/powerpc/powermac/grackle.c#4 integrate .. //depot/projects/netperf_socket/sys/powerpc/powermac/hrowpic.c#3 integrate .. //depot/projects/netperf_socket/sys/powerpc/powermac/macio.c#2 integrate .. //depot/projects/netperf_socket/sys/powerpc/powermac/openpic_macio.c#4 integrate .. //depot/projects/netperf_socket/sys/powerpc/powermac/uninorth.c#2 integrate .. //depot/projects/netperf_socket/sys/powerpc/powerpc/nexus.c#3 integrate .. //depot/projects/netperf_socket/sys/powerpc/psim/iobus.c#2 integrate .. //depot/projects/netperf_socket/sys/powerpc/psim/openpic_iobus.c#3 integrate .. //depot/projects/netperf_socket/sys/sys/linedisc.h#3 integrate .. //depot/projects/netperf_socket/sys/sys/procfs.h#2 integrate .. //depot/projects/netperf_socket/sys/sys/serial.h#2 integrate .. //depot/projects/netperf_socket/sys/sys/tty.h#8 integrate .. //depot/projects/netperf_socket/sys/sys/ttycom.h#7 integrate Differences ... ==== //depot/projects/netperf_socket/sys/conf/files#31 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/files,v 1.909 2004/06/24 06:29:22 njl Exp $ +# $FreeBSD: src/sys/conf/files,v 1.910 2004/06/26 05:58:43 imp Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -43,17 +43,17 @@ miidevs.h standard \ dependency "$S/tools/miidevs2h.awk $S/dev/mii/miidevs" \ compile-with "${AWK} -f $S/tools/miidevs2h.awk $S/dev/mii/miidevs" \ - no-obj no-implicit-rule \ + no-obj no-implicit-rule before-depend \ clean "miidevs.h" pccarddevs.h standard \ dependency "$S/tools/pccarddevs2h.awk $S/dev/pccard/pccarddevs" \ compile-with "${AWK} -f $S/tools/pccarddevs2h.awk $S/dev/pccard/pccarddevs" \ - no-obj no-implicit-rule \ + no-obj no-implicit-rule before-depend \ clean "pccarddevs.h" usbdevs.h standard \ dependency "$S/tools/usbdevs2h.awk $S/dev/usb/usbdevs" \ compile-with "${AWK} -f $S/tools/usbdevs2h.awk $S/dev/usb/usbdevs" \ - no-obj no-implicit-rule \ + no-obj no-implicit-rule before-depend \ clean "usbdevs.h" kern/device_if.m standard kern/bus_if.m standard ==== //depot/projects/netperf_socket/sys/conf/kern.post.mk#7 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/kern.post.mk,v 1.66 2004/05/26 16:31:41 imp Exp $ +# $FreeBSD: src/sys/conf/kern.post.mk,v 1.67 2004/06/26 06:02:06 imp Exp $ # Part of a unified Makefile for building kernels. This part includes all # the definitions that need to be after all the % directives except %RULES @@ -77,8 +77,7 @@ ${SYSTEM_LD_TAIL} .if !exists(${.OBJDIR}/.depend) -${SYSTEM_OBJS}: assym.s pccarddevs.h usbdevs.h miidevs.h vnode_if.h \ - ${BEFORE_DEPEND:M*.h} ${MFILES:T:S/.m$/.h/} +${SYSTEM_OBJS}: assym.s vnode_if.h ${BEFORE_DEPEND:M*.h} ${MFILES:T:S/.m$/.h/} .endif LNFILES= ${CFILES:T:S/.c$/.ln/} @@ -136,7 +135,7 @@ # The argument list can be very long, so use make -V and xargs to # pass it to mkdep. -_kernel-depend: assym.s miidevs.h pccarddevs.h usbdevs.h vnode_if.h \ +_kernel-depend: assym.s vnode_if.h \ ${BEFORE_DEPEND} ${CFILES} ${SYSTEM_CFILES} ${GEN_CFILES} \ ${GEN_M_CFILES} ${SFILES} ${MFILES:T:S/.m$/.h/} if [ -f .olddep ]; then mv .olddep .depend; fi ==== //depot/projects/netperf_socket/sys/conf/options.powerpc#3 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/options.powerpc,v 1.8 2004/01/21 05:20:58 grehan Exp $ +# $FreeBSD: src/sys/conf/options.powerpc,v 1.9 2004/06/25 13:44:34 grehan Exp $ # Options specific to the powerpc platform kernels OEA opt_global.h @@ -12,3 +12,5 @@ PSIM SC_OFWFB opt_ofwfb.h + +OFWCONS_POLL_HZ opt_ofw.h ==== //depot/projects/netperf_socket/sys/dev/ar/if_ar.c#5 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ar/if_ar.c,v 1.63 2004/05/29 00:51:08 julian Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ar/if_ar.c,v 1.64 2004/06/25 19:22:04 julian Exp $"); /* * Programming assumptions and other issues. @@ -2228,10 +2228,9 @@ struct ar_softc * sc = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); struct ifqueue *xmitq_p; struct mbuf *m; - meta_p meta; + struct ng_tag_prio *ptag; NGI_GET_M(item, m); - NGI_GET_META(item, meta); NG_FREE_ITEM(item); /* * data doesn't come in from just anywhere (e.g control hook) @@ -2244,11 +2243,12 @@ /* * Now queue the data for when it can be sent */ - if (meta && meta->priority > 0) { + if ((ptag = (struct ng_tag_prio *)m_tag_locate(m, NGM_GENERIC_COOKIE, + NG_TAG_PRIO, NULL)) != NULL && (ptag->priority > NG_PRIO_CUTOFF) ) xmitq_p = (&sc->xmitq_hipri); - } else { + else xmitq_p = (&sc->xmitq); - } + s = splimp(); IF_LOCK(xmitq_p); if (_IF_QFULL(xmitq_p)) { @@ -2270,7 +2270,6 @@ * check if we need to free the mbuf, and then return the error */ NG_FREE_M(m); - NG_FREE_META(meta); return (error); } ==== //depot/projects/netperf_socket/sys/dev/ata/ata-raid.c#3 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-raid.c,v 1.78 2004/02/18 21:36:51 phk Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-raid.c,v 1.79 2004/06/25 21:21:59 sos Exp $"); #include "opt_ata.h" #include <sys/param.h> @@ -67,6 +67,8 @@ static void ar_rebuild(void *); static int ar_highpoint_read_conf(struct ad_softc *, struct ar_softc **); static int ar_highpoint_write_conf(struct ar_softc *); +static int ar_lsi_read_conf(struct ad_softc *, struct ar_softc **); +static int ar_lsi_write_conf(struct ar_softc *); static int ar_promise_read_conf(struct ad_softc *, struct ar_softc **, int); static int ar_promise_write_conf(struct ar_softc *); static int ar_rw(struct ad_softc *, u_int32_t, int, caddr_t, int); @@ -121,6 +123,9 @@ case ATA_HIGHPOINT_ID: return (ar_highpoint_read_conf(adp, ar_table)); + case ATA_SILICON_IMAGE_ID: + return (ar_lsi_read_conf(adp, ar_table)); + default: return (ar_promise_read_conf(adp, ar_table, 1)); } @@ -325,6 +330,12 @@ AD_SOFTC(rdp->disks[disk])->total_secs; break; + case ATA_SILICON_IMAGE_ID: + ctlr |= AR_F_LSI_RAID; + rdp->disks[disk].disk_sectors = + AD_SOFTC(rdp->disks[disk])->total_secs - 4208; /* SOS */ + break; + default: ctlr |= AR_F_FREEBSD_RAID; /* FALLTHROUGH */ @@ -336,9 +347,12 @@ break; } - if (rdp->flags & (AR_F_PROMISE_RAID|AR_F_HIGHPOINT_RAID) && - (rdp->flags & (AR_F_PROMISE_RAID|AR_F_HIGHPOINT_RAID)) != - (ctlr & (AR_F_PROMISE_RAID|AR_F_HIGHPOINT_RAID))) { + if ((rdp->flags & + (AR_F_PROMISE_RAID | AR_F_LSI_RAID | AR_F_HIGHPOINT_RAID)) && + (rdp->flags & + (AR_F_PROMISE_RAID | AR_F_LSI_RAID | AR_F_HIGHPOINT_RAID)) != + (ctlr & + (AR_F_PROMISE_RAID | AR_F_LSI_RAID | AR_F_HIGHPOINT_RAID))) { free(rdp, M_AR); return EXDEV; } @@ -397,10 +411,12 @@ while (setup->interleave >>= 1) bit++; + if (rdp->flags & AR_F_HIGHPOINT_RAID) + rdp->interleave = min(max(32, 1 << bit), 128); + if (rdp->flags & AR_F_LSI_RAID) + rdp->interleave = min(max(2, 1 << bit), 4096); if (rdp->flags & AR_F_PROMISE_RAID) rdp->interleave = min(max(2, 1 << bit), 2048); - if (rdp->flags & AR_F_HIGHPOINT_RAID) - rdp->interleave = min(max(32, 1 << bit), 128); } rdp->total_disks = total_disks; rdp->width = total_disks / ((rdp->flags & AR_F_RAID1) ? 2 : 1); @@ -456,10 +472,14 @@ rdp->disks[disk].flags = 0; } } + + if (rdp->flags & AR_F_HIGHPOINT_RAID) + ar_highpoint_write_conf(rdp); + if (rdp->flags & AR_F_LSI_RAID) + ar_lsi_write_conf(rdp); if (rdp->flags & AR_F_PROMISE_RAID) ar_promise_write_conf(rdp); - else - ar_highpoint_write_conf(rdp); + disk_destroy(rdp->disk); free(rdp, M_AR); ar_table[array] = NULL; @@ -979,10 +999,12 @@ } } if (writeback) { + if (rdp->flags & AR_F_HIGHPOINT_RAID) + ar_highpoint_write_conf(rdp); + if (rdp->flags & AR_F_LSI_RAID) + ar_lsi_write_conf(rdp); if (rdp->flags & AR_F_PROMISE_RAID) ar_promise_write_conf(rdp); - if (rdp->flags & AR_F_HIGHPOINT_RAID) - ar_highpoint_write_conf(rdp); } } @@ -1134,7 +1156,7 @@ } } raid = raidp[array]; - if (raid->flags & AR_F_PROMISE_RAID) + if (raid->flags & (AR_F_PROMISE_RAID | AR_F_LSI_RAID)) continue; switch (info->type) { @@ -1197,6 +1219,8 @@ default: printf("ar%d: HighPoint unknown RAID type 0x%02x\n", array, info->type); + free(raidp[array], M_AR); + raidp[array] = NULL; goto highpoint_out; } @@ -1229,6 +1253,7 @@ retval = 1; break; } + highpoint_out: free(info, M_AR); return retval; @@ -1321,6 +1346,216 @@ } static int +ar_lsi_read_conf(struct ad_softc *adp, struct ar_softc **raidp) +{ + struct lsi_raid_conf *info; + struct ar_softc *raid = NULL; + int array, retval = 0; + + if (!(info = (struct lsi_raid_conf *) + malloc(sizeof(struct lsi_raid_conf), M_AR, M_NOWAIT | M_ZERO))) + return retval; + + if (ar_rw(adp, LSI_LBA(adp), sizeof(struct lsi_raid_conf), + (caddr_t)info, AR_READ | AR_WAIT)) { + if (1 || bootverbose) + printf("ar: LSI read conf failed\n"); + goto lsi_out; + } + + /* check if this is a LSI RAID struct */ + if (strncmp(info->lsi_id, LSI_MAGIC, strlen(LSI_MAGIC))) { + if (1 || bootverbose) + printf("ar: LSI check1 failed\n"); + goto lsi_out; + } + + /* now convert LSI config info into our generic form */ + for (array = 0; array < MAX_ARRAYS; array++) { + int raid_entry, conf_entry; + + if (!raidp[array + info->raid_number]) { + raidp[array + info->raid_number] = + (struct ar_softc*)malloc(sizeof(struct ar_softc), M_AR, + M_NOWAIT | M_ZERO); + if (!raidp[array + info->raid_number]) { + printf("ar%d: failed to allocate raid config storage\n", array); + goto lsi_out; + } + } + raid = raidp[array + info->raid_number]; + + if (raid->flags & (AR_F_PROMISE_RAID | AR_F_HIGHPOINT_RAID)) + continue; + + if (raid->magic_0 && + ((raid->magic_0 != info->timestamp) || + (raid->magic_1 != info->raid_number))) + continue; + + array += info->raid_number; + + raid_entry = info->raid_number; + conf_entry = (info->configs[raid_entry].raid.config_offset >> 4) + + info->disk_number - 1; + + switch (info->configs[raid_entry].raid.type) { + case LSI_R_RAID0: + raid->magic_0 = info->timestamp; + raid->magic_1 = info->raid_number; + raid->flags |= AR_F_RAID0; + raid->interleave = info->configs[raid_entry].raid.stripe_size; + raid->width = info->configs[raid_entry].raid.raid_width; + break; + + case LSI_R_RAID1: + raid->magic_0 = info->timestamp; + raid->magic_1 = info->raid_number; + raid->flags |= AR_F_RAID1; + raid->width = info->configs[raid_entry].raid.raid_width; + break; + + case LSI_R_RAID0 | LSI_R_RAID1: + raid->magic_0 = info->timestamp; + raid->magic_1 = info->raid_number; + raid->flags |= (AR_F_RAID0 | AR_F_RAID1); + raid->interleave = info->configs[raid_entry].raid.stripe_size; + raid->width = info->configs[raid_entry].raid.raid_width; + break; + + default: + printf("ar%d: LSI unknown RAID type 0x%02x\n", + array, info->configs[raid_entry].raid.type); + free(raidp[array], M_AR); + raidp[array] = NULL; + goto lsi_out; + } + + /* setup RAID specifics */ + raid->flags |= AR_F_LSI_RAID; + raid->generation = 0; + raid->total_disks = info->configs[raid_entry].raid.disk_count; + raid->heads = 255; + raid->sectors = 63; + raid->cylinders = info->configs[raid_entry].raid.total_sectors/(63*255); + raid->total_sectors = info->configs[raid_entry].raid.total_sectors; + raid->offset = 0; + raid->reserved = 1; + raid->lock_start = raid->lock_end = 0; + raid->lun = array; + + /* setup RAID specifics of this disk */ + if (info->configs[conf_entry].disk.device != LSI_D_NONE) { + raid->disks[info->disk_number].device = adp->device; + raid->disks[info->disk_number].disk_sectors = + info->configs[conf_entry].disk.disk_sectors; + raid->disks[info->disk_number].flags = + (AR_DF_ONLINE | AR_DF_PRESENT | AR_DF_ASSIGNED); + AD_SOFTC(raid->disks[info->disk_number])->flags |= + AD_F_RAID_SUBDISK; + retval = 1; + } + else + raid->disks[info->disk_number].flags &= ~AR_DF_ONLINE; + + return retval; + } + +lsi_out: + free(info, M_AR); + return retval; +} + +static int +ar_lsi_write_conf(struct ar_softc *rdp) +{ + struct lsi_raid_conf *config; + struct timeval timestamp; + int disk, disk_entry; + + microtime(×tamp); + rdp->magic_0 = timestamp.tv_sec & 0xffffffc0; + rdp->magic_1 = 0; + + for (disk = 0; disk < rdp->total_disks; disk++) { + if (!(config = (struct lsi_raid_conf *) + malloc(sizeof(struct lsi_raid_conf), M_AR, M_NOWAIT | M_ZERO))) { + printf("ar%d: LSI write conf failed\n", rdp->lun); + return -1; + } + + bcopy(LSI_MAGIC, config->lsi_id, strlen(LSI_MAGIC)); + config->dummy_1 = 0x10; + config->flags = 0x19; /* SOS X */ + config->version[0] = '2'; + config->version[1] = '0'; + config->config_entries = 2 + rdp->total_disks; + config->raid_count = 1; + config->total_disks = rdp->total_disks; + config->dummy_e = 0xfc; + config->disk_number = disk; + config->raid_number = 0; + config->timestamp = rdp->magic_0; + + switch (rdp->flags & (AR_F_RAID0 | AR_F_RAID1 | AR_F_SPAN)) { + case AR_F_RAID0: + config->configs[0].raid.type = LSI_R_RAID0; + break; + + case AR_F_RAID1: + config->configs[0].raid.type = LSI_R_RAID1; + break; + + case AR_F_RAID0 | AR_F_RAID1: + config->flags = 0x15; /* SOS X */ + config->configs[0].raid.type = (LSI_R_RAID0 | LSI_R_RAID1); + break; + + default: + return -1; + } + + config->configs[0].raid.dummy_1 = 0x10; + config->configs[0].raid.stripe_size = rdp->interleave; + config->configs[0].raid.raid_width = rdp->width; + config->configs[0].raid.disk_count = rdp->total_disks; + config->configs[0].raid.config_offset = 2 * 0x10; + config->configs[0].raid.total_sectors = rdp->total_sectors; + + for (disk_entry = 0; disk_entry < rdp->total_disks; disk_entry++) { + if (rdp->disks[disk_entry].flags & AR_DF_ONLINE) + config->configs[1 + disk_entry].disk.device = + (rdp->disks[disk_entry].device->channel->unit ? + LSI_D_CHANNEL1 : LSI_D_CHANNEL0) | + (rdp->disks[disk_entry].device->unit ? + LSI_D_SLAVE : LSI_D_MASTER); + else { + config->configs[1 + disk_entry].disk.device = LSI_D_NONE; + config->configs[1 + disk_entry].disk.flags = LSI_D_GONE; + } + config->configs[1 + disk_entry].disk.dummy_1 = 0x10; + config->configs[1 + disk_entry].disk.disk_sectors = + rdp->disks[disk_entry].disk_sectors; + config->configs[1 + disk_entry].disk.disk_number = disk_entry; + config->configs[1 + disk_entry].disk.raid_number = 0; + } + + if ((rdp->disks[disk].device && rdp->disks[disk].device->softc) && + !(rdp->disks[disk].device->flags & ATA_D_DETACHING)) { + + if (ar_rw(AD_SOFTC(rdp->disks[disk]), + LSI_LBA(AD_SOFTC(rdp->disks[disk])), + sizeof(struct lsi_raid_conf), + (caddr_t)config, AR_WRITE)) { + printf("ar%d: LSI write conf failed\n", rdp->lun); + return -1; + } + } + } + return 0; +} + +static int ar_promise_read_conf(struct ad_softc *adp, struct ar_softc **raidp, int local) { struct promise_raid_conf *info; @@ -1341,14 +1576,14 @@ /* check if this is a Promise RAID struct (or our local one) */ if (local) { - if (strncmp(info->promise_id, ATA_MAGIC, sizeof(ATA_MAGIC))) { + if (strncmp(info->promise_id, ATA_MAGIC, strlen(ATA_MAGIC))) { if (bootverbose) printf("ar: FreeBSD check1 failed\n"); goto promise_out; } } else { - if (strncmp(info->promise_id, PR_MAGIC, sizeof(PR_MAGIC))) { + if (strncmp(info->promise_id, PR_MAGIC, strlen(PR_MAGIC))) { if (bootverbose) printf("ar: Promise check1 failed\n"); goto promise_out; @@ -1382,7 +1617,7 @@ } } raid = raidp[array]; - if (raid->flags & AR_F_HIGHPOINT_RAID) + if (raid->flags & (AR_F_LSI_RAID | AR_F_HIGHPOINT_RAID)) continue; magic = (pci_get_device(device_get_parent( @@ -1428,6 +1663,8 @@ default: printf("ar%d: %s unknown RAID type 0x%02x\n", array, local ? "FreeBSD" : "Promise", info->raid.type); + free(raidp[array], M_AR); + raidp[array] = NULL; goto promise_out; } raid->interleave = 1 << info->raid.stripe_shift; ==== //depot/projects/netperf_socket/sys/dev/ata/ata-raid.h#3 (text+ko) ==== @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/ata/ata-raid.h,v 1.26 2004/02/18 21:36:51 phk Exp $ + * $FreeBSD: src/sys/dev/ata/ata-raid.h,v 1.27 2004/06/25 21:21:59 sos Exp $ */ /* misc defines */ @@ -55,17 +55,25 @@ int32_t magic_0; /* ident for this array */ int32_t magic_1; /* ident for this array */ int flags; -#define AR_F_RAID0 0x0001 /* STRIPE */ -#define AR_F_RAID1 0x0002 /* MIRROR */ -#define AR_F_SPAN 0x0004 /* SPAN */ -#define AR_F_READY 0x0100 -#define AR_F_DEGRADED 0x0200 -#define AR_F_REBUILDING 0x0400 -#define AR_F_PROMISE_RAID 0x1000 -#define AR_F_HIGHPOINT_RAID 0x2000 -#define AR_F_FREEBSD_RAID 0x4000 -#define AR_F_TOGGLE 0x8000 - +#define AR_F_SPAN 0x00000001 +#define AR_F_RAID0 0x00000002 +#define AR_F_RAID1 0x00000004 +#define AR_F_RAID3 0x00000008 +#define AR_F_RAID5 0x00000010 + +#define AR_F_READY 0x00000100 +#define AR_F_DEGRADED 0x00000200 +#define AR_F_REBUILDING 0x00000400 +#define AR_F_TOGGLE 0x00000800 + +#define AR_F_FREEBSD_RAID 0x00010000 +#define AR_F_PROMISE_RAID 0x00020000 +#define AR_F_HIGHPOINT_RAID 0x00040000 +#define AR_F_ADAPTEC_RAID 0x00080000 +#define AR_F_LSI_RAID 0x00100000 +#define AR_F_INTEL_RAID 0x00200000 +#define AR_F_QTEC_RAID 0x00400000 + int total_disks; /* number of disks in this array */ int generation; /* generation of this array */ struct ar_disk disks[MAX_DISKS+1]; /* ptr to each disk in array */ @@ -92,11 +100,12 @@ #define AB_F_DONE 0x01 }; + #define HPT_LBA 9 struct highpoint_raid_conf { int8_t filler1[32]; - u_int32_t magic; /* 0x20 */ + u_int32_t magic; #define HPT_MAGIC_OK 0x5a7816f0 #define HPT_MAGIC_BAD 0x5a7816fd @@ -148,6 +157,66 @@ } __packed; +#define LSI_LBA(adp) (adp->total_secs - 1) + +struct lsi_raid_conf { + u_int8_t lsi_id[6]; +#define LSI_MAGIC "$XIDE$" + + u_int8_t dummy_1; + u_int8_t flags; + u_int8_t version[2]; + u_int8_t config_entries; + u_int8_t raid_count; + u_int8_t total_disks; + u_int8_t dummy_d; + u_int8_t dummy_e; + u_int8_t dummy_f; + + union { + struct { + u_int8_t type; +#define LSI_R_RAID0 0x01 +#define LSI_R_RAID1 0x02 +#define LSI_R_SPARE 0x08 + + u_int8_t dummy_1; + u_int16_t stripe_size; + u_int8_t raid_width; + u_int8_t disk_count; + u_int8_t config_offset; + u_int8_t dummy_7; + u_int8_t flags; +#define LSI_R_DEGRADED 0x02 + + u_int32_t total_sectors; + u_int8_t filler[3]; + } __packed raid; + struct { + u_int8_t device; +#define LSI_D_MASTER 0x00 +#define LSI_D_SLAVE 0x01 +#define LSI_D_CHANNEL0 0x00 +#define LSI_D_CHANNEL1 0x10 +#define LSI_D_NONE 0xff + + u_int8_t dummy_1; + u_int32_t disk_sectors; + u_int8_t disk_number; + u_int8_t raid_number; + u_int8_t flags; +#define LSI_D_GONE 0x02 + + u_int8_t filler[7]; + } __packed disk; + } configs[30]; + u_int8_t disk_number; + u_int8_t raid_number; + u_int32_t timestamp; + u_int8_t filler[10]; +} __packed; + + #define PR_LBA(adp) \ (((adp->total_secs / (adp->heads * adp->sectors)) * \ adp->heads * adp->sectors) - adp->sectors) @@ -164,7 +233,7 @@ u_int32_t magic_2; u_int8_t filler1[470]; struct { - u_int32_t integrity; /* 0x200 */ + u_int32_t integrity; #define PR_I_VALID 0x00000080 u_int8_t flags; @@ -181,7 +250,7 @@ u_int8_t channel; u_int8_t device; u_int64_t magic_0 __packed; - u_int32_t disk_offset; /* 0x210 */ + u_int32_t disk_offset; u_int32_t disk_sectors; u_int32_t rebuild_lba; u_int16_t generation; @@ -201,7 +270,7 @@ #define PR_T_RAID5 0x04 #define PR_T_SPAN 0x08 - u_int8_t total_disks; /* 0x220 */ + u_int8_t total_disks; u_int8_t stripe_shift; u_int8_t array_width; u_int8_t array_number; @@ -210,7 +279,7 @@ u_int8_t heads; u_int8_t sectors; int64_t magic_1 __packed; - struct { /* 0x240 */ + struct { u_int8_t flags; u_int8_t dummy_0; u_int8_t channel; ==== //depot/projects/netperf_socket/sys/dev/cp/if_cp.c#6 (text+ko) ==== @@ -22,7 +22,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/cp/if_cp.c,v 1.8 2004/06/23 18:13:09 rik Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/cp/if_cp.c,v 1.9 2004/06/25 19:22:03 julian Exp $"); #include <sys/param.h> @@ -2261,7 +2261,7 @@ { drv_t *d = NG_NODE_PRIVATE (NG_HOOK_NODE(hook)); struct mbuf *m; - meta_p meta; + struct ng_tag_prio *ptag; #else static int ng_cp_rcvdata (hook_p hook, struct mbuf *m, meta_p meta) { @@ -2273,18 +2273,23 @@ CP_DEBUG2 (d, ("Rcvdata\n")); #if __FreeBSD_version >= 500000 NGI_GET_M (item, m); - NGI_GET_META (item, meta); NG_FREE_ITEM (item); if (! NG_HOOK_PRIVATE (hook) || ! d) { NG_FREE_M (m); - NG_FREE_META (meta); #else if (! hook->private || ! d) { NG_FREE_DATA (m,meta); #endif return ENETDOWN; } - q = (meta && meta->priority > 0) ? &d->hi_queue : &d->queue; + + /* Check for high priority data */ + if ((ptag = (struct ng_tag_prio *)m_tag_locate(m, NGM_GENERIC_COOKIE, + NG_TAG_PRIO, NULL)) != NULL && (ptag->priority > NG_PRIO_CUTOFF) ) + q = &d->hi_queue; + else + q = &d->queue; + s = splimp (); #if __FreeBSD_version >= 500000 IF_LOCK (q); @@ -2293,7 +2298,6 @@ IF_UNLOCK (q); splx (s); NG_FREE_M (m); - NG_FREE_META (meta); return ENOBUFS; } _IF_ENQUEUE (q, m); ==== //depot/projects/netperf_socket/sys/dev/ctau/if_ct.c#7 (text+ko) ==== @@ -22,7 +22,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ctau/if_ct.c,v 1.10 2004/06/23 18:13:10 rik Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ctau/if_ct.c,v 1.11 2004/06/25 19:22:04 julian Exp $"); #include <sys/param.h> @@ -2187,7 +2187,7 @@ { drv_t *d = NG_NODE_PRIVATE (NG_HOOK_NODE(hook)); struct mbuf *m; - meta_p meta; + struct ng_tag_prio *ptag; #else static int ng_ct_rcvdata (hook_p hook, struct mbuf *m, meta_p meta) { @@ -2201,18 +2201,23 @@ #if __FreeBSD_version >= 500000 NGI_GET_M (item, m); - NGI_GET_META (item, meta); NG_FREE_ITEM (item); if (! NG_HOOK_PRIVATE (hook) || ! d) { NG_FREE_M (m); - NG_FREE_META (meta); #else if (! hook->private || ! d) { NG_FREE_DATA (m,meta); #endif return ENETDOWN; } - q = (meta && meta->priority > 0) ? &d->hi_queue : &d->queue; + + /* Check for high priority data */ + if ((ptag = (struct ng_tag_prio *)m_tag_locate(m, NGM_GENERIC_COOKIE, + NG_TAG_PRIO, NULL)) != NULL && (ptag->priority > NG_PRIO_CUTOFF) ) + q = &d->hi_queue; + else + q = &d->queue; + s = splimp (); #if __FreeBSD_version >= 500000 IF_LOCK (q); @@ -2221,7 +2226,6 @@ IF_UNLOCK (q); splx (s); NG_FREE_M (m); - NG_FREE_META (meta); return ENOBUFS; } _IF_ENQUEUE (q, m); ==== //depot/projects/netperf_socket/sys/dev/cx/if_cx.c#10 (text+ko) ==== @@ -23,7 +23,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/cx/if_cx.c,v 1.23 2004/06/23 18:13:10 rik Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/cx/if_cx.c,v 1.24 2004/06/25 19:22:04 julian Exp $"); #include <sys/param.h> @@ -2705,7 +2705,7 @@ { drv_t *d = NG_NODE_PRIVATE (NG_HOOK_NODE(hook)); struct mbuf *m; - meta_p meta; + struct ng_tag_prio *ptag; #else static int ng_cx_rcvdata (hook_p hook, struct mbuf *m, meta_p meta) { @@ -2716,18 +2716,23 @@ #if __FreeBSD_version >= 500000 NGI_GET_M (item, m); - NGI_GET_META (item, meta); NG_FREE_ITEM (item); if (! NG_HOOK_PRIVATE (hook) || ! d) { NG_FREE_M (m); - NG_FREE_META (meta); #else if (! hook->private || ! d) { NG_FREE_DATA (m,meta); #endif return ENETDOWN; } - q = (meta && meta->priority > 0) ? &d->hi_queue : &d->lo_queue; + + /* Check for high priority data */ + if ((ptag = (struct ng_tag_prio *)m_tag_locate(m, NGM_GENERIC_COOKIE, + NG_TAG_PRIO, NULL)) != NULL && (ptag->priority > NG_PRIO_CUTOFF) ) + q = &d->hi_queue; + else + q = &d->lo_queue; + s = splhigh (); #if __FreeBSD_version >= 500000 IF_LOCK (q); @@ -2736,7 +2741,6 @@ IF_UNLOCK (q); splx (s); NG_FREE_M (m); - NG_FREE_META (meta); return ENOBUFS; } _IF_ENQUEUE (q, m); ==== //depot/projects/netperf_socket/sys/dev/cy/cy.c#9 (text+ko) ==== @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/cy/cy.c,v 1.155 2004/06/22 20:32:16 phk Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/cy/cy.c,v 1.156 2004/06/26 09:20:05 phk Exp $"); #include "opt_compat.h" @@ -271,7 +271,6 @@ u_char last_modem_status; /* last MSR read by intr handler */ u_char prev_modem_status; /* last MSR handled by high level */ - u_char hotchar; /* ldisc-specific char to be handled ASAP */ u_char *ibuf; /* start of input buffer */ u_char *ibufend; /* end of input buffer */ u_char *ibufold; /* old input buffer, to be freed */ @@ -1111,7 +1110,7 @@ recv_data = cd_inb(iobase, CD1400_RDSR, cy_align); #ifndef SOFT_HOTCHAR if (line_status & CD1400_RDSR_SPECIAL - && com->hotchar != 0) + && com->tp->t_hotchar != 0) swi_sched(sio_fast_ih, 0); #endif @@ -1139,7 +1138,7 @@ #endif /* 1 */ ++com->bytes_in; #ifdef SOFT_HOTCHAR - if (com->hotchar != 0 && recv_data == com->hotchar) + if (com->tp->t_hotchar != 0 && recv_data == com->tp->t_hotchar) swi_sched(sio_fast_ih, 0); #endif ioptr = com->iptr; @@ -1187,9 +1186,9 @@ CD1400_RDSR, cy_align); #ifdef SOFT_HOTCHAR - if (com->hotchar != 0 + if (com->tp->t_hotchar != 0 && recv_data - == com->hotchar) + == com->tp->t_hotchar) swi_sched(sio_fast_ih, 0); #endif @@ -1204,8 +1203,8 @@ recv_data = cd_inb(iobase, CD1400_RDSR, cy_align); #ifdef SOFT_HOTCHAR - if (com->hotchar != 0 - && recv_data == com->hotchar) + if (com->tp->t_hotchar != 0 + && recv_data == com->tp->t_hotchar) swi_sched(sio_fast_ih, 0); #endif } while (--count != 0); @@ -1229,8 +1228,8 @@ recv_data = cd_inb(iobase, CD1400_RDSR, cy_align); #ifdef SOFT_HOTCHAR - if (com->hotchar != 0 >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200406261643.i5QGhgg7068568>