<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/boot/common/dev_net.c, branch upstream/11.1.0</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>MFC r307238:</title>
<updated>2016-11-16T07:01:52+00:00</updated>
<author>
<name>Baptiste Daroussin</name>
<email>bapt@FreeBSD.org</email>
</author>
<published>2016-11-16T07:01:52+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=1da33403f4cac1fcee8b344289dca6cbfdb105be'/>
<id>1da33403f4cac1fcee8b344289dca6cbfdb105be</id>
<content type='text'>
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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
<entry>
<title>MFC: 304677, 304680, 305125, 305770, 305769</title>
<updated>2016-10-19T13:26:07+00:00</updated>
<author>
<name>Baptiste Daroussin</name>
<email>bapt@FreeBSD.org</email>
</author>
<published>2016-10-19T13:26:07+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=a4cbe53912b24a314839dce742359edffbf49b1f'/>
<id>a4cbe53912b24a314839dce742359edffbf49b1f</id>
<content type='text'>
r304677:
Add tftpfs support for the EFI loader

Allow netbooting on efi without having to setup any NFS server by rebuilding the
loader with LOADER_TFTP_SUPPORT like for the i386 pxeloader

r305125:
Netboot: allow both tftpfs and nfs in both pxeboot and loader.efi

Add a new 'netproto' variable which can be set for now to
NET_TFTP or NET_NFS (default to NET_NONE)

From the dhcp options if one sets the root-path option to:
"ip:path", the loader will consider it is booting over NFS
(meaning same behaviour as the default current behaviour)

if the dhcp option "tftp server address" is set (option 150)
the loader will consider it is booting over tftpfs, it will then
consider the root-path options with 2 possible case
1. "path" then the IP of the tftp server will be the one passed by
the option 150, and the files will be retrieved under "path" on the tftp
server
2. "ip:path" then the IP of the tftp server will be the one passed in
the option "overwritting the IP from the option 150.

We could not "abuse" the rootpath option in the form or tftp://ip:path because
this is already used for other purpose by iPXE preventing any chainload from
iPXE to the FreeBSD loader.

Given at each open(), the loader loops over all available filesystems and keep
the "best" error, we needed to prevent tftpfs to fallback on nfs and vice versa.
the tftpfs and nfs implementation in libstand now return EINVAL early if
'netproto' for that purpose.

Relnotes:	yes
Sponsored by:	Gandi.net
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
r304677:
Add tftpfs support for the EFI loader

Allow netbooting on efi without having to setup any NFS server by rebuilding the
loader with LOADER_TFTP_SUPPORT like for the i386 pxeloader

r305125:
Netboot: allow both tftpfs and nfs in both pxeboot and loader.efi

Add a new 'netproto' variable which can be set for now to
NET_TFTP or NET_NFS (default to NET_NONE)

From the dhcp options if one sets the root-path option to:
"ip:path", the loader will consider it is booting over NFS
(meaning same behaviour as the default current behaviour)

if the dhcp option "tftp server address" is set (option 150)
the loader will consider it is booting over tftpfs, it will then
consider the root-path options with 2 possible case
1. "path" then the IP of the tftp server will be the one passed by
the option 150, and the files will be retrieved under "path" on the tftp
server
2. "ip:path" then the IP of the tftp server will be the one passed in
the option "overwritting the IP from the option 150.

We could not "abuse" the rootpath option in the form or tftp://ip:path because
this is already used for other purpose by iPXE preventing any chainload from
iPXE to the FreeBSD loader.

Given at each open(), the loader loops over all available filesystems and keep
the "best" error, we needed to prevent tftpfs to fallback on nfs and vice versa.
the tftpfs and nfs implementation in libstand now return EINVAL early if
'netproto' for that purpose.

Relnotes:	yes
Sponsored by:	Gandi.net
</pre>
</div>
</content>
</entry>
<entry>
<title>If the dhcp server provided an interface-mtu option, transcribe the value</title>
<updated>2016-03-21T15:06:50+00:00</updated>
<author>
<name>Ian Lepore</name>
<email>ian@FreeBSD.org</email>
</author>
<published>2016-03-21T15:06:50+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=98acd232ad7a81d972dd4584dbdf0931857a6af7'/>
<id>98acd232ad7a81d972dd4584dbdf0931857a6af7</id>
<content type='text'>
to the boot.netif.mtu env var, which will be picked up by pre-existing code
in nfs_mountroot() and used to configure the interface accordingly.

This should bring the same functionality when the bootp/dhcp work is done
by loader(8) as r297150 does for the in-kernel BOOTP case.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
to the boot.netif.mtu env var, which will be picked up by pre-existing code
in nfs_mountroot() and used to configure the interface accordingly.

This should bring the same functionality when the bootp/dhcp work is done
by loader(8) as r297150 does for the in-kernel BOOTP case.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix build failure introduced by r296182</title>
<updated>2016-02-29T09:03:07+00:00</updated>
<author>
<name>Stanislav Galabov</name>
<email>sgalabov@FreeBSD.org</email>
</author>
<published>2016-02-29T09:03:07+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=55d11ce3bd8b04287e8a569e94a579568c29efe9'/>
<id>55d11ce3bd8b04287e8a569e94a579568c29efe9</id>
<content type='text'>
Approved by:	adrian (mentor)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Approved by:	adrian (mentor)
</pre>
</div>
</content>
</entry>
<entry>
<title>These changes attempt to put things in order before the introduction of MIPS</title>
<updated>2016-02-29T07:27:49+00:00</updated>
<author>
<name>Stanislav Galabov</name>
<email>sgalabov@FreeBSD.org</email>
</author>
<published>2016-02-29T07:27:49+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=b981b8bd869140a572e5cfa713d4c6f67d1534ab'/>
<id>b981b8bd869140a572e5cfa713d4c6f67d1534ab</id>
<content type='text'>
ubldr.

