Date: Sun, 13 Jun 2004 18:50:10 GMT From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 54837 for review Message-ID: <200406131850.i5DIoAJ2022676@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=54837 Change 54837 by rwatson@rwatson_tislabs on 2004/06/13 18:50:09 Integrate netperf_socket: - ALTQ integration - Proper RFC IP over Firewire Affected files ... .. //depot/projects/netperf_socket/sys/conf/NOTES#21 integrate .. //depot/projects/netperf_socket/sys/conf/files#26 integrate .. //depot/projects/netperf_socket/sys/conf/kern.pre.mk#11 integrate .. //depot/projects/netperf_socket/sys/conf/kmod.mk#9 integrate .. //depot/projects/netperf_socket/sys/conf/options#14 integrate .. //depot/projects/netperf_socket/sys/dev/aac/aac_debug.c#3 integrate .. //depot/projects/netperf_socket/sys/dev/acpica/acpi.c#21 integrate .. //depot/projects/netperf_socket/sys/dev/acpica/acpivar.h#13 integrate .. //depot/projects/netperf_socket/sys/dev/awi/awi.c#4 integrate .. //depot/projects/netperf_socket/sys/dev/esp/ncr53c9x.c#3 integrate .. //depot/projects/netperf_socket/sys/dev/esp/ncr53c9xvar.h#3 integrate .. //depot/projects/netperf_socket/sys/dev/firewire/if_fwip.c#1 branch .. //depot/projects/netperf_socket/sys/dev/firewire/if_fwipvar.h#1 branch .. //depot/projects/netperf_socket/sys/dev/ichwd/ichwd.c#3 integrate .. //depot/projects/netperf_socket/sys/dev/pdq/pdq_freebsd.h#2 integrate .. //depot/projects/netperf_socket/sys/dev/usb/if_udav.c#5 integrate .. //depot/projects/netperf_socket/sys/dev/wi/if_wi.c#5 integrate .. //depot/projects/netperf_socket/sys/i4b/driver/i4b_ipr.c#2 integrate .. //depot/projects/netperf_socket/sys/net/firewire.h#1 branch .. //depot/projects/netperf_socket/sys/net/if.c#9 integrate .. //depot/projects/netperf_socket/sys/net/if_arp.h#4 integrate .. //depot/projects/netperf_socket/sys/net/if_fwsubr.c#1 branch .. //depot/projects/netperf_socket/sys/net/if_ppp.c#5 integrate .. //depot/projects/netperf_socket/sys/net/if_sl.c#5 integrate .. //depot/projects/netperf_socket/sys/net/if_spppsubr.c#5 integrate .. //depot/projects/netperf_socket/sys/net/if_var.h#11 integrate .. //depot/projects/netperf_socket/sys/net80211/ieee80211_input.c#3 integrate .. //depot/projects/netperf_socket/sys/netgraph/ng_rfc1490.c#3 integrate .. //depot/projects/netperf_socket/sys/netgraph/ng_rfc1490.h#2 integrate .. //depot/projects/netperf_socket/sys/netinet/if_ether.c#9 integrate .. //depot/projects/netperf_socket/sys/netinet/ip_input.c#12 integrate .. //depot/projects/netperf_socket/sys/netinet/ip_output.c#11 integrate .. //depot/projects/netperf_socket/sys/netinet6/ip6_input.c#7 integrate .. //depot/projects/netperf_socket/sys/pci/if_mn.c#4 integrate .. //depot/projects/netperf_socket/sys/sys/param.h#11 integrate Differences ... ==== //depot/projects/netperf_socket/sys/conf/NOTES#21 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/NOTES,v 1.1230 2004/06/11 11:16:19 phk Exp $ +# $FreeBSD: src/sys/conf/NOTES,v 1.1232 2004/06/13 17:29:06 mlaier Exp $ # # NOTES -- Lines that can be cut/pasted into kernel and hints configs. # @@ -399,6 +399,20 @@ # mchain library. It can be either loaded as KLD or compiled into kernel options LIBMCHAIN +# altq(9). Enable the base part of the hooks with the ALTQ option. +# Individual disciplines must be built into the base system and can not be +# loaded as modules at this point. In order to build a SMP kernel you must +# also have the ALTQ_NOPCC option. +options ALTQ +options ALTQ_CBQ # Class Bases Queueing +options ALTQ_RED # Random Early Drop +options ALTQ_RIO # RED In/Out +options ALTQ_HFSC # Hierarchical Packet Scheduler +options ALTQ_CDNR # Traffic conditioner +options ALTQ_PRIQ # Prioirity Queueing +options ALTQ_NOPCC # Required for SMP build +options ALTQ_DEBUG + # netgraph(4). Enable the base netgraph code with the NETGRAPH option. # Individual node types can be enabled with the corresponding option # listed below; however, this is not strictly necessary as netgraph @@ -2226,6 +2240,7 @@ device sbp # SCSI over Firewire (Requires scbus and da) device sbp_targ # SBP-2 Target mode (Requires scbus and targ) device fwe # Ethernet over FireWire (non-standard!) +device fwip # IP over FireWire (rfc2734 and rfc3146) ##################################################################### # dcons support (Dumb Console Device) ==== //depot/projects/netperf_socket/sys/conf/files#26 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/files,v 1.903 2004/06/10 05:21:44 scottl Exp $ +# $FreeBSD: src/sys/conf/files,v 1.905 2004/06/13 17:29:06 mlaier Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -85,6 +85,14 @@ coda/coda_vfsops.c optional vcoda coda/coda_vnops.c optional vcoda compat/linprocfs/linprocfs.c optional linprocfs +contrib/altq/altq/altq_cbq.c optional altq +contrib/altq/altq/altq_cdnr.c optional altq +contrib/altq/altq/altq_hfsc.c optional altq +contrib/altq/altq/altq_priq.c optional altq +contrib/altq/altq/altq_red.c optional altq +contrib/altq/altq/altq_rio.c optional altq +contrib/altq/altq/altq_rmclass.c optional altq +contrib/altq/altq/altq_subr.c optional altq contrib/dev/acpica/dbcmds.c optional acpi acpi_debug contrib/dev/acpica/dbdisply.c optional acpi acpi_debug contrib/dev/acpica/dbexec.c optional acpi acpi_debug @@ -447,6 +455,7 @@ dev/firewire/fwohci.c optional firewire dev/firewire/fwohci_pci.c optional firewire pci dev/firewire/if_fwe.c optional fwe +dev/firewire/if_fwip.c optional fwip dev/firewire/sbp.c optional sbp dev/firewire/sbp_targ.c optional sbp_targ dev/fxp/if_fxp.c optional fxp @@ -1216,6 +1225,7 @@ net/if_ethersubr.c optional ether net/if_faith.c optional faith net/if_fddisubr.c optional fddi +net/if_fwsubr.c optional firewire net/if_gif.c optional gif net/if_gre.c optional gre net/if_iso88025subr.c optional token ==== //depot/projects/netperf_socket/sys/conf/kern.pre.mk#11 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/kern.pre.mk,v 1.52 2004/04/27 16:38:13 emax Exp $ +# $FreeBSD: src/sys/conf/kern.pre.mk,v 1.53 2004/06/13 17:29:06 mlaier Exp $ # Part of a unified Makefile for building kernels. This part contains all # of the definitions that need to be before %BEFORE_DEPEND. @@ -51,6 +51,9 @@ # include path into 100+ source files. INCLUDES+= -I$S/contrib/dev/acpica +# ... and the same for altq +INCLUDES+= -I$S/contrib/altq + # ... and the same for ipfilter INCLUDES+= -I$S/contrib/ipfilter ==== //depot/projects/netperf_socket/sys/conf/kmod.mk#9 (text+ko) ==== @@ -1,5 +1,5 @@ # From: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91 -# $FreeBSD: src/sys/conf/kmod.mk,v 1.160 2004/06/09 16:08:20 imp Exp $ +# $FreeBSD: src/sys/conf/kmod.mk,v 1.161 2004/06/13 17:29:06 mlaier Exp $ # # The include file <bsd.kmod.mk> handles installing Kernel Loadable Device # drivers (KLD's). @@ -96,6 +96,10 @@ # set because there are no standard paths for non-headers. CFLAGS+= -I. -I@ +# Add -I path for altq headers as they are included via net/if_var.h +# for example. +CFLAGS+= -I@/contrib/altq + # Add a -I path to standard headers like <stddef.h>. Use a relative # path to src/include if possible. If the @ symlink hasn't been built # yet, then we can't tell if the relative path exists. Add both the ==== //depot/projects/netperf_socket/sys/conf/options#14 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/options,v 1.452 2004/06/11 11:16:19 phk Exp $ +# $FreeBSD: src/sys/conf/options,v 1.453 2004/06/13 17:29:06 mlaier Exp $ # # On the handling of kernel options # @@ -294,6 +294,15 @@ # Net stuff. ACCEPT_FILTER_DATA ACCEPT_FILTER_HTTP +ALTQ opt_global.h +ALTQ_CBQ opt_altq.h +ALTQ_RED opt_altq.h +ALTQ_RIO opt_altq.h +ALTQ_HFSC opt_altq.h +ALTQ_CDNR opt_altq.h +ALTQ_PRIQ opt_altq.h +ALTQ_NOPCC opt_altq.h +ALTQ_DEBUG opt_altq.h BOOTP opt_bootp.h BOOTP_COMPAT opt_bootp.h BOOTP_NFSROOT opt_bootp.h ==== //depot/projects/netperf_socket/sys/dev/aac/aac_debug.c#3 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/aac/aac_debug.c,v 1.18 2004/02/07 20:54:29 scottl Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/aac/aac_debug.c,v 1.19 2004/06/13 17:57:15 obrien Exp $"); /* * Debugging support. @@ -366,10 +366,10 @@ break; case AifEnDiskSetEvent: /* A disk set event occured. */ device_printf(sc->aac_dev, "(DiskSetEvent) event %d " - "diskset %lld creator %lld\n", + "diskset %jd creator %jd\n", aif->data.EN.data.EDS.eventType, - (long long)aif->data.EN.data.EDS.DsNum, - (long long)aif->data.EN.data.EDS.CreatorId); + (intmax_t)aif->data.EN.data.EDS.DsNum, + (intmax_t)aif->data.EN.data.EDS.CreatorId); break; case AifDenMorphComplete: /* A morph operation * completed */ ==== //depot/projects/netperf_socket/sys/dev/acpica/acpi.c#21 (text+ko) ==== @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/acpica/acpi.c,v 1.157 2004/06/05 09:56:04 njl Exp $ + * $FreeBSD: src/sys/dev/acpica/acpi.c,v 1.158 2004/06/13 17:29:35 njl Exp $ */ #include "opt_acpi.h" @@ -1125,7 +1125,10 @@ child = BUS_ADD_CHILD(bus, level * 10, NULL, -1); if (child == NULL) break; + + /* Associate the handle with the device_t and vice versa. */ acpi_set_handle(child, handle); + AcpiAttachData(handle, acpi_fake_objhandler, child); /* Check if the device can generate wake events. */ if (ACPI_SUCCESS(AcpiEvaluateObject(handle, "_PRW", NULL, NULL))) @@ -1159,6 +1162,15 @@ return_ACPI_STATUS (AE_OK); } +/* + * AcpiAttachData() requires an object handler but never uses it. This is a + * placeholder object handler so we can store a device_t in an ACPI_HANDLE. + */ +void +acpi_fake_objhandler(ACPI_HANDLE h, UINT32 fn, void *data) +{ +} + static void acpi_shutdown_pre_sync(void *arg, int howto) { ==== //depot/projects/netperf_socket/sys/dev/acpica/acpivar.h#13 (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/dev/acpica/acpivar.h,v 1.69 2004/05/28 07:15:55 njl Exp $ + * $FreeBSD: src/sys/dev/acpica/acpivar.h,v 1.70 2004/06/13 17:29:35 njl Exp $ */ #include "bus_if.h" @@ -174,6 +174,15 @@ __ACPI_BUS_ACCESSOR(acpi, magic, ACPI, MAGIC, int) __ACPI_BUS_ACCESSOR(acpi, private, ACPI, PRIVATE, void *) +void acpi_fake_objhandler(ACPI_HANDLE h, UINT32 fn, void *data); +static __inline device_t +acpi_get_device(ACPI_HANDLE handle) +{ + void *dev = NULL; + AcpiGetData(handle, acpi_fake_objhandler, &dev); + return ((device_t)dev); +} + static __inline ACPI_OBJECT_TYPE acpi_get_type(device_t dev) { ==== //depot/projects/netperf_socket/sys/dev/awi/awi.c#4 (text+ko) ==== @@ -89,7 +89,7 @@ __KERNEL_RCSID(0, "$NetBSD: awi.c,v 1.62 2004/01/16 14:13:15 onoe Exp $"); #endif #ifdef __FreeBSD__ -__FBSDID("$FreeBSD: src/sys/dev/awi/awi.c,v 1.32 2004/04/18 01:05:02 onoe Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/awi/awi.c,v 1.33 2004/06/13 17:29:07 mlaier Exp $"); #endif #include "opt_inet.h" @@ -235,10 +235,12 @@ } #endif +#if 0 /* ALTQ */ #define IFQ_PURGE(ifq) IF_DRAIN(ifq) #define IF_POLL(ifq, m) ((m) = (ifq)->ifq_head) #define IFQ_POLL(ifq, m) IF_POLL((ifq), (m)) #define IFQ_DEQUEUE(ifq, m) IF_DEQUEUE((ifq), (m)) +#endif #endif ==== //depot/projects/netperf_socket/sys/dev/esp/ncr53c9x.c#3 (text+ko) ==== @@ -104,7 +104,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/esp/ncr53c9x.c,v 1.3 2004/06/12 05:19:17 scottl Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/esp/ncr53c9x.c,v 1.4 2004/06/13 09:08:44 scottl Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -117,7 +117,6 @@ #include <sys/queue.h> #include <sys/time.h> #include <sys/callout.h> -#include <vm/uma.h> #include <cam/cam.h> #include <cam/cam_ccb.h> @@ -185,9 +184,6 @@ ((ms +0u) * hz) /1000u) #endif -static int ecb_zone_initialized = 0; -static uma_zone_t ecb_zone; - /* * Names for the NCR53c9x variants, correspnding to the variant tags * in ncr53c9xvar.h. @@ -228,6 +224,8 @@ struct cam_devq *devq; struct cam_sim *sim; struct cam_path *path; + struct ncr53c9x_ecb *ecb; + int i; mtx_init(&sc->sc_lock, "ncr", "ncr53c9x lock", MTX_DEF); @@ -304,7 +302,8 @@ return (ENOMEM); sim = cam_sim_alloc(ncr53c9x_action, ncr53c9x_poll, "esp", sc, - device_get_unit(sc->sc_dev), 256, 256, devq); + device_get_unit(sc->sc_dev), 1, + NCR_TAG_DEPTH, devq); if (sim == NULL) { cam_simq_free(devq); return (ENOMEM); @@ -332,6 +331,19 @@ sc->sc_state = 0; ncr53c9x_init(sc, 1); + TAILQ_INIT(&sc->free_list); + if ((sc->ecb_array = malloc(sizeof(struct ncr53c9x_ecb) * NCR_TAG_DEPTH, + M_DEVBUF, M_NOWAIT|M_ZERO)) == NULL) { + device_printf(sc->sc_dev, "Cannot allocate ecb array!\n"); + return (ENOMEM); + } + for (i = 0; i < NCR_TAG_DEPTH; i++) { + ecb = &sc->ecb_array[i]; + ecb->sc = sc; + ecb->tag_id = i; + TAILQ_INSERT_HEAD(&sc->free_list, ecb, free_links); + } + callout_reset(&sc->sc_watchdog, 60*hz, ncr53c9x_watch, sc); return (0); @@ -453,14 +465,6 @@ NCR_MISC(("[NCR_INIT(%d) %d] ", doreset, sc->sc_state)); - if (!ecb_zone_initialized) { - /* All instances share this zone */ - ecb_zone = uma_zcreate("ncr53c9x ecb zone", - sizeof(struct ncr53c9x_ecb), NULL, NULL, - NULL, NULL, 0, 0); - ecb_zone_initialized = 1; - } - if (sc->sc_state == 0) { /* First time through; initialize. */ @@ -791,7 +795,7 @@ { ecb->flags = 0; - uma_zfree(ecb_zone, (void *)ecb); + TAILQ_INSERT_TAIL(&sc->free_list, ecb, free_links); return; } @@ -800,11 +804,14 @@ { struct ncr53c9x_ecb *ecb; - ecb = (struct ncr53c9x_ecb *)uma_zalloc(ecb_zone, M_NOWAIT); + ecb = TAILQ_FIRST(&sc->free_list); if (ecb) { - bzero(ecb, sizeof(struct ncr53c9x_ecb)); - ecb->flags |= ECB_ALLOC; - ecb->sc = sc; + if (ecb->flags != 0) + panic("ecb flags not cleared\n"); + TAILQ_REMOVE(&sc->free_list, ecb, free_links); + ecb->flags = ECB_ALLOC; + bzero(&ecb->ccb, sizeof(struct ncr53c9x_ecb) - + offsetof(struct ncr53c9x_ecb, ccb)); } return (ecb); } @@ -847,7 +854,7 @@ struct ccb_pathinq *cpi = &ccb->cpi; cpi->version_num = 1; - cpi->hba_inquiry = PI_SDTR_ABLE/*|PI_TAG_ABLE*/; + cpi->hba_inquiry = PI_SDTR_ABLE|PI_TAG_ABLE; cpi->hba_inquiry |= (sc->sc_rev == NCR_VARIANT_FAS366) ? PI_WIDE_16 : 0; cpi->target_sprt = 0; @@ -1000,6 +1007,7 @@ ti->flags &= ~T_WIDE; ti->width = 0; } + ti->flags |= T_NEGOTIATE; } if ((cts->valid & CCB_TRANS_SYNC_RATE_VALID) != 0) { @@ -1088,6 +1096,10 @@ tag = 0; else if ((ecb->flags & ECB_SENSE) != 0) tag = 0; + else if ((ecb->ccb->ccb_h.flags & CAM_TAG_ACTION_VALID) == 0) + tag = 0; + else if (ecb->ccb->csio.tag_action == CAM_TAG_ACTION_NONE) + tag = 0; else tag = ecb->ccb->csio.tag_action; @@ -1122,8 +1134,8 @@ } ecb->tag[0] = tag; if (tag != 0) { - li->queued[ecb->ccb->csio.tag_id] = ecb; - ecb->tag[1] = ecb->ccb->csio.tag_id; + li->queued[ecb->tag_id] = ecb; + ecb->tag[1] = ecb->tag_id; li->used++; } if (li->untagged != NULL && (li->busy != 1)) { @@ -1218,7 +1230,8 @@ if (ccb->ccb_h.status == CAM_REQ_CMP) { if ((ecb->flags & ECB_ABORT) != 0) { ccb->ccb_h.status = CAM_CMD_TIMEOUT; - } else if ((ecb->flags & ECB_SENSE) != 0) { + } else if ((ecb->flags & ECB_SENSE) != 0 && + (ecb->stat != SCSI_STATUS_CHECK_COND)) { ccb->ccb_h.status = CAM_AUTOSNS_VALID; } else if (ecb->stat == SCSI_STATUS_CHECK_COND) { if ((ecb->flags & ECB_SENSE) != 0) ==== //depot/projects/netperf_socket/sys/dev/esp/ncr53c9xvar.h#3 (text+ko) ==== @@ -66,7 +66,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* $FreeBSD: src/sys/dev/esp/ncr53c9xvar.h,v 1.2 2004/06/11 15:33:20 scottl Exp $ */ +/* $FreeBSD: src/sys/dev/esp/ncr53c9xvar.h,v 1.3 2004/06/13 09:08:44 scottl Exp $ */ #ifndef _DEV_IC_NCR53C9XVAR_H_ #define _DEV_IC_NCR53C9XVAR_H_ @@ -101,6 +101,9 @@ #define NCR_VARIANT_NCR53C90_86C01 10 #define NCR_VARIANT_MAX 11 +/* XXX Max tag depth. Should this be defined in the register header? */ +#define NCR_TAG_DEPTH 256 + /* * ECB. Holds additional information for each SCSI command Comments: We * need a separate scsi command block because we may need to overwrite it @@ -110,10 +113,14 @@ * occasionally xs->retries. */ struct ncr53c9x_ecb { - TAILQ_ENTRY(ncr53c9x_ecb) chain; - union ccb *ccb; /* SCSI xfer ctrl block from above */ + /* These fields are preserved between alloc and free */ struct ncr53c9x_softc *sc; + int tag_id; int flags; + + union ccb *ccb; /* SCSI xfer ctrl block from above */ + TAILQ_ENTRY(ncr53c9x_ecb) free_links; + TAILQ_ENTRY(ncr53c9x_ecb) chain; #define ECB_ALLOC 0x01 #define ECB_READY 0x02 #define ECB_SENSE 0x04 @@ -168,7 +175,7 @@ unsigned char avail; /* where to start scanning */ unsigned char busy; struct ncr53c9x_ecb *untagged; - struct ncr53c9x_ecb *queued[256]; + struct ncr53c9x_ecb *queued[NCR_TAG_DEPTH]; }; struct ncr53c9x_tinfo { @@ -348,6 +355,9 @@ int sc_extended_geom; /* Should we return extended geometry */ struct mtx sc_lock; /* driver mutex */ + + struct ncr53c9x_ecb *ecb_array; + TAILQ_HEAD(,ncr53c9x_ecb) free_list; }; /* values for sc_state */ ==== //depot/projects/netperf_socket/sys/dev/ichwd/ichwd.c#3 (text+ko) ==== @@ -54,7 +54,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ichwd/ichwd.c,v 1.3 2004/05/30 20:08:34 phk Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ichwd/ichwd.c,v 1.4 2004/06/13 05:00:19 jmg Exp $"); #include <sys/param.h> #include <sys/kernel.h> @@ -247,8 +247,10 @@ /* good, add child to bus */ if ((dev = device_find_child(parent, driver->name, 0)) == NULL) - dev = BUS_ADD_CHILD(parent, 0, driver->name, -1); - device_set_desc_copy(dev, id->desc); + dev = BUS_ADD_CHILD(parent, 0, driver->name, 0); + + if (dev != NULL) + device_set_desc_copy(dev, id->desc); } static int ==== //depot/projects/netperf_socket/sys/dev/pdq/pdq_freebsd.h#2 (text+ko) ==== @@ -24,7 +24,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Id: pdqvar.h,v 1.21 1997/03/21 21:16:04 thomas Exp - * $FreeBSD: src/sys/dev/pdq/pdq_freebsd.h,v 1.7 2003/10/31 18:32:03 brooks Exp $ + * $FreeBSD: src/sys/dev/pdq/pdq_freebsd.h,v 1.8 2004/06/13 17:29:07 mlaier Exp $ * */ @@ -97,8 +97,10 @@ #define sc_ifmedia ifmedia #define sc_if arpcom.ac_if #define sc_bpf sc_if.if_bpf +#if 0 /* ALTQ */ #define IFQ_DEQUEUE IF_DEQUEUE #define IFQ_IS_EMPTY(q) ((q)->ifq_len == 0) +#endif typedef struct _pdq_os_ctx_t { struct arpcom arpcom; ==== //depot/projects/netperf_socket/sys/dev/usb/if_udav.c#5 (text+ko) ==== @@ -1,6 +1,6 @@ /* $NetBSD: if_udav.c,v 1.2 2003/09/04 15:17:38 tsutsui Exp $ */ /* $nabe: if_udav.c,v 1.3 2003/08/21 16:57:19 nabe Exp $ */ -/* $FreeBSD: src/sys/dev/usb/if_udav.c,v 1.5 2004/06/09 00:25:44 naddy Exp $ */ +/* $FreeBSD: src/sys/dev/usb/if_udav.c,v 1.6 2004/06/13 11:22:58 sanpei Exp $ */ /* * Copyright (c) 2003 * Shingo WATANABE <nabe@nabechan.org>. All rights reserved. @@ -45,7 +45,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/usb/if_udav.c,v 1.5 2004/06/09 00:25:44 naddy Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/usb/if_udav.c,v 1.6 2004/06/13 11:22:58 sanpei Exp $"); #include "opt_inet.h" #if defined(__NetBSD__) @@ -1538,6 +1538,28 @@ switch (cmd) { #if defined(__FreeBSD__) + case SIOCSIFFLAGS: + if (ifp->if_flags & IFF_UP) { + if (ifp->if_flags & IFF_RUNNING && + ifp->if_flags & IFF_PROMISC) { + UDAV_SETBIT(sc, UDAV_RCR, + UDAV_RCR_ALL|UDAV_RCR_PRMSC); + } else if (ifp->if_flags & IFF_RUNNING && + !(ifp->if_flags & IFF_PROMISC)) { + if (ifp->if_flags & IFF_ALLMULTI) + UDAV_CLRBIT(sc, UDAV_RCR, + UDAV_RCR_PRMSC); + else + UDAV_CLRBIT(sc, UDAV_RCR, + UDAV_RCR_ALL|UDAV_RCR_PRMSC); + } else if (!(ifp->if_flags & IFF_RUNNING)) + udav_init(sc); + } else { + if (ifp->if_flags & IFF_RUNNING) + udav_stop(ifp, 1); + } + error = 0; + break; case SIOCADDMULTI: case SIOCDELMULTI: udav_setmulti(sc); @@ -1552,10 +1574,12 @@ default: error = ether_ioctl(ifp, cmd, data); +#if defined(__NetBSD__) if (error == ENETRESET) { udav_setmulti(sc); error = 0; } +#endif break; } ==== //depot/projects/netperf_socket/sys/dev/wi/if_wi.c#5 (text+ko) ==== @@ -62,7 +62,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/wi/if_wi.c,v 1.166 2004/04/01 00:38:45 sam Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/wi/if_wi.c,v 1.167 2004/06/13 17:29:07 mlaier Exp $"); #define WI_HERMES_AUTOINC_WAR /* Work around data write autoinc bug. */ #define WI_HERMES_STATS_WAR /* Work around stats counter bug. */ @@ -114,9 +114,11 @@ #include <dev/wi/if_wireg.h> #include <dev/wi/if_wivar.h> +#if 0 /* ALTQ */ #define IF_POLL(ifq, m) ((m) = (ifq)->ifq_head) #define IFQ_POLL(ifq, m) IF_POLL((ifq), (m)) #define IFQ_DEQUEUE(ifq, m) IF_DEQUEUE((ifq), (m)) +#endif static void wi_start(struct ifnet *); static int wi_reset(struct wi_softc *); ==== //depot/projects/netperf_socket/sys/i4b/driver/i4b_ipr.c#2 (text+ko) ==== @@ -54,7 +54,7 @@ *---------------------------------------------------------------------------*/ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/i4b/driver/i4b_ipr.c,v 1.26 2003/10/31 18:32:07 brooks Exp $"); +__FBSDID("$FreeBSD: src/sys/i4b/driver/i4b_ipr.c,v 1.27 2004/06/13 17:29:08 mlaier Exp $"); #include "i4bipr.h" @@ -382,7 +382,7 @@ if(ip->ip_tos & IPTOS_LOWDELAY) ifq = &sc->sc_fastq; else - ifq = &sc->sc_if.if_snd; + ifq = (struct ifqueue *)&sc->sc_if.if_snd; /* check for space in choosen send queue */ ==== //depot/projects/netperf_socket/sys/net/if.c#9 (text+ko) ==== @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * @(#)if.c 8.5 (Berkeley) 1/9/95 - * $FreeBSD: src/sys/net/if.c,v 1.191 2004/04/24 22:24:48 luigi Exp $ + * $FreeBSD: src/sys/net/if.c,v 1.192 2004/06/13 17:29:08 mlaier Exp $ */ #include "opt_compat.h" @@ -82,7 +82,7 @@ static void if_init(void *); static void if_check(void *); static int if_findindex(struct ifnet *); -static void if_qflush(struct ifqueue *); +static void if_qflush(struct ifaltq *); static void if_route(struct ifnet *, int flag, int fam); static void if_slowtimo(void *); static void if_unroute(struct ifnet *, int flag, int fam); @@ -441,6 +441,13 @@ ifa->ifa_refcnt = 1; TAILQ_INSERT_HEAD(&ifp->if_addrhead, ifa, ifa_link); ifp->if_broadcastaddr = 0; /* reliably crash if used uninitialized */ +#ifdef ALTQ + ifp->if_snd.altq_type = 0; + ifp->if_snd.altq_disc = NULL; + ifp->if_snd.altq_flags &= ALTQF_CANTCHANGE; + ifp->if_snd.altq_tbr = NULL; + ifp->if_snd.altq_ifp = ifp; +#endif if (domains) if_attachdomain1(ifp); @@ -519,6 +526,12 @@ */ s = splnet(); if_down(ifp); +#ifdef ALTQ + if (ALTQ_IS_ENABLED(&ifp->if_snd)) + altq_disable(&ifp->if_snd); + if (ALTQ_IS_ATTACHED(&ifp->if_snd)) + altq_detach(&ifp->if_snd); +#endif for (ifa = TAILQ_FIRST(&ifp->if_addrhead); ifa; ifa = next) { next = TAILQ_NEXT(ifa, ifa_link); @@ -1189,10 +1202,14 @@ * Flush an interface queue. */ static void -if_qflush(struct ifqueue *ifq) +if_qflush(struct ifaltq *ifq) { struct mbuf *m, *n; +#ifdef ALTQ + if (ALTQ_IS_ENABLED(ifq)) + ALTQ_PURGE(ifq); +#endif n = ifq->ifq_head; while ((m = n) != 0) { n = m->m_act; ==== //depot/projects/netperf_socket/sys/net/if_arp.h#4 (text+ko) ==== @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * @(#)if_arp.h 8.1 (Berkeley) 6/10/93 - * $FreeBSD: src/sys/net/if_arp.h,v 1.19 2004/04/18 01:15:32 luigi Exp $ + * $FreeBSD: src/sys/net/if_arp.h,v 1.20 2004/06/13 10:54:35 dfr Exp $ */ #ifndef _NET_IF_ARP_H_ @@ -49,6 +49,7 @@ #define ARPHRD_IEEE802 6 /* token-ring hardware format */ #define ARPHRD_ARCNET 7 /* arcnet hardware format */ #define ARPHRD_FRELAY 15 /* frame relay hardware format */ +#define ARPHRD_IEEE1394 24 /* firewire hardware format */ u_short ar_pro; /* format of protocol address */ u_char ar_hln; /* length of hardware address */ u_char ar_pln; /* length of protocol address */ ==== //depot/projects/netperf_socket/sys/net/if_ppp.c#5 (text+ko) ==== @@ -69,7 +69,7 @@ * Paul Mackerras (paulus@cs.anu.edu.au). */ -/* $FreeBSD: src/sys/net/if_ppp.c,v 1.97 2004/04/19 01:36:24 rwatson Exp $ */ +/* $FreeBSD: src/sys/net/if_ppp.c,v 1.98 2004/06/13 17:29:08 mlaier Exp $ */ /* from if_sl.c,v 1.11 84/10/04 12:54:47 rick Exp */ /* from NetBSD: if_ppp.c,v 1.15.2.2 1994/07/28 05:17:58 cgd Exp */ @@ -933,7 +933,8 @@ sc->sc_npqtail = &m0->m_nextpkt; } else { /* fastq and if_snd are emptied at spl[soft]net now */ - ifq = (m0->m_flags & M_HIGHPRI)? &sc->sc_fastq: &ifp->if_snd; + ifq = (m0->m_flags & M_HIGHPRI)? &sc->sc_fastq: + (struct ifqueue *)&ifp->if_snd; IF_LOCK(ifq); if (_IF_QFULL(ifq) && dst->sa_family != AF_UNSPEC) { _IF_DROP(ifq); @@ -988,7 +989,8 @@ */ *mpp = m->m_nextpkt; m->m_nextpkt = NULL; - ifq = (m->m_flags & M_HIGHPRI)? &sc->sc_fastq: &sc->sc_if.if_snd; + ifq = (m->m_flags & M_HIGHPRI)? &sc->sc_fastq: + (struct ifqueue *)&sc->sc_if.if_snd; if (! IF_HANDOFF(ifq, m, NULL)) { sc->sc_if.if_oerrors++; sc->sc_stats.ppp_oerrors++; ==== //depot/projects/netperf_socket/sys/net/if_sl.c#5 (text+ko) ==== @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * @(#)if_sl.c 8.6 (Berkeley) 2/1/94 - * $FreeBSD: src/sys/net/if_sl.c,v 1.115 2004/06/07 20:43:37 phk Exp $ + * $FreeBSD: src/sys/net/if_sl.c,v 1.116 2004/06/13 17:29:08 mlaier Exp $ */ /* @@ -571,7 +571,7 @@ m_freem(m); return (EHOSTUNREACH); } - ifq = &sc->sc_if.if_snd; + ifq = (struct ifqueue *)&sc->sc_if.if_snd; ip = mtod(m, struct ip *); if (sc->sc_if.if_flags & SC_NOICMP && ip->ip_p == IPPROTO_ICMP) { m_freem(m); ==== //depot/projects/netperf_socket/sys/net/if_spppsubr.c#5 (text+ko) ==== @@ -17,7 +17,7 @@ * * From: Version 2.4, Thu Apr 30 17:17:21 MSD 1997 * - * $FreeBSD: src/sys/net/if_spppsubr.c,v 1.108 2004/05/25 21:54:07 rik Exp $ + * $FreeBSD: src/sys/net/if_spppsubr.c,v 1.109 2004/06/13 17:29:08 mlaier Exp $ */ #include <sys/param.h> @@ -781,7 +781,7 @@ s = splimp(); } - ifq = &ifp->if_snd; + ifq = (struct ifqueue *)&ifp->if_snd; #ifdef INET if (dst->sa_family == AF_INET) { /* XXX Check mbuf length here? */ @@ -1038,7 +1038,7 @@ { struct sppp *sp = (struct sppp*) ifp; - sppp_qflush (&sp->pp_if.if_snd); + sppp_qflush ((struct ifqueue *)&sp->pp_if.if_snd); sppp_qflush (&sp->pp_fastq); sppp_qflush (&sp->pp_cpq); } ==== //depot/projects/netperf_socket/sys/net/if_var.h#11 (text+ko) ==== @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * From: @(#)if.h 8.1 (Berkeley) 6/10/93 - * $FreeBSD: src/sys/net/if_var.h,v 1.74 2004/05/03 13:48:35 andre Exp $ + * $FreeBSD: src/sys/net/if_var.h,v 1.75 2004/06/13 17:29:08 mlaier Exp $ */ #ifndef _NET_IF_VAR_H_ @@ -82,6 +82,10 @@ #define IF_DUNIT_NONE -1 +#if 1 /* ALTQ */ +#include <altq/if_altq.h> +#endif + TAILQ_HEAD(ifnethead, ifnet); /* we use TAILQs so that the order of */ TAILQ_HEAD(ifaddrhead, ifaddr); /* instantiation is preserved in the list */ TAILQ_HEAD(ifprefixhead, ifprefix); @@ -171,7 +175,11 @@ (void *); int (*if_resolvemulti) /* validate/resolve multicast */ (struct ifnet *, struct sockaddr **, struct sockaddr *); +#if 1 /* ALTQ */ + struct ifaltq if_snd; /* output queue (includes altq) */ +#else struct ifqueue if_snd; /* output queue */ +#endif const u_int8_t *if_broadcastaddr; /* linklevel broadcast bytestring */ struct lltable *lltables; /* list of L3-L2 resolution tables */ @@ -228,6 +236,7 @@ */ #define IF_LOCK(ifq) mtx_lock(&(ifq)->ifq_mtx) #define IF_UNLOCK(ifq) mtx_unlock(&(ifq)->ifq_mtx) +#define IF_LOCK_ASSERT(ifq) mtx_assert(&(ifq)->ifq_mtx, MA_OWNED) #define _IF_QFULL(ifq) ((ifq)->ifq_len >= (ifq)->ifq_maxlen) #define _IF_DROP(ifq) ((ifq)->ifq_drops++) #define _IF_QLEN(ifq) ((ifq)->ifq_len) @@ -278,18 +287,25 @@ IF_UNLOCK(ifq); \ } while (0) -#define IF_DRAIN(ifq) do { \ +#define _IF_POLL(ifq, m) ((m) = (ifq)->ifq_head) +#define IF_POLL(ifq, m) _IF_POLL(ifq, m) + +#define _IF_DRAIN(ifq) do { \ struct mbuf *m; \ - IF_LOCK(ifq); \ for (;;) { \ _IF_DEQUEUE(ifq, m); \ if (m == NULL) \ break; \ m_freem(m); \ } \ - IF_UNLOCK(ifq); \ } while (0) +#define IF_DRAIN(ifq) do { \ + IF_LOCK(ifq); \ + _IF_DRAIN(ifq); \ + IF_UNLOCK(ifq); \ +} while(0) + #ifdef _KERNEL /* interface address change event */ typedef void (*ifaddr_event_handler_t)(void *, struct ifnet *); @@ -311,8 +327,10 @@ #define IF_AFDATA_UNLOCK(ifp) mtx_unlock(&(ifp)->if_afdata_mtx) #define IF_AFDATA_DESTROY(ifp) mtx_destroy(&(ifp)->if_afdata_mtx) -#define IF_HANDOFF(ifq, m, ifp) if_handoff(ifq, m, ifp, 0) -#define IF_HANDOFF_ADJ(ifq, m, ifp, adj) if_handoff(ifq, m, ifp, adj) +#define IF_HANDOFF(ifq, m, ifp) \ + if_handoff((struct ifqueue *)ifq, m, ifp, 0) +#define IF_HANDOFF_ADJ(ifq, m, ifp, adj) \ + if_handoff((struct ifqueue *)ifq, m, ifp, adj) static __inline int if_handoff(struct ifqueue *ifq, struct mbuf *m, struct ifnet *ifp, int adjust) @@ -338,6 +356,185 @@ (*ifp->if_start)(ifp); return (1); } +#if 1 /* ALTQ */ +#define IFQ_ENQUEUE(ifq, m, err) \ +do { \ + IF_LOCK(ifq); \ + if (ALTQ_IS_ENABLED(ifq)) \ + ALTQ_ENQUEUE(ifq, m, NULL, err); \ + else { \ + if (_IF_QFULL(ifq)) { \ + m_freem(m); \ + (err) = ENOBUFS; \ + } else { \ + _IF_ENQUEUE(ifq, m); \ + (err) = 0; \ + } \ + } \ + if (err) \ + (ifq)->ifq_drops++; \ + IF_UNLOCK(ifq); \ +} while (0) + +#define IFQ_DEQUEUE_NOLOCK(ifq, m) \ +do { \ + if (TBR_IS_ENABLED(ifq)) \ + (m) = tbr_dequeue(ifq, ALTDQ_REMOVE); \ + else if (ALTQ_IS_ENABLED(ifq)) \ + ALTQ_DEQUEUE(ifq, m); \ + else \ + _IF_DEQUEUE(ifq, m); \ +} while (0) + +#define IFQ_DEQUEUE(ifq, m) \ +do { \ + IF_LOCK(ifq); \ + IFQ_DEQUEUE_NOLOCK(ifq, m); \ + IF_UNLOCK(ifq); \ +} while (0) + +#define IFQ_POLL_NOLOCK(ifq, m) \ +do { \ + if (TBR_IS_ENABLED(ifq)) \ + (m) = tbr_dequeue(ifq, ALTDQ_POLL); \ + else if (ALTQ_IS_ENABLED(ifq)) \ + ALTQ_POLL(ifq, m); \ + else \ + _IF_POLL(ifq, m); \ +} while (0) + +#define IFQ_POLL(ifq, m) \ +do { \ + IF_LOCK(ifq); \ + IFQ_POLL_NOLOCK(ifq, m); \ + IF_UNLOCK(ifq); \ +} while (0) + +#define IFQ_PURGE_NOLOCK(ifq) \ +do { \ + if (ALTQ_IS_ENABLED(ifq)) { \ + ALTQ_PURGE(ifq); \ + } else \ + _IF_DRAIN(ifq); \ +} while (0) + +#define IFQ_PURGE(ifq) \ >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200406131850.i5DIoAJ2022676>