diff options
author | bapt <bapt@FreeBSD.org> | 2016-11-16 07:01:52 +0000 |
---|---|---|
committer | bapt <bapt@FreeBSD.org> | 2016-11-16 07:01:52 +0000 |
commit | cbe6fc290ffa55727150015d8214b00a54fd6e97 (patch) | |
tree | 4ea137b4b84fc20c8bde819efcf074c8edf11a58 /sys/boot | |
parent | 29c53ee7b579631b6099687cd56094c91e670db1 (diff) | |
download | FreeBSD-src-cbe6fc290ffa55727150015d8214b00a54fd6e97.zip FreeBSD-src-cbe6fc290ffa55727150015d8214b00a54fd6e97.tar.gz |
MFC r307238:
Stop closing the network device when netbooting for loaders using the common
dev_net.c code.
The NETIF_OPEN_CLOSE_ONCE flag was added in r201932 to prevent that behaviour
on some architectures (sparc64 and powerpc64) the default was left to always
open and close the device for each open and close of a file by the loader
because it was necessary for u-boot on arm.
Since it has been added, the flag was turned on for every arches including the
u-boot loader for arm.
This also fixes netbooting on RPi3 (tested by gonzo@)
For the loader.efi it greatly speeds up netbooting
Reviewed by: emaste, gonzo, tsoome
Approved by: gonzo
MFC after: 1 month
Sponsored by: Gandi.net
Differential Revision: https://reviews.freebsd.org/D8230
Diffstat (limited to 'sys/boot')
-rw-r--r-- | sys/boot/arm/uboot/Makefile | 2 | ||||
-rw-r--r-- | sys/boot/common/dev_net.c | 17 | ||||
-rw-r--r-- | sys/boot/mips/uboot/Makefile | 2 | ||||
-rw-r--r-- | sys/boot/powerpc/kboot/Makefile | 5 | ||||
-rw-r--r-- | sys/boot/powerpc/ofw/Makefile | 5 | ||||
-rw-r--r-- | sys/boot/powerpc/ps3/Makefile | 5 | ||||
-rw-r--r-- | sys/boot/sparc64/loader/Makefile | 4 |
7 files changed, 2 insertions, 38 deletions
diff --git a/sys/boot/arm/uboot/Makefile b/sys/boot/arm/uboot/Makefile index 7f0fd2e..8b4b8ca 100644 --- a/sys/boot/arm/uboot/Makefile +++ b/sys/boot/arm/uboot/Makefile @@ -77,8 +77,6 @@ LIBUBOOT_FDT= ${.OBJDIR}/../../uboot/fdt/libuboot_fdt.a LIBFDT= ${.OBJDIR}/../../fdt/libfdt.a .endif -CFLAGS+= -DNETIF_OPEN_CLOSE_ONCE - .if ${MK_FORTH} != "no" # Enable BootForth BOOT_FORTH= yes diff --git a/sys/boot/common/dev_net.c b/sys/boot/common/dev_net.c index 09583d0..fddb17e 100644 --- a/sys/boot/common/dev_net.c +++ b/sys/boot/common/dev_net.c @@ -120,11 +120,9 @@ net_open(struct open_file *f, ...) devname = va_arg(args, char*); va_end(args); -#ifdef NETIF_OPEN_CLOSE_ONCE /* Before opening another interface, close the previous one first. */ if (netdev_sock >= 0 && strcmp(devname, netdev_name) != 0) net_cleanup(); -#endif /* On first open, do netif open, mount, etc. */ if (netdev_opens == 0) { @@ -198,21 +196,6 @@ net_close(struct open_file *f) f->f_devdata = NULL; -#ifndef NETIF_OPEN_CLOSE_ONCE - /* Extra close call? */ - if (netdev_opens <= 0) - return (0); - netdev_opens--; - /* Not last close? */ - if (netdev_opens > 0) - return (0); - /* On last close, do netif close, etc. */ -#ifdef NETIF_DEBUG - if (debug) - printf("net_close: calling net_cleanup()\n"); -#endif - net_cleanup(); -#endif return (0); } diff --git a/sys/boot/mips/uboot/Makefile b/sys/boot/mips/uboot/Makefile index b350ae4..6be362c 100644 --- a/sys/boot/mips/uboot/Makefile +++ b/sys/boot/mips/uboot/Makefile @@ -81,8 +81,6 @@ LIBUBOOT_FDT= ${.OBJDIR}/../../uboot/fdt/libuboot_fdt.a LIBFDT= ${.OBJDIR}/../../fdt/libfdt.a .endif -CFLAGS+= -DNETIF_OPEN_CLOSE_ONCE - .if ${MK_FORTH} != "no" # Enable BootForth BOOT_FORTH= yes diff --git a/sys/boot/powerpc/kboot/Makefile b/sys/boot/powerpc/kboot/Makefile index 6218b7e..c161a9c 100644 --- a/sys/boot/powerpc/kboot/Makefile +++ b/sys/boot/powerpc/kboot/Makefile @@ -68,10 +68,7 @@ CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/powerpc LIBFICL= ${.OBJDIR}/../../ficl/libficl.a .endif -# 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 -mcpu=powerpc64 +CFLAGS+= -mcpu=powerpc64 # Always add MI sources .PATH: ${.CURDIR}/../../common ${.CURDIR}/../../../libkern diff --git a/sys/boot/powerpc/ofw/Makefile b/sys/boot/powerpc/ofw/Makefile index ab5720f..eccf3c5 100644 --- a/sys/boot/powerpc/ofw/Makefile +++ b/sys/boot/powerpc/ofw/Makefile @@ -67,11 +67,6 @@ CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/powerpc LIBFICL= ${.OBJDIR}/../../ficl/libficl.a .endif -# 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 - # Always add MI sources .PATH: ${.CURDIR}/../../common ${.CURDIR}/../../../libkern .include "${.CURDIR}/../../common/Makefile.inc" diff --git a/sys/boot/powerpc/ps3/Makefile b/sys/boot/powerpc/ps3/Makefile index baf2507..0cbc166 100644 --- a/sys/boot/powerpc/ps3/Makefile +++ b/sys/boot/powerpc/ps3/Makefile @@ -68,10 +68,7 @@ CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/powerpc LIBFICL= ${.OBJDIR}/../../ficl/libficl.a .endif -# 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 -mcpu=powerpc64 +CFLAGS+= -mcpu=powerpc64 # Always add MI sources .PATH: ${.CURDIR}/../../common ${.CURDIR}/../../../libkern diff --git a/sys/boot/sparc64/loader/Makefile b/sys/boot/sparc64/loader/Makefile index 05d23ff..2884cf0 100644 --- a/sys/boot/sparc64/loader/Makefile +++ b/sys/boot/sparc64/loader/Makefile @@ -69,10 +69,6 @@ LIBFICL= ${.OBJDIR}/../../ficl/libficl.a .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 |