david/ipxe
david
/
ipxe
Archived
1
0
Fork 0
Commit Graph

3524 Commits

Author SHA1 Message Date
Michael Brown 92ced72080 [hermon] Minimise the number of VPM mapping operations
Mapping a single page at a time causes a several-second delay at
device initialisation time.  Reduce this by mapping multiple pages at
a time, using the largest block sizes possible given the alignment
constraints.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-18 23:20:50 +01:00
Michael Brown 8cd2b170b6 [arbel] Minimise the number of VPM mapping operations
Mapping a single page at a time causes a several-second delay at
device initialisation time.  Reduce this by mapping multiple pages at
a time, using the largest block sizes possible given the alignment
constraints.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-18 23:00:57 +01:00
Michael Brown 24efbaefe7 [fc] Maintain port, peer and ULP lists in order of creation
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-18 13:23:58 +01:00
Michael Brown 62115cf437 [arbel] Allocate only as much memory as is needed for firmware and ICM
Use individual page mappings rather than a single whole-region
mapping, to avoid the waste of memory that occurs due to the
constraint that each mapped block must be aligned on its own size.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-18 03:26:01 +01:00
Michael Brown d9aef1b50a [arbel] Synchronise changes with the Hermon driver
Backport some changes from the Hermon driver to the Arbel driver.
Specifically:

 o  Rename reserved_lkey to lkey

 o  Add arbel_rate() to calculate transmission rates

 o  Structure code to allow for addition of RC queue pairs

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-17 22:57:20 +01:00
Michael Brown 144a23a852 [arbel] Optimise ICM layout to reduce overall memory usage
Reduce the amount of ICM space required by choosing to order the
various allocations in approximately descending order of alignment
requirements.

This saves approximately 512kB of host memory.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-17 22:55:14 +01:00
Michael Brown d84e4e0575 [arbel] Perform ICM allocations according to the specification
The current method for ICM allocation exactly matches the addresses
chosen by the old Etherboot driver, but does not match the
specification.  Some ICM tables (notably the queue pair context table)
therefore end up incorrectly aligned.

Fix by performing allocations as per the specification.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-17 05:51:34 +01:00
Michael Brown f7a49e23e9 [arbel] Allow for multiple calls to ib_modify_qp()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-17 05:49:34 +01:00
Michael Brown a5909384a8 [arbel] Inform embedded SMA of partition key changes
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-17 05:47:34 +01:00
Michael Brown 767e27e06b [arbel] Improve debugging output and facilities
Improve the utility of debugging messages by including the relevant
port number, queue number (QPN, CQN, EQN), work queue entry (WQE)
number, and physical addresses wherever applicable.

