summaryrefslogtreecommitdiffstats
path: root/src/drivers/net/netfront.c
Commit message (Collapse)AuthorAgeFilesLines
* [xen] Provide 18 4kB receive buffers to work around xen-netback bugMichael Brown2017-05-191-9/+10
| | | | | | | | | | | | | | | The Xen network backend (xen-netback) suffered from a regression between upstream Linux kernels 3.18 and 4.2 inclusive, which would cause packet reception to fail unless at least 18 receive buffers were available. This bug was fixed in kernel commit 1d5d485 ("xen-netback: require fewer guest Rx slots when not using GSO"). Work around this bug in affected versions of xen-netback by providing the requisite 18 receive buffers. Reported-by: Taylor Schneider <tschneider@live.com> Tested-by: Taylor Schneider <tschneider@live.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [base16] Add buffer size parameter to base16_encode() and base16_decode()Michael Brown2015-04-241-1/+1
| | | | | | | | | | | | | | The current API for Base16 (and Base64) encoding requires the caller to always provide sufficient buffer space. This prevents the use of the generic encoding/decoding functionality in some situations, such as in formatting the hex setting types. Implement a generic hex_encode() (based on the existing format_hex_setting()), implement base16_encode() and base16_decode() in terms of the more generic hex_encode() and hex_decode(), and update all callers to provide the additional buffer length parameter. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [xen] Set the "feature-rx-notify" flag for netfront devicesMichael Brown2015-03-091-0/+8
| | | | | | | | | | | | iPXE already sends RX notifications to the backend when needed, but does not set the "feature-rx-notify" flag. As of XenServer 6.5, this flag is mandatory and omitting it will cause the backend to fail. Fix by setting the "feature-rx-notify" flag, to inform the backend that we will send notifications. Reported-by: Shalom Bhooshi <shalom.bhooshi@citrix.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Relicense files under GPL2_OR_LATER_OR_UBDLMichael Brown2015-03-021-1/+5
| | | | | | | Relicense files for which I am the sole author (as identified by util/relicense.pl). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [xen] Cope with unexpected initial backend statesMichael Brown2014-08-141-10/+64
| | | | | | | | | | | | | | | | | | | | | | | | | Under some circumstances (e.g. if iPXE itself is booted via iSCSI, or after an unclean reboot), the backend may not be in the expected InitWait state when iPXE starts up. There is no generic reset mechanism for Xenbus devices. Recent versions of xen-netback will gracefully perform all of the required steps if the frontend sets its state to Initialising. Older versions (such as that found in XenServer 6.2.0) require the frontend to transition through Closed before reaching Initialising. Add a reset mechanism for netfront devices which does the following: - read current backend state - if backend state is anything other than InitWait, then set the frontend state to Closed and wait for the backend to also reach Closed - set the frontend state to Initialising and wait for the backend to reach InitWait. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [xen] Use version 1 grant tables by defaultMichael Brown2014-08-131-28/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using version 1 grant tables limits guests to using 16TB of grantable RAM, and prevents the use of subpage grants. Some versions of the Xen hypervisor refuse to allow the grant table version to be set after the first grant references have been created, so the loaded operating system may be stuck with whatever choice we make here. We therefore currently use version 2 grant tables, since they give the most flexibility to the loaded OS. Current versions (7.2.0) of the Windows PV drivers have no support for version 2 grant tables, and will merrily create version 1 entries in what the hypervisor believes to be a version 2 table. This causes some confusion. Avoid this problem by attempting to use version 1 tables, since otherwise we may render Windows unable to boot. Play nicely with other potential bootloaders by accepting either version 1 or version 2 grant tables (if we are unable to set our requested version). Note that the use of version 1 tables on a 64-bit system introduces a possible failure path in which a frame number cannot fit into the 32-bit field within the v1 structure. This in turn introduces additional failure paths into netfront_transmit() and netfront_refill_rx(). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [xen] Add support for Xen netfront virtual NICsMichael Brown2014-07-291-0/+852
Signed-off-by: Michael Brown <mcb30@ipxe.org>