The changes are mostly dealing with removing unnecessary casts from the U-Boot
API (we're passing only pointers, no obvious reason to cast them to uint32_t),
cleaning up some compiler warnings and using the proper printf format
specifiers in order to be able to compile cleanly for both 32-bit and 64-bit
MIPS targets.

Reviewed by:	imp
Approved by:	adrian (mentor)
Sponsored by:	Smartcom - Bulgaria AD
Differential Revision:	https://reviews.freebsd.org/D5312
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ubldr.

The changes are mostly dealing with removing unnecessary casts from the U-Boot
API (we're passing only pointers, no obvious reason to cast them to uint32_t),
cleaning up some compiler warnings and using the proper printf format
specifiers in order to be able to compile cleanly for both 32-bit and 64-bit
MIPS targets.

Reviewed by:	imp
Approved by:	adrian (mentor)
Sponsored by:	Smartcom - Bulgaria AD
Differential Revision:	https://reviews.freebsd.org/D5312
</pre>
</div>
</content>
</entry>
<entry>
<title>Refactor net_getparams() to make it easier to get params from sources other</title>
<updated>2015-05-18T15:46:43+00:00</updated>
<author>
<name>Ian Lepore</name>
<email>ian@FreeBSD.org</email>
</author>
<published>2015-05-18T15:46:43+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=b32852bef6232b5936306389bf6f543fcae9f600'/>
<id>b32852bef6232b5936306389bf6f543fcae9f600</id>
<content type='text'>
than bootp and rarp.

The code which splits a serverip:/rootpath string into rootip and a plain
pathname is now a separate net_parse_rootpath() function that can be
called by others.  The code that sets the kernel env vars needed for
nfs_diskless is moved into net_open() so that the variables get set no
matter where the params came from.

There was already code in net_open() that allowed for the possibility that
some other entity has set up the network-related global variables.  It uses
the rootip variable as the key, assuming that if it is set all the other
required variables are set too.  These changes don't alter the existing
behavior, they just make it easier to actually write some new code to get
the params from another source (such as the U-Boot environment).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
than bootp and rarp.

The code which splits a serverip:/rootpath string into rootip and a plain
pathname is now a separate net_parse_rootpath() function that can be
called by others.  The code that sets the kernel env vars needed for
nfs_diskless is moved into net_open() so that the variables get set no
matter where the params came from.

There was already code in net_open() that allowed for the possibility that
some other entity has set up the network-related global variables.  It uses
the rootip variable as the key, assuming that if it is set all the other
required variables are set too.  These changes don't alter the existing
behavior, they just make it easier to actually write some new code to get
the params from another source (such as the U-Boot environment).
</pre>
</div>
</content>
</entry>
<entry>
<title>- Add code allowing a network device to only be open and closed once</title>
<updated>2010-01-09T21:23:39+00:00</updated>
<author>
<name>Marius Strobl</name>
<email>marius@FreeBSD.org</email>
</author>
<published>2010-01-09T21:23:39+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=ccb1921ee03062ec2bcde59bc7a77cfacc36ad3d'/>
<id>ccb1921ee03062ec2bcde59bc7a77cfacc36ad3d</id>
<content type='text'>
  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 &gt; 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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
  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 &gt; 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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove clause 3 and 4 from TNF licenses (this was the only 4-clause TNF</title>
<updated>2010-01-09T17:09:57+00:00</updated>
<author>
<name>Marius Strobl</name>
<email>marius@FreeBSD.org</email>
</author>
<published>2010-01-09T17:09:57+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=989bac19ead202eca7b234054dcb3e75b5a531fa'/>
<id>989bac19ead202eca7b234054dcb3e75b5a531fa</id>
<content type='text'>
license FreeBSD had in sys/boot).

Obtained from:	NetBSD
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
license FreeBSD had in sys/boot).

Obtained from:	NetBSD
</pre>
</div>
</content>
</entry>
<entry>
<title>- Consistently wrap debugging in NETIF_DEBUG. This basically merges</title>
<updated>2009-12-24T15:16:16+00:00</updated>
<author>
<name>Marius Strobl</name>
<email>marius@FreeBSD.org</email>
</author>
<published>2009-12-24T15:16:16+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=5e01e025a2a16412358d01479912c46dff493150'/>
<id>5e01e025a2a16412358d01479912c46dff493150</id>
<content type='text'>
  NetBSD rev 1.19.
- Make the functions match their prototypes regarding static.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
  NetBSD rev 1.19.
- Make the functions match their prototypes regarding static.
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert r177108 and restore r60506 for sparc64 as long as libstand</title>
<updated>2008-09-10T20:53:22+00:00</updated>
<author>
<name>Marius Strobl</name>
<email>marius@FreeBSD.org</email>
</author>
<published>2008-09-10T20:53:22+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=4028a367264de6838b3e344c09a03f233b66a187'/>
<id>4028a367264de6838b3e344c09a03f233b66a187</id>
<content type='text'>
isn't fixed to only open the network device once and not do a open
and close dance on every file access; the firmwares of newer sparc64
machines perform an auto-negotiation with every open which in turn
causes netbooting to take horribly long if we open and close the
device over and over again.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
isn't fixed to only open the network device once and not do a open
and close dance on every file access; the firmwares of newer sparc64
machines perform an auto-negotiation with every open which in turn
causes netbooting to take horribly long if we open and close the
device over and over again.
</pre>
</div>
</content>
</entry>
</feed>