Add arbel_dump_cqctx() for dumping a completion queue context and
arbel_dump_qpctx() for dumping a queue pair context.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-17 05:45:40 +01:00
Michael Brown 4cb157a3b7 [arbel] Randomise the high-order bits of queue pair numbers
This is a backport of commit 0b1222f ("[hermon] Randomise the
high-order bits of queue pair numbers") to the Arbel driver.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-17 05:43:47 +01:00
Michael Brown 40d7c70438 [arbel] Allow software GMA to receive packets destined for QP1
This is a backport of commit cd5a213 ("[hermon] Allow software GMA to
receive packets destined for QP1") to the Arbel driver.

This patch includes a correction to a bug in the autogenerated
hardware description header file.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-17 05:41:57 +01:00
Michael Brown 46f2580049 [arbel] Map all event types to our event queue
Only port state change events are currently mapped to our event queue,
since those are the only events we are prepared to handle.  This
ignores a potentially useful source of diagnostic information in the
case of unexpected failures.

Fix by mapping all events to the event queue; a build with debugging
enabled will therefore at least dump the raw content of the unexpected
events.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-17 05:38:13 +01:00
Michael Brown e4ed060983 [hermon] Map all event types to our event queue
Only port state change events are currently mapped to our event queue,
since those are the only events we are prepared to handle.  This
ignores a potentially useful source of diagnostic information in the
case of unexpected failures.

Fix by mapping all events to the event queue; a build with debugging
enabled will therefore at least dump the raw content of the unexpected
events.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-16 22:06:20 +01:00
Michael Brown 42cf4a720c [infiniband] Add node GUID as distinct from the first port GUID
iPXE currently uses the first port's port GUID as the node GUID,
rather than using the (possibly distinct) real node GUID.  This can
confuse opensm during the handover to a loaded OS: it thinks the port
already belongs to a different node and so discards our port
information with a warning message about duplicate ports.  Everything
is picked up correctly on the second subnet sweep, after opensm has
established that the "old" node no longer exists, but this can delay
link-up unnecessarily by several seconds.

Fix by using the real node GUID.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-16 03:30:45 +01:00
Michael Brown 3e8e2773de [arbel] Poll for link state changes while DOWN
No event is generated upon reaching INIT, so we must poll separately
for link state changes while we remain DOWN.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-16 03:30:45 +01:00
Michael Brown 14a76b5927 [hermon] Poll for link state changes while DOWN
No event is generated upon reaching INIT, so we must poll separately
for link state changes while we remain DOWN.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-16 03:30:45 +01:00
Michael Brown 09555826e9 [infiniband] Always call ib_link_state_changed() in ib_smc_update()
ib_smc_update() potentially updates the Infiniband port state, and so
should almost always be followed by a call to ib_link_state_changed().
The one exception is the call made to ib_smc_update() before the
device is registered.

Fix by removing explicit calls to ib_link_state_changed() from drivers
using ib_smc_update(), including a call to ib_link_state_changed()
within ib_smc_update(), and creating a separate ib_smc_init() for use
prior to device registration.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-16 03:30:45 +01:00
Michael Brown 5e697b64a5 [scsi] Include sense key within error number reported to user
The sense key gives a first idea of what the problem might be, and so
is potentially useful in diagnosing problems in a non-debug build.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-15 22:23:48 +01:00
Michael Brown 52e54a8c69 [infiniband] Match GID/GUID terminology as used in the IBA
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-15 19:25:05 +01:00
Michael Brown 3ea3c846d8 [e1000] Strip the Ethernet CRC from received packets
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-15 05:14:57 +01:00
Michael Brown 6574c55e27 [fcoe] Disambiguate the various error cases and add a CRC failure message
It seems as though several drivers neglect to strip the Ethernet CRC,
which will cause the FCoE footer to be misplaced and result
(coincidentally) in an "invalid CRC" error from FCoE.

Add a human-visible message indicating this, to aid in diagnosis.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-15 05:11:28 +01:00
Michael Brown 85a3169967 [netdevice] Report network-layer errors via network device statistics
Errors generated by the network layer in response to received packets
are liable to be lost, since nothing systematically records these
errors and often the packets do not propagate far enough through the
stack to impact upon user-visible processes.

Improve this situation by recording network-layer errors in the
network device statistics.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-15 05:08:16 +01:00
Michael Brown dace106f82 [fcoe] Add support for Fibre Channel over Ethernet
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-15 03:20:54 +01:00
Michael Brown d2a2618d76 [fcp] Add support for the Fibre Channel Protocol
The Fibre Channel Protocol provides a mechanism for transporting SCSI
commands via a Fibre Channel fabric.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-15 03:20:26 +01:00
Michael Brown bf2657075d [fc] Add Fibre Channel management commands
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-15 03:17:30 +01:00
Michael Brown 508ff4d614 [fc] Add support for Fibre Channel devices
Add support for Fibre Channel ports, peers, and upper-layer protocols,
and for Fibre Channel extended link services.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-15 03:16:24 +01:00
Michael Brown 220495f8bf [block] Replace gPXE block-device API with an iPXE asynchronous interface
The block device interface used in gPXE predates the invention of even
the old gPXE data-transfer interface, let alone the current iPXE
generic asynchronous interface mechanism.  Bring this old code up to
date, with the following benefits:

 o  Block device commands can be cancelled by the requestor.  The INT 13
    layer uses this to provide a global timeout on all INT 13 calls,
    with the result that an unexpected passive failure mode (such as
    an iSCSI target ACKing the request but never sending a response)
    will lead to a timeout that gets reported back to the INT 13 user,
    rather than simply freezing the system.

 o  INT 13,00 (reset drive) is now able to reset the underlying block
    device.  INT 13 users, such as DOS, that use INT 13,00 as a method
    for error recovery now have a chance of recovering.

 o  All block device commands are tagged, with a numerical tag that
    will show up in debugging output and in packet captures; this will
    allow easier interpretation of bug reports that include both
    sources of information.

 o  The extremely ugly hacks used to generate the boot firmware tables
    have been eradicated and replaced with a generic acpi_describe()
    method (exploiting the ability of iPXE interfaces to pass through
    methods to an underlying interface).  The ACPI tables are now
    built in a shared data block within .bss16, rather than each
    requiring dedicated space in .data16.

 o  The architecture-independent concept of a SAN device has been
    exposed to the iPXE core through the sanboot API, which provides
    calls to hook, unhook, boot, and describe SAN devices.  This
    allows for much more flexible usage patterns (such as hooking an
    empty SAN device and then running an OS installer via TFTP).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-14 20:37:15 +01:00
Michael Brown 46c7f99c66 [hermon] Use correct alignment for doorbell records
Doorbell records are currently embedded within the completion queue
and receive work queue strucures, which are allocated using zalloc()
and so have an alignment guarantee of only sizeof(void*), i.e. four
bytes.  This is sufficient for the receive work queue, but not for the
completion queue, which requires an alignment guarantee of eight
bytes.

Though not guaranteed, it so happens that zalloc() will always return
a pointer that is exactly four bytes above a sixteen-byte boundary.
The completion queue doorbell record is therefore always misaligned,
and the value passed to the hardware via SW2HW_CQ is actually always
pointing to the page_offset value within the MTT descriptor (which
directly precedes the inline doorbell record).  Provided that the page
offset is greater than 0x100, this looks to the hardware like an
update_ci value of greater than 0x010000 (taking into account
endianness differences), and so the hardware will happily deliver more
than 0x010000 completions before stopping.  Hence this problem is
rarely observable.

Fix by allocating the doorbell records separately and using the
correct alignment constraints.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-12 22:46:01 +01:00
Michael Brown 30e7d7efa1 [hermon] Set event queue number for completion queues
Give completion queues a chance to deliver exception events by
programming in the number of our event queue (currently used only for
port state changes).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-12 22:35:42 +01:00
Michael Brown 42f451e070 [hermon] Improve debugging output and facilities
Improve the utility of debugging messages by including the relevant
port number, queue number (QPN, CQN, EQN), work queue entry (WQE)
number, and physical addresses wherever applicable.

Add hermon_dump_cqctx() for dumping a completion queue context, and
hermon_fill_nop_send_wqe() for inserting NOPs into send work queues.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-12 22:35:13 +01:00
Michael Brown ef8452a642 [infiniband] Respond to CM disconnection requests
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-12 22:32:02 +01:00
Michael Brown e6519af60d [infiniband] Fix TID magic signature
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-12 22:28:53 +01:00
Michael Brown 50da1122e6 [infiniband] Include SRP by default, but only for Infiniband builds
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-12 22:26:44 +01:00
Michael Brown 588ba3ee9a [ethernet] Include AoE only for Ethernet builds
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-12 22:25:48 +01:00
Michael Brown 79dd00bb3a [build] Remove unnecessary constraint on DBG_ENABLE()/DBG_DISABLE()
DBG_ENABLE() and DBG_DISABLE() are currently constrained to enabling
and disabling only debug levels that are compiled in for the current
object.  For example, a DBG_ENABLE(DBGLVL_EXTRA) in foo.c will not be
able to affect output from other objects at DBGLVL_EXTRA unless foo.c
is itself compiled with DBGLVL_EXTRA enabled.

Partially fix by removing this unnecessary constraint.  (Note that it
is still necessary for at least one debug level to be compiled in for
the object invoking DBG_ENABLE()/DBG_DISABLE().)

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-12 22:24:06 +01:00
Michael Brown 97eda5be0d [multiboot] Reduce length of "Features" startup banner
Minimise the chances of an unwanted line wrap on the iPXE feature list
printed at startup.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-12 22:18:11 +01:00
Michael Brown 0f65efc185 [retry] Add TIMER_INIT() for initialising static timers
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-06 22:18:13 +01:00
Michael Brown e9efbcd84c [rtl8139] Check for oversized packets when transmitting
An attempt to transmit a packet of 8192 bytes or larger will collide
with the status bits in the TX descriptor.  This gives the appearance
of the network card's transmit data path having just suddenly stopped
responding; iPXE is waiting for the card to report a TX completion
but, because of the status bit collision, the card thinks that the
descriptor has not yet been written.

Fix by explicitly checking for oversized packets in rtl_transmit().

Discovered during Fibre Channel over Ethernet testing, and debugged by
using gdb to examine the state of the emulated rtl8139 card in qemu.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-05 18:58:10 +01:00
Michael Brown c8199aacaa [xfer] Add xfer_window_changed()
xfer_window_changed() can be used to notify peers that an interface is
now ready to accept data.  This can potentially be used to eliminate
the need for wasteful processes that simply poll xfer_window() until
the window becomes non-zero.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-05 03:12:17 +01:00
Michael Brown 35b19d8848 [infiniband] Add the concept of an Infiniband upper-layer driver
Replace the explicit calls from the Infiniband core to the IPoIB layer
with the general concept of an Infiniband upper-layer driver
(analogous to a PCI driver) which can create arbitrary devices on top
of Infiniband devices.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-05 03:06:16 +01:00
Michael Brown ca4df90a63 [netdevice] Add the concept of a network upper-layer driver
Add the concept of a network upper-layer driver, which can create
arbitrary devices on top of network devices.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-05 03:03:38 +01:00
Michael Brown 97ef28aea0 [netdevice] Call netdev_link_[up|down|err]() only while registered
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-05 02:51:46 +01:00
Michael Brown 3950d1d8e6 [sis190] Initialise network device before calling register_netdev()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-05 02:50:30 +01:00
Michael Brown c04b6ccd75 [tables] Add for_each_table_entry_continue() and _continue_reverse()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-05 02:49:06 +01:00
Michael Brown a3021ad0e4 [rtl8139] Strip CRC from received packets
The rtl8139 driver includes the Ethernet CRC within the received
packet.  All current protocols ignore trailing garbage, but FCoE
requires the frame length to be correct (since the FCoE footer
position is calculated from the end of the packet), so fix the driver
to strip out the CRC.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-03 21:29:44 +01:00
Michael Brown 28934eef81 [retry] Hold reference while timer is running and during expiry callback
Guarantee that a retry timer cannot go out of scope while the timer is
running, and provide a guarantee to the expiry callback that the timer
will remain in scope during the entire callback (similar to the
guarantee provided to interface methods).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-03 21:28:43 +01:00
Michael Brown 25447294d5 [process] Add process_running()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-03 21:26:21 +01:00
Michael Brown da123eada4 [tables] Add table_index()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-03 21:25:06 +01:00
Michael Brown 0329673833 [xfer] Add xfer_deliver_raw_meta()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-03 21:23:16 +01:00