aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-02-01[hermon] Minimise reset timehermon_resetMichael Brown2-7/+32
Check for reset completion by waiting for the device to respond to PCI configuration cycles, as documented in the Programmer's Reference Manual. On the original ConnectX HCA, this reduces the time spent on reset from 1000ms down to 1ms. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-02-01[hermon] Throttle debug output when sensing port typeChristian Iversen1-0/+3
When auto-detecting the initial port type, the Hermon driver will spam the debug output without hesitation. Add a short delay in each iteration to fix this. Signed-off-by: Christian Iversen <ci@iversenit.dk>
2021-02-01[hermon] Add a debug notice when initialization is completeChristian Iversen1-0/+1
Signed-off-by: Christian Iversen <ci@iversenit.dk> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-02-01[hermon] Add support for port management eventChristian Iversen2-0/+39
Inspired by Flexboot, the function hermon_event_port_mgmnt_change() is added to handle the HERMON_EV_PORT_MGMNT_CHANGE event type, which updates the Infiniband subsystem. Signed-off-by: Christian Iversen <ci@iversenit.dk> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-02-01[hermon] Adjust Ethernet work queue sizeChristian Iversen1-3/+3
Hermon Ethernet work queues have more RX than TX entries, unlike most other drivers. This is possibly the source of some stochastic deadlocks previously experienced with this driver. Update the sizes to be in line with other drivers, and make them slightly larger for better performance. These new queue sizes have been found to work well with ConnectX-3 hardware. Signed-off-by: Christian Iversen <ci@iversenit.dk> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-02-01[hermon] Use reset value suitable for ConnectX-3Michael Brown1-1/+1
The programming documentation states that the reset magic value is "0x00000001 (Big Endian)", and the current code matches this by using the value 0x01000000 for the implicitly little-endian writel(). Inspection of the FlexBoot source code reveals an exciting variety of reset values, some suggestive of confusion around endianness. Experimentation suggests that the value 0x01000001 works reliably across a wide range of hardware. Debugged-by: Christian Iversen <ci@iversenit.dk> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-02-01[hermon] Clean up whitespace in hermon.cChristian Iversen1-1/+1
Signed-off-by: Christian Iversen <ci@iversenit.dk>
2021-02-01[iscsi] Update link to iBFT reference manualChristian Iversen1-2/+6
Signed-off-by: Christian Iversen <ci@iversenit.dk>
2021-01-31[hermon] Limit link poll frequency in DOWN statehermon_link_pollMichael Brown2-1/+17
Some older versions of the hardware (and/or firmware) do not report an event when an Infiniband link reaches the INIT state. The driver works around this missing event by calling ib_smc_update() on each event queue poll while the link is in the DOWN state. Commit 6cb12ee ("[hermon] Increase polling rate for command completions") addressed this by speeding up the time taken to issue each command invoked by ib_smc_update(). Experimentation shows that the impact is still significant: for example, in a situation where an unplugged port is opened, the throughput on the other port can be reduced by over 99%. Fix by throttling the rate at which link polling is attempted. Debugged-by: Christian Iversen <ci@iversenit.dk> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-01-31[build] Avoid using awk to format build ID as hexadecimalMichael Brown1-1/+1
The version of awk used in FreeBSD seems to be incapable of formatting unsigned 32-bit integers above 0x80000000 and will silently render any such value as 0x80000000. For example: echo 3735928559 | awk '{printf "0x%08x", $1}' will produce 0x80000000 instead of the correct 0xdeadbeef. This results in an approximately 50% chance of a build ID collision when building on FreeBSD. Work around this problem by passing the decimal value directly in the ld --defsym argument value. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-01-31[build] Avoid using sha1sum when calculating build IDMichael Brown1-1/+1
The sha1sum command may not be available on all systems. Use the POSIX-confirming cksum instead. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-01-30[build] Allow BIOS linker script to be used with FreeBSD linkerfreebsdMichael Brown1-13/+13
Add a few more ABSOLUTE() expressions to convince the FreeBSD linker that already-absolute symbols are, in fact, absolute. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-01-30[build] Check for broken elftoolchain version of objcopyMichael Brown1-0/+7
The elftoolchain version of objcopy (as used in FreeBSD) seems to be unusable for generating a raw binary file, since it will apparently ignore the load memory addresses specified for each section in the input file. The binutils version of objcopy may be used on FreeBSD by specifying OBJCOPY=/usr/local/bin/objcopy Detect an attempt to use the unusable elftoolchain version of objcopy and report it as an error. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-01-30[build] Avoid modifying load addresses when stripping .zinfo sectionMichael Brown1-7/+42
Some versions of objcopy will spuriously complain when asked to extract the .zinfo section since doing so will nominally alter the load addresses of the (non-loadable) .bss.* sections. Avoid these warnings by placing the .zinfo section at the very end of the load memory address space. Allocate non-overlapping load memory addresses for the (non-loadable) .bss.* sections, in the hope of avoiding spurious warnings about overlapping load addresses. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-01-30[build] Replace random build ID with a deterministic oneManuel Mendez1-1/+7
Calculate the build ID as a checksum over the input files. Since the input files include $(BIN)/version.%.o which itself includes the build target name (from which TGT_LD_FLAGS is calculated), this should be sufficient to meet the requirement that the build ID be unique for each $(BIN)/%.tmp even within the same build run. Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-01-30[build] Use $(shell ...) to invoke BUILD_ID_CMDManuel Mendez1-1/+1
When using $(shell), make will first invoke BUILD_ID_CMD and then have the value defined when calling $(LD). This means we get to see the _build_id when building with make V=1. Previously the build_id was figured out as a subshell command run during the recipe execution without being able to see the build_id itself. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-01-30[build] Use SOURCE_DATE_EPOCH if it existsManuel Mendez1-0/+12
See https://reproducible-builds.org/docs/source-date-epoch/ for rationale. Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-01-30[build] Use recursive deletion for "make clean"Michael Brown1-1/+1
Directories may be left behind by failed filesystem image builds, and will not currently be successfully removed by a "make clean". Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-01-30[build] Avoid shell brace expansion in "make clean"Michael Brown1-3/+4
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-01-30[build] Allow elf2efi.c to build on FreeBSDMichael Brown1-7/+30
The elf.h on FreeBSD defines ELF_R_TYPE and ELF_R_SYM (based on the host platform) and omits some but not all of the AArch64 relocation types. Fix by undefining ELF_R_TYPE and ELF_R_SYM in favour of our own definitions, and by placing each potentially missing relocation type within an individual #ifdef guard. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-01-29[build] Ensure that isolinux.bin is modifiableMichael Brown1-1/+1
The -boot-info-table option to mkisofs will cause it to overwrite a portion of the local copy of isolinux.bin. Ensure that this file is writable. Originally-implemented-by: Nikolai Lifanov <lifanov@mail.lifanov.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-01-29[build] Add syslinux search locations used on FreeBSDMichael Brown1-0/+2
Originally-implemented-by: Nikolai Lifanov <lifanov@mail.lifanov.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-01-29[build] Drop timestamps from .a filedeterminismBernhard M. Wiedemann1-2/+2
Make the contents of $(BLIB) deterministic to allow it to be subsequently used for calculating a build ID. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-01-29[hermon] Perform clean MPT unmap on device shutdownChristian Iversen2-0/+29
This change is ported from Flexboot sources. When stopping a Hermon device, perform hermon_unmap_mpt() which runs HERMON_HCR_HW2SW_MPT to bring the Memory Protection Table (MPT) back to software control. Signed-off-by: Christian Iversen <ci@iversenit.dk> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-01-29[hermon] Use Ethernet MAC as eIPoIB local EMACChristian Iversen2-17/+20
The eIPoIB local Ethernet MAC is currently constructed from the port GUID. Given a base GUID/MAC value of N, Mellanox seems to populate: Node GUID: N + 0 Port 1 GUID: N + 1 Port 2 GUID: N + 2 and Port 1 MAC: N + 0 Port 2 MAC: N + 1 This causes a duplicate local MAC address when port 1 is configured as Infiniband and port 2 as Ethernet, since both will derive their MAC address as (N + 1). Fix by using the port's Ethernet MAC as the eIPoIB local EMAC. This is a behavioural change that could potentially break configurations that rely on the local EMAC value, such as a DHCP server relying on the chaddr field for DHCP reservations. Signed-off-by: Christian Iversen <ci@iversenit.dk> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-01-28[hermon] Increase polling rate for command completionsChristian Iversen1-2/+2
Some older versions of the hardware (and/or firmware) do not report an event when an Infiniband link reaches the INIT state. The driver works around this missing event by calling ib_smc_update() on each event queue poll while the link is in the DOWN state. This results in a very large number of commands being issued while any open Infiniband link is in the DOWN state (e.g. unplugged), to the point that the 1ms delay from waiting for each command to complete will noticeably affect responsiveness. Fix by decreasing the command completion polling delay from 1ms to 10us. Signed-off-by: Christian Iversen <ci@iversenit.dk> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-01-28[hermon] Add event queue debug functionsMichael Brown1-2/+76
Add hermon_dump_eqctx() for dumping the event queue context and hermon_dump_eqes() for dumping any unconsumed event queue entries. Originally-implemented-by: Christian Iversen <ci@iversenit.dk> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-01-28[hermon] Increase command timeout from 2 to 10 secondsChristian Iversen1-1/+1
Some commands (particularly in relation to device initialization) can occasionally take longer than 2 seconds, and the Mellanox documentation recommends a 10 second timeout. Signed-off-by: Christian Iversen <ci@iversenit.dk>
2021-01-28[hermon] Add assorted debug error messagesMichael Brown1-6/+33
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-01-28[hermon] Show "issuing command" messages only at DBGLVL_EXTRAMichael Brown1-7/+5
Originally-implemented-by: Christian Iversen <ci@iversenit.dk> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-01-28[hermon] Reorganize PCI ROM list and document well-known product namesChristian Iversen1-2/+9
Signed-off-by: Christian Iversen <ci@iversenit.dk>
2021-01-28[golan] Backport typo fix in nodnic_prm.h: s/HERMON/NODNIC/Christian Iversen1-2/+2
Signed-off-by: Christian Iversen <ci@iversenit.dk>
2021-01-28[arbel] Clean up whitespace in MT25218_PRM.h headerChristian Iversen1-88/+88
Signed-off-by: Christian Iversen <ci@iversenit.dk>
2021-01-28[hermon] Clean up whitespace in MT25408_PRM.h headerChristian Iversen1-132/+132
Signed-off-by: Christian Iversen <ci@iversenit.dk>
2021-01-27[efi] Use EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL if availableMichael Brown1-11/+66
The original EFI_SIMPLE_TEXT_INPUT_PROTOCOL is not technically required to handle the use of the Ctrl key, and the long-obsolete EFI 1.10 specification lists only backspace, tab, linefeed, and carriage return as required. Some particularly brain-dead vendor UEFI firmware implementations dutifully put in the extra effort of ensuring that all other control characters (such as Ctrl-C) are impossible to type via EFI_SIMPLE_TEXT_INPUT_PROTOCOL. Current versions of the UEFI specification mandate that the console input handle must support both EFI_SIMPLE_TEXT_INPUT_PROTOCOL and EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL, the latter of which at least provides access to modifier key state. Unlike EFI_SIMPLE_TEXT_INPUT_PROTOCOL, the pointer to the EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL instance does not appear within the EFI system table and must therefore be opened explicitly. The UEFI specification provides no safe way to do so, since we cannot open the handle BY_DRIVER or BY_CHILD_CONTROLLER and so nothing guarantees that this pointer will remain valid for the lifetime of iPXE. We must simply hope that no UEFI firmware implementation ever discovers a motivation for reinstalling the EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL instance. Use EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL if available, falling back to the existing EFI_SIMPLE_TEXT_PROTOCOL otherwise. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-01-27[image] Implicitly trust first embedded imageJoe Groocock1-0/+3
iPXE when used as a NIC option ROM can sometimes be reloaded by the UEFI/BIOS and any pre-initialised memory will remain loaded. When the imgtrust command is run it sets `require_trusted_images'. Upon reloading, iPXE tries to load the first embedded image but fails as it is not marked trusted. Setting this flag ensures that imgtrust with the first embedded script is reentrant. Signed-off-by: Joe Groocock <jgroocock@cloudflare.com>
2021-01-27[infiniband] Require drivers to specify the number of portsChristian Iversen9-22/+9
Require drivers to report the total number of Infiniband ports. This is necessary to report the correct number of ports on devices with dynamic port types. For example, dual-port Mellanox cards configured for (eth, ib) would be rejected by the subnet manager, because they report using "port 2, out of 1". Signed-off-by: Christian Iversen <ci@iversenit.dk>
2021-01-26[efi] Fix misleading debug messageMichael Brown1-1/+2
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-01-26[ifmgmt] Make "ifstat" show the link-layer protocol for each netdevChristian Iversen1-1/+2
This is useful on devices that perform auto-detection for ports. Example output: iPXE> ifstat net0: 00:11:22:33:44:55 using mt4099 on 0000:00:03.0 (Ethernet) [open] [Link:down, TX:0 TXE:0 RX:0 RXE:0] [Link status: Unknown (http://ipxe.org/1a086101)] net1: 00:11:22:33:44:56 using mt4099 on 0000:00:03.0 (IPoIB) [open] [Link:down, TX:0 TXE:0 RX:0 RXE:0] [Link status: Initialising (http://ipxe.org/1a136101)] Signed-off-by: Christian Iversen <ci@iversenit.dk>
2021-01-26[cmdline] Expose "iflinkwait" as a commandMichael Brown4-7/+67
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-01-26[efi] Fix use of uninitialised variableMichael Brown1-0/+3
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-01-25[efi] Automatically load "/autoexec.ipxe" when booted from a filesystemMichael Brown3-10/+204
When booting iPXE from a filesystem (e.g. a FAT-formatted USB key) it can be useful to have an iPXE script loaded automatically from the same filesystem. Compared to using an embedded script, this has the advantage that the script can be edited without recompiling the iPXE binary. For the BIOS version of iPXE, loading from a filesystem is handled using syslinux (or isolinux) which allows the script to be passed to the iPXE .lkrn image as an initrd. For the UEFI version of iPXE, the platform firmware loads the iPXE .efi image directly and there is currently no equivalent of the BIOS initrd mechanism. Add support for automatically loading a file "autoexec.ipxe" (if present) from the root of the filesystem containing the UEFI iPXE binary. A combined BIOS and UEFI image for a USB key can be created using e.g. ./util/genfsimg -o usbkey.img -s myscript.ipxe \ bin-x86_64-efi/ipxe.efi bin/ipxe.lkrn The file "myscript.ipxe" would appear as "autoexec.ipxe" on the USB key, and would be loaded automatically on both BIOS and UEFI systems. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-01-25[image] Provide image_memory()Michael Brown6-76/+62
Consolidate the remaining logic common to initrd_init() and imgmem() into a shared image_memory() function. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-01-24[travis] Update to current default build environmentMichael Brown1-1/+2
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-01-24[build] Report a meaningful error message if isolinux.bin is missingMichael Brown1-2/+4
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-01-24[build] Check that mkisofs equivalent supports the required optionsMichael Brown1-19/+14
The "-e" option required for creating EFI boot images is supported only by widely used patched versions of genisoimage. Check that the required options are supported when selecting a mkisofs equivalent, thereby allowing a fallback to the use of xorrisofs when building a UEFI ISO image on a system with an unpatched version of genisoimage. Continue to prefer the use of genisoimage over xorrisofs, since there is apparently no way to inhibit the irritatingly useless startup banner message printed by xorrisofs even when the "-quiet" option is specified. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-01-22[tftp] Allow for profiling of client and server turnaround timesMichael Brown1-1/+23
Provide some visibility into the turnaround times on both client and server sides as perceived by iPXE, to assist in debugging inexplicably slow TFTP transfers. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-01-22[image] Add the "imgmem" commandMichael Brown5-0/+148
Provide the "imgmem" command to create an image from an existing block of memory, for debugging purposes only. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-01-22[image] Provide image_set_data()Michael Brown3-12/+34
Extract part of the logic in initrd_init() to a standalone function image_set_data(). Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-01-22[build] Allow an initrd script to be provided via genfsimgMichael Brown1-4/+15
Signed-off-by: Michael Brown <mcb30@ipxe.org>