summaryrefslogtreecommitdiffstats
path: root/src/drivers/net/ipoib.c
Commit message (Collapse)AuthorAgeFilesLines
* [infiniband] Return status code from ib_create_cq() and ib_create_qp()Michael Brown2017-03-221-11/+9Star
| | | | | | | | | | | | Any underlying errors arising during ib_create_cq() or ib_create_qp() are lost since the functions simply return NULL on error. This makes debugging harder, since a debug-enabled build is required to discover the root cause of the error. Fix by returning a status code from these functions, thereby allowing any underlying errors to be propagated. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Allow drivers to override the eIPoIB LEMACMichael Brown2016-03-211-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipoib] Allow external code to identify IPoIB network devicesMichael Brown2016-03-201-0/+18
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipoib] Increase number of transmit work queue entriesMichael Brown2016-03-081-2/+2
| | | | | | Avoid running out of transmit work queue entries under heavy load. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipoib] Resimplify test for received broadcast packetsMichael Brown2016-03-081-2/+2
| | | | | | | | | | | | Commit e62e52b ("[ipoib] Simplify test for received broadcast packets") relies upon the multicast LID being present in the destination address vector as passed to ipoib_complete_recv(). Unfortunately, this information is not present in many Infiniband devices' completion queue entries. Fix by testing instead for the presence of a multicast GID. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Assign names to queue pairsMichael Brown2016-03-081-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Allow for the creation of multicast groupsMichael Brown2016-03-081-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipoib] Simplify test for received broadcast packetsMichael Brown2016-03-081-4/+2Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipoib] Avoid unnecessary path record lookup for broadcast addressMichael Brown2016-03-081-15/+27
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Parse MLID, rate, and SL from multicast membership recordMichael Brown2016-03-081-22/+38
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Record multicast GID attachment as part of group membershipMichael Brown2016-03-081-17/+5Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Remove concept of whole-device owner dataMichael Brown2016-03-071-11/+45
| | | | | | | Remove the implicit assumption that the IPoIB protocol owns the whole Infiniband device. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipoib] Fix a race when chain-loading undionly.kpxe in IPoIBWissam Shoukair2015-08-171-2/+5
| | | | | | | | | | | | | | | The Infiniband link status change callback ipoib_link_state_changed() may be called while the IPoIB device is closed, in which case there will not be an IPoIB queue pair to be joined to the IPv4 broadcast group. This leads to NULL pointer dereferences in ib_mcast_attach() and ib_mcast_detach(). Fix by not attempting to join (or leave) the broadcast group unless we actually have an IPoIB queue pair. Signed-off-by: Wissam Shoukair <wissams@mellanox.com> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipoib] Transmit multicast packets as broadcastsMichael Brown2015-07-061-2/+4
| | | | | | | | | | | | | Multicast MAC addresses will never have REMAC cache entries, and the corresponding multicast IPoIB MAC address cannot be obtained simply by issuing an ARP request. For the trivial volume of multicast packets that we expect to send in any realistic scenario, the simplest solution is to send them as broadcasts instead. Reported-by: Wissam Shoukair <wissams@mellanox.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipoib] Attempt to generate ARPs as needed to repopulate REMAC cacheMichael Brown2015-06-291-5/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The only way to map an eIPoIB MAC address (REMAC) to an IPoIB MAC address is to intercept an incoming ARP request or reply. If we do not have an REMAC cache entry for a particular destination MAC address, then we cannot transmit the packet. This can arise in at least two situations: - An external program (e.g. a PXE NBP using the UNDI API) may attempt to transmit to a destination MAC address that has been obtained by some method other than ARP. - Memory pressure may have caused REMAC cache entries to be discarded. This is fairly likely on a busy network, since REMAC cache entries are created for all received (broadcast) ARP requests. (We can't sensibly avoid creating these cache entries, since they are required in order to send an ARP reply, and when we are being used via the UNDI API we may have no knowledge of which IP addresses are "ours".) Attempt to ameliorate the situation by generating a semi-spurious ARP request whenever we find a missing REMAC cache entry. This will hopefully trigger an ARP reply, which would then provide us with the information required to populate the REMAC cache. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipoib] Mark REMAC cache as expensiveMichael Brown2015-06-291-1/+1
| | | | | | | | As with the neighbour cache, discarding an REMAC cache entry is potentially very disruptive. Originally-fixed-by: Wissam Shoukair <wissams@mellanox.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipoib] Fix REMAC cache discarderMichael Brown2015-06-011-3/+11
| | | | | Originally-fixed-by: Wissam Shoukair <wissams@mellanox.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>
* [netdevice] Add method for generating EUI-64 address from link-layer addressMichael Brown2013-09-031-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipoib] Expose Ethernet-compatible eIPoIB link-layer addresses and headersMichael Brown2012-08-311-260/+375
| | | | | | | | | | | | | Almost all clients of the raw-packet interfaces (UNDI and SNP) can handle only Ethernet link layers. Expose an Ethernet-compatible link layer to local clients, while remaining compatible with IPoIB on the wire. This requires manipulation of ARP (but not DHCP) packets within the IPoIB driver. This is ugly, but it's the only viable way to allow IPoIB devices to be driven via the raw-packet interfaces. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Include destination address vector in ib_complete_recv()Michael Brown2012-08-311-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Use explicit "source" and "dest" address vector parameter namesMichael Brown2012-08-311-16/+16
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Allow queue pairs to have a custom allocator for receive iobufsMichael Brown2012-08-311-3/+8
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Update FSF mailing address in GPL licence textsMichael Brown2012-07-201-1/+2
| | | | | Suggested-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipoib] Report packets as broadcast when ambiguousMichael Brown2011-11-151-8/+13
| | | | | | | Avoid spurious matches for peer key 0 against empty peer cache entries, and set the LL_MULTICAST flag in addition to LL_BROADCAST. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Allow link layer to report broadcast/multicast packets via pull()Michael Brown2011-07-151-1/+4
| | | | | | | | Allow the link layer to directly report whether or not a packet is multicast or broadcast at the time of calling pull(), rather than relying on heuristics to determine this at a later stage. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Indicate that device does not support interruptsMichael Brown2011-01-251-12/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Add the notion of an Ethernet queue pair typeMichael Brown2010-09-211-0/+7
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Match GID/GUID terminology as used in the IBAMichael Brown2010-09-151-25/+25
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Add the concept of an Infiniband upper-layer driverMichael Brown2010-09-051-38/+46
| | | | | | | | | 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>
* [libc] Enable automated extraction of error usage reportsMichael Brown2010-05-311-2/+4
| | | | | | | Add preprocessor magic to the error definitions to enable every error usage to be tracked. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Rename gPXE to iPXEMichael Brown2010-04-201-8/+8
| | | | | | | | | | | Access to the gpxe.org and etherboot.org domains and associated resources has been revoked by the registrant of the domain. Work around this problem by renaming project from gPXE to iPXE, and updating URLs to match. Also update README, LOG and COPYRIGHTS to remove obsolete information. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipoib] Mask out non-QPN bits in the IPoIB destination MAC when sendingMichael Brown2009-11-161-8/+7Star
| | | | | | | The first byte of the IPoIB MAC address is used for flags indicating support for "connected mode". Strip out the non-QPN bits of the first dword when constructing the address vector for transmitted IPoIB packets, so as not to end up passing an invalid QPN in the BTH.
* [ipoib] Always set the "full membership" bit in the IPv4 broadcast GIDMichael Brown2009-11-161-1/+2
| | | | | The SM always creates the IPoIB multicast groups with full membership partition keys.
* [infiniband] Report IB link status as IPoIB netdevice statusMichael Brown2009-11-161-5/+12
|
* [netdevice] Add the concept of an "Ethernet-compatible" MAC addressMichael Brown2009-10-231-0/+57
| | | | | | | | | | | | | | The iBFT is Ethernet-centric in providing only six bytes for a MAC address. This is most probably an indirect consequence of a similar design flaw in the Windows NDIS stack. (The WinOF IPoIB stack performs all sorts of contortions in order to pretend to the NDIS layer that it is dealing with six-byte MAC addresses.) There is no sensible way in which to extend the iBFT without breaking compatibility with programs that expect to parse it. Add the notion of an "Ethernet-compatible" MAC address to our link layer abstraction, so that link layers can provide their own workarounds for this limitation.
* [netdevice] Allow the hardware and link-layer addresses to differ in sizeMichael Brown2009-08-121-5/+19
| | | | | | | | | | IPoIB has a 20-byte link-layer address, of which only eight bytes represent anything relating to a "hardware address". The PXE and EFI SNP APIs expect the permanent address to be the same size as the link-layer address, so fill in the "permanent address" field with the initial link layer address (as generated by register_netdev() based upon the real hardware address).
* [netdevice] Separate out the concept of hardware and link-layer addressesMichael Brown2009-08-121-42/+24Star
| | | | | | | | | | | The hardware address is an intrinsic property of the hardware, while the link-layer address can be changed at runtime. This separation is exposed via APIs such as PXE and EFI, but is currently elided by gPXE. Expose the hardware and link-layer addresses as separate properties within a net device. Drivers should now fill in hw_addr, which will be used to initialise ll_addr at the time of calling register_netdev().
* [infiniband] Update all other MAD users to use a management interfaceMichael Brown2009-08-091-4/+28
|
* [infiniband] Add infrastructure for RC queue pairsMichael Brown2009-07-181-1/+1
| | | | | | | | | | | | | | | | | | Queue pairs are now assumed to be created in the INIT state, with a call to ib_modify_qp() required to bring the queue pair to the RTS state. ib_modify_qp() no longer takes a modification list; callers should modify the relevant queue pair parameters (e.g. qkey) directly and then call ib_modify_qp() to synchronise the changes to the hardware. The packet sequence number is now a property of the queue pair, rather than of the device. Each queue pair may have an associated address vector. For RC queue pairs, this is the address vector that will be programmed in to the hardware as the remote address. For UD queue pairs, it will be used as the default address vector if none is supplied to ib_post_send().
* [infiniband] Add notion of a queue pair typeMichael Brown2009-07-181-1/+2
|
* [ipoib] Attempt the broadcast group join only if the link is upMichael Brown2009-07-181-9/+4Star
| | | | | Attempting the broadcast group join while the link is down is harmless, but can generate annoying volumes of debug messages.
* [ipoib] Remove the queue set abstractionMichael Brown2009-07-181-20/+36
| | | | | Now that IPoIB has to deal with only one set of queues, the queue set abstraction becomes merely an inconvenient wrapper.
* [ipoib] Kill off the now-unused IPoIB metadata queue setMichael Brown2009-07-181-144/+39Star
| | | | All packets handled by the metadata queue set now go via the GMA.
* [infiniband] Provide a general mechanism for multicast group joinsMichael Brown2009-07-181-129/+13Star
| | | | Generalise out the multicast group membership record code from IPoIB.
* [infiniband] Make qkey and rate optional parameters to ib_post_send()Michael Brown2009-07-181-6/+4Star
| | | | | | | | | | The queue key is stored as a property of the queue pair, and so can optionally be added by the Infiniband core at the time of calling ib_post_send(), rather than always having to be specified by the caller. This allows IPoIB to avoid explicitly keeping track of the data queue key.
* [ipoib] Clarify new role of IPoIB peer cache as for MAC addresses onlyMichael Brown2009-07-181-39/+21Star
| | | | | | | Now that path record lookups are handled entirely via ib_resolve_path(), the only role of the IPoIB peer cache is as a lookup table for MAC addresses. Update the code structure and comments to reflect this.
* [ipoib] Expose the real broadcast MACMichael Brown2009-07-181-46/+37Star
| | | | | | | | | | | | The IPoIB broadcast MAC address varies according to the partition key. Now that the broadcast MAC address is a property of the network device rather than of the link layer, we can expose this real MAC address directly. The broadcast LID is now identified via a path record lookup; this is marginally inefficient (since it was present in the MCMemberRecord GetResponse), but avoids the need to special-case broadcasts when constructing the address vector in ipoib_transmit().
* [ipoib] Use Infiniband broadcast QPN in IPoIB broadcast MAC addressMichael Brown2009-07-181-10/+3Star
| | | | Remove the special handling of the IPoIB broadcast QPN.
* [infiniband] Provide a general mechanism for path record lookupsMichael Brown2009-07-181-108/+8Star
| | | | Generalise out the path record lookup code from IPoIB.