diff options
author | marius <marius@FreeBSD.org> | 2010-01-09 21:23:39 +0000 |
---|---|---|
committer | marius <marius@FreeBSD.org> | 2010-01-09 21:23:39 +0000 |
commit | 74871d34a19d50b9c9536f47a2fb7ba2d2d4a194 (patch) | |
tree | b874e31c4cdfd3408d5eeb612235e698706181c0 /sys/boot/sparc64 | |
parent | a880ee87bc8b687ff25e43e06a12ccdcf26a3e5b (diff) | |
download | FreeBSD-src-74871d34a19d50b9c9536f47a2fb7ba2d2d4a194.zip FreeBSD-src-74871d34a19d50b9c9536f47a2fb7ba2d2d4a194.tar.gz |
- Add code allowing a network device to only be open and closed once
by keeping it opened after the first open and closing it via the
cleanup handler when NETIF_OPEN_CLOSE_ONCE is defined in order to
avoid the open-close-dance on every file access which with firmware
that for example performs an auto-negotiation on every open causes
netbooting to take horribly long. Basically the behavior with this
knob enabled resembles the one employed between r60506 and r177108
(and for sparc64 also again since r182919) with the addition that
the network device now is closed eventually before entering the
kernel and before rebooting. Actually I think this should be the
desired MI behavior, however the U-Boot loader actually requires
net_close() to be called after every transaction in order for some
local shutdown operations to be performed (and which I think thus
will break on concurrent opens, i.e. when netdev_opens is > 1, like
the loader does at least for disks when LOADER_GZIP_SUPPORT is
enabled).
- Use NETIF_OPEN_CLOSE_ONCE to replace the hack, which artificially
increased netdev_opens for sparc64 in order to keep the network
device opened forever, as at least some firmware versions require
the network device to be closed eventually before entering the
kernel or otherwise will DMA received packets to stale memory.
The powerpc OFW loader probably wants NETIF_OPEN_CLOSE_ONCE to be
set as well for the same reasons.
Diffstat (limited to 'sys/boot/sparc64')
-rw-r--r-- | sys/boot/sparc64/loader/Makefile | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/boot/sparc64/loader/Makefile b/sys/boot/sparc64/loader/Makefile index 0d7161c..46c6baa 100644 --- a/sys/boot/sparc64/loader/Makefile +++ b/sys/boot/sparc64/loader/Makefile @@ -51,11 +51,15 @@ CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/sparc64 LIBFICL= ${.OBJDIR}/../../ficl/libficl.a .endif -# Always add MI sources +# Always add MI sources .PATH: ${.CURDIR}/../../common .include "${.CURDIR}/../../common/Makefile.inc" CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I. +# Avoid the open-close-dance for every file access as some firmwares perform +# an auto-negotiation on every open of the network interface and thus causes +# netbooting to take horribly long. +CFLAGS+= -DNETIF_OPEN_CLOSE_ONCE CLEANFILES+= vers.c loader.help |