summaryrefslogtreecommitdiffstats
path: root/src/net
Commit message (Collapse)AuthorAgeFilesLines
...
* [infiniband] Add support for identifying the underlying hardware deviceMichael Brown2010-09-221-0/+13
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [aoe] Add support for identifying the underlying hardware deviceMichael Brown2010-09-221-0/+13
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [aoe] Fail immediately when network device is closedMichael Brown2010-09-221-0/+8
| | | | | | | Avoid a tedious timeout delay when attempting to issue a command over a network device that has been closed. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Add the notion of an Ethernet queue pair typeMichael Brown2010-09-211-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Avoid leaving uninitialised lists in struct ib_deviceMichael Brown2010-09-211-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fc] Ignore fabric-assigned port ID for fabricless implicit logoutsMichael Brown2010-09-211-2/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fc] Allow FLOGI response to be sent to newly-assigned peer port IDMichael Brown2010-09-212-5/+27
| | | | | | | The response to a received FLOGI should probably be sent to the peer port ID assigned as a result of the WWPN comparison. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fc] Maintain port, peer and ULP lists in order of creationMichael Brown2010-09-181-3/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Add node GUID as distinct from the first port GUIDMichael Brown2010-09-164-44/+81
| | | | | | | | | | | | | | | 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>
* [infiniband] Always call ib_link_state_changed() in ib_smc_update()Michael Brown2010-09-161-2/+39
| | | | | | | | | | | | | | 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>
* [infiniband] Match GID/GUID terminology as used in the IBAMichael Brown2010-09-159-96/+69Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fcoe] Disambiguate the various error cases and add a CRC failure messageMichael Brown2010-09-151-4/+29
| | | | | | | | | | 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>
* [netdevice] Report network-layer errors via network device statisticsMichael Brown2010-09-151-2/+7
| | | | | | | | | | | | 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>
* [fcoe] Add support for Fibre Channel over EthernetMichael Brown2010-09-151-0/+383
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fcp] Add support for the Fibre Channel ProtocolMichael Brown2010-09-151-0/+1005
| | | | | | | The Fibre Channel Protocol provides a mechanism for transporting SCSI commands via a Fibre Channel fabric. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fc] Add support for Fibre Channel devicesMichael Brown2010-09-152-0/+2935
| | | | | | | 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>
* [block] Replace gPXE block-device API with an iPXE asynchronous interfaceMichael Brown2010-09-143-531/+1393
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* [infiniband] Respond to CM disconnection requestsMichael Brown2010-09-121-68/+153
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Fix TID magic signatureMichael Brown2010-09-121-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Add the concept of an Infiniband upper-layer driverMichael Brown2010-09-051-38/+82
| | | | | | | | | 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>
* [netdevice] Add the concept of a network upper-layer driverMichael Brown2010-09-051-14/+75
| | | | | | | 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>
* [retry] Hold reference while timer is running and during expiry callbackMichael Brown2010-09-039-13/+21
| | | | | | | | | 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>
* [xfer] Generalise metadata "whence" field to "flags" fieldMichael Brown2010-09-033-7/+7
| | | | | | | | | | | | | iPXE has never supported SEEK_END; the usage of "whence" offers only the options of SEEK_SET and SEEK_CUR and so is effectively a boolean flag. Further flags will be required to support additional metadata required by the Fibre Channel network model, so repurpose the "whence" field as a generic "flags" field. xfer_seek() has always been used with SEEK_SET, so remove the "whence" field altogether from its argument list. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Fix misaligned table entries when using gcc 4.5Piotr Jaroszyński2010-08-207-10/+4Star
| | | | | | | | | | Declarations without the accompanying __table_entry cause misalignment of the table entries when using gcc 4.5. Fix by adding the appropriate __table_entry macro or (where possible) by removing unnecessary forward declarations. Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [compiler] Prevent empty weak function stubs from being removedJoshua Oreman2010-08-191-1/+1
| | | | | | | | | | | | | | | | | Even with the noinline specifier added by commit 1a260f8, gcc may skip calls to non-inlinable functions that it knows have no side effects. This caused the get_cached_dhcpack() call in start_dhcp(), the weak stub of which has no code in its body, to be removed, preventing cached DHCP from working. Fix by adding a __keepme macro to compiler.h expanding to asm(""), as recommended by gcc's info page, and using it in the weak stub for get_cached_dhcpack(). Reported-by: Aaron Brooks <aaron@brooks1.net> Tested-by: Aaron Brooks <aaron@brooks1.net> Signed-off-by: Joshua Oreman <oremanj@rwcr.net> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [802.11] Fix a use-after-freeJoshua Oreman2010-08-011-0/+1
| | | | | | | | | When we received an encrypted packet, after replacing it with its decrypted version and freeing the encrypted original, we would continue to look at the header of the now-freed original packet. Fix by moving the header pointer to point at the decrypted packet instead. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [802.11] Use correct name for sec80211_detect()Joshua Oreman2010-08-011-3/+3
| | | | | | | | | The workhorse function for detecting 802.11 security was still named _sec80211_detect(), a holdover from the old style of weak function handling, with the result that all networks would be identified as "unknown". Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcp] Fix a 64bit compile time errorPiotr Jaroszyński2010-07-221-1/+1
| | | | | Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcp] Allow out-of-order receive queue to be discardedMichael Brown2010-07-211-3/+38
| | | | | | | | | Allow packets in the receive queue to be discarded in order to free up memory. This avoids a potential deadlock condition in which the missing packet can never be received because the receive queue is occupying all of the memory available for further RX buffers. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcp] Handle out-of-order received packetsMichael Brown2010-07-211-34/+150
| | | | | | | | | | | | | | | Maintain a queue of received packets, so that lost packets need not result in retransmission of the entire TCP window. Increase the TCP window to 8kB, in order that we can potentially transmit enough duplicate ACKs to trigger Fast Retransmission at the sender. Using a 10MB HTTP download in qemu-kvm with an artificial drop rate of 1 in 64 packets, this reduces the download time from around 26s to around 4s. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Provide a test mechanism for discarding packets at randomMichael Brown2010-07-201-1/+19
| | | | | | | | | | Setting NETDEV_DISCARD_RATE to a non-zero value will cause one in every NETDEV_DISCARD_RATE packets to be discarded at random on both the transmit and receive datapaths, allowing the robustness of upper-layer network protocols to be tested even in simulation environments that provide wholly reliable packet transmission. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcp] Treat ACKs as sent only when successfully transmittedMichael Brown2010-07-151-21/+20Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | iPXE currently forces sending (i.e. sends a pure ACK even in the absence of fresh data to send) only in response to packets that consume sequence space or that lie outside of the receive window. This ignores the possibility that a previous ACK was not actually sent (due to, for example, the retransmission timer running). This does not cause incorrect behaviour, but does cause unnecessary retransmissions from our peer. For example: 1. Peer sends final data packet (ack 106 seq 521..523) 2. We send FIN (seq 106..107 ack 523) 3. Peer sends FIN (ack 106 seq 523..524) 4. We send nothing since retransmission timer is running for our FIN 5. Peer ACKs our FIN (ack 107 seq 524..524) 6. We send nothing since this packet consumes no sequence space 7. Peer retransmits FIN (ack 107 seq 523..524) 8. We ACK peer's FIN (seq 107..107 ack 524) What should happen at step (6) is that we should ACK the peer's FIN, since we can deduce that we have never sent this ACK. Fix by maintaining an "ACK pending" flag that is set whenever we are made aware that our peer needs an ACK (whether by consuming sequence space or by sending a packet that appears out of order), and is cleared only when the ACK packet has been transmitted. Reported-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcp] Merge boolean flags into a single "flags" fieldMichael Brown2010-07-151-8/+15
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcp] Use a dedicated timer for the TIME_WAIT stateMichael Brown2010-07-151-9/+32
| | | | | | | | | | | | | | | | | | iPXE currently repurposes the retransmission timer to hold the TCP connection in the TIME_WAIT state (i.e. waiting for up to 2*MSL in case we are required to re-ACK our peer's FIN due to a lost ACK). However, the fact that this timer is running will prevent such an ACK from ever being sent, since the logic in tcp_xmit() assumes that a running timer indicates that we ourselves are waiting for an ACK and so blocks the transmission. (We always wait for an ACK before sending our next packet, to keep our transmit data path as simple as possible.) Fix by using an entirely separate timer for the TIME_WAIT state, so that packets can still be sent. Reported-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcp] Randomise local TCP portGuo-Fu Tseng2010-07-131-3/+5
| | | | | | Signed-off-by: Guo-Fu Tseng <cooldavid@cooldavid.org> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcp] Fix typos by changing ntohl() to htonl() where appropriateMichael Brown2010-07-131-2/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcp] Store local port in host byte orderMichael Brown2010-07-131-9/+9
| | | | | | | Every other scalar integer value in struct tcp_connection is in host byte order; change the definition of local_port to match. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcp] Fix potential use-after-free when accessing timestamp optionMichael Brown2010-07-071-4/+7
| | | | | Reported-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tls] Handle multiple handshake recordsMichael Brown2010-06-231-39/+54
| | | | | | | The handshake record in TLS can contain multiple messages. Originally-fixed-by: Timothy Stack <tstack@vmware.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [http] Pass through unknown interface method callsMichael Brown2010-06-221-2/+4
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [interface] Convert all data-xfer interfaces to generic interfacesMichael Brown2010-06-2212-636/+408Star
| | | | | | | | | | | | | | Remove data-xfer as an interface type, and replace data-xfer interfaces with generic interfaces supporting the data-xfer methods. Filter interfaces (as used by the TLS layer) are handled using the generic pass-through interface capability. A side-effect of this is that deliver_raw() no longer exists as a data-xfer method. (In practice this doesn't lose any efficiency, since there are no instances within the current codebase where xfer_deliver_raw() is used to pass data to an interface supporting the deliver_raw() method.) Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [interface] Convert all name-resolution interfaces to generic interfacesMichael Brown2010-06-221-6/+18
| | | | | | | | Remove name-resolution as an interface type, and replace name-resolution interfaces with generic interfaces supporting the resolv_done() method. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [interface] Convert all job-control interfaces to generic interfacesMichael Brown2010-06-221-30/+16Star
| | | | | | | | | Remove job-control as an interface type, and replace job-control interfaces with generic interfaces supporting the close() method. (Both done() and kill() are absorbed into the function of close(); kill() is merely close(-ECANCELED).) Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [retry] Use start_timer_fixed() instead of direct timeout manipulationMichael Brown2010-06-222-4/+2Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [retry] Add timer_init() wrapper functionMichael Brown2010-06-228-11/+11
| | | | | | | Standardise on using timer_init() to initialise an embedded retry timer, to match the coding style used by other embedded objects. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [refcnt] Add ref_init() wrapper functionMichael Brown2010-06-2214-10/+15
| | | | | | | Standardise on using ref_init() to initialise an embedded reference count, to match the coding style used by other embedded objects. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Enable automated extraction of error usage reportsMichael Brown2010-05-317-98/+145
| | | | | | | Add preprocessor magic to the error definitions to enable every error usage to be tracked. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dhcp] Use correct DHCP options on EFI systemsGeoff Lywood2010-05-291-8/+5Star
| | | | | | | | See RFC 4578 for details. Signed-off-by: Joshua Oreman <oremanj@rwcr.net> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iscsi] Allow base64 encoding in large binary valuesPiotr Jaroszyński2010-05-281-23/+47
| | | | | Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iscsi] Use generic base16 functions for iSCSI reverse CHAPMichael Brown2010-05-281-24/+17Star
| | | | | | Yes, I forgot to convert this function before pushing. Signed-off-by: Michael Brown <mcb30@ipxe.org>