aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/infiniband
AgeCommit message (Collapse)AuthorFilesLines
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-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[infiniband] Require drivers to specify the number of portsChristian Iversen6-0/+6
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>
2020-12-28[golan] Add new PCI IDsMohammed Taha1-0/+3
Signed-off-by: Mohammed <mohammedt@mellanox.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2020-11-05[malloc] Rename malloc_dma() to malloc_phys()Michael Brown6-108/+108
The malloc_dma() function allocates memory with specified physical alignment, and is typically (though not exclusively) used to allocate memory for DMA. Rename to malloc_phys() to more closely match the functionality, and to create name space for functions that specifically allocate and map DMA-capable buffers. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2020-09-25[pci] Update drivers to use pci_ioremap()Michael Brown7-19/+28
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2020-06-27[golan] Add explicit type casts for nodnic_queue_pair_typeMichael Brown1-2/+4
GCC 10 emits warnings for implicit conversions of enumerated types. The flexboot_nodnic code defines nodnic_queue_pair_type with values identical to those of ib_queue_pair_type, and implicitly casts between them. Add an explicit cast to fix the warning. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2019-08-17[golan] Fix address-of-pointer bug for multicast attach/detachMichael Brown1-2/+2
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2019-05-02[golan] Add various new PCI device IDsMohammed1-0/+3
Signed-off-by: Mohammed <mohammedt@mellanox.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2019-04-27[vlan] Provide vlan_netdev_rx() and vlan_netdev_rx_err()Michael Brown1-12/+6
The Hermon driver uses vlan_find() to identify the appropriate VLAN device for packets that are received with the VLAN tag already stripped out by the hardware. Generalise this capability and expose it for use by other network card drivers. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2018-03-20[golan] Set log_max_qp to 1Ameer Mahagneh2-4/+3
This is required to work around a bug in some firmware versions. Signed-off-by: Ameer Mahagneh <ameerm@mellanox.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2018-03-18[golan] Do not assume all devices are identicalMichael Brown1-5/+2
Remove the global variable shomron_nodnic_supported, since it may have different values for different PCI devices. Originally-fixed-by: Mohammed Taha <mohammedt@mellanox.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-29[build] Avoid implicit-fallthrough warnings on GCC 7Michael Brown1-0/+1
Reported-by: Vinson Lee <vlee@freedesktop.org> Reported-by: Liang Yan <lyan@suse.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-23[golan] Bug fixes and improved paging allocation methodRaed Salem17-555/+199
Updates: - revert Support for clear interrupt via BAR Signed-off-by: Raed Salem <raeds@mellanox.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-22[hermon] Assert that mapping length is non-zeroMichael Brown1-0/+1
An (impossible) mapping length of zero produces a negative bit shift, which is technically undefined. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-22[arbel] Assert that mapping length is non-zeroMichael Brown1-0/+1
An (impossible) mapping length of zero produces a negative bit shift, which is technically undefined. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-22[infiniband] Return status code from ib_create_cq() and ib_create_qp()Michael Brown2-20/+16
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>
2017-03-21[qib7322] Use correct length for memset()Michael Brown1-1/+1
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-21[linda] Use correct length for memset()Michael Brown1-1/+1
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-21[arbel] Avoid potential integer overflow when calculating memory mappingsMichael Brown1-1/+1
When the area to be mapped straddles the 2GB boundary, the expression (high+size) will overflow on the first loop iteration. Fix by using (end-size), which cannot underflow. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-21[hermon] Avoid potential integer overflow when calculating memory mappingsMichael Brown1-1/+1
When the area to be mapped straddles the 2GB boundary, the expression (high+size) will overflow on the first loop iteration. Fix by using (end-size), which cannot underflow. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-12-08[golan] Update Connect-IB, ConnectX-4 and ConnectX-4 Lx (Infiniband) supportRaed Salem23-152/+901
Updates: - Nodnic: Support for arm cq doorbell via the UAR BAR - Ensure hardware is quiescent when no interface is open - WinPE WA - Support for clear interrupt via BAR - Nodnic: Support for send TX doorbells via the UAR BAR - Added ConnectX-5EX device - Added ConnectX-5 device Signed-off-by: Raed Salem <raeds@mellanox.com> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-05-04[golan] Fix building with GCC 6Michael Brown2-6/+21
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-04-12[golan] Add missing iounmap()Wissam Shoukair1-1/+2
Signed-off-by: Wissam Shoukair <wissams@mellanox.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-04-12[mlx_icmd] Fix compilation error in GCC versions newer than 4.6.4Wissam Shoukair1-1/+1
Signed-off-by: Wissam Shoukair <wissams@mellanox.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-30[qib7322] Validate payload lengthMichael Brown1-3/+10
There is no way for the hardware to give us an invalid length in the LRH, since it must have parsed this length field in order to perform header splitting. However, this is difficult to prove conclusively. Add an unnecessary length check to explicitly reject any packets larger than the posted receive I/O buffer. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-30[linda] Validate payload lengthMichael Brown1-3/+10
There is no way for the hardware to give us an invalid length in the LRH, since it must have parsed this length field in order to perform header splitting. However, this is difficult to prove conclusively. Add an unnecessary length check to explicitly reject any packets larger than the posted receive I/O buffer. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-23[golan] Fix build error on some versions of gccChristian Hesse1-1/+1
Some versions of gcc complain that "'__bswap_variable_32' is static but used in inline function 'golan_check_rc_and_cmd_status' which is not static". Fix by making golan_check_rc_and_cmd_status() a static inline. Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-22[golan] Add Connect-IB, ConnectX-4 and ConnectX-4 Lx (Infiniband) supportWissam Shoukair55-0/+13087
Signed-off-by: Wissam Shoukair <wissams@mellanox.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-22[arbel] Fix received packet lengthMichael Brown1-2/+3
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-22[hermon] Fix received packet lengthMichael Brown1-2/+3
Debugged-by: Wissam Shoukair <wissams@mellanox.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-21[arbel] Allocate space for GRH on UD queue pairsMichael Brown2-16/+55
As with the previous commit (for Hermon), allocate a separate ring buffer to hold received GRHs. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-21[hermon] Allocate space for GRH on UD queue pairsMichael Brown2-12/+47
The Infiniband specification (volume 1, section 11.4.1.2 "Post Receive Request") notes that for UD QPs, the GRH will be placed in the first 40 bytes of the receive buffer if present. (If no GRH is present, which is normal, then the first 40 bytes of the receive buffer will be unused.) Mellanox hardware performs this placement automatically: other headers will be stripped (and their values returned via the CQE), but the first 40 bytes of the data buffer will be consumed by the (probably non-existent) GRH. This does not fit neatly into iPXE's internal abstraction, which expects the data buffer to represent just the data payload with the addresses from the GRH (if present) passed as additional parameters to ib_complete_recv(). The end result of this discrepancy is that attempts to receive full-sized 2048-byte IPoIB packets on Mellanox hardware will fail. Fix by allocating a separate ring buffer to hold the received GRHs. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-20[qib7322] Add missing iounmap()Michael Brown1-1/+3
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-20[linda] Add missing iounmap()Michael Brown1-1/+3
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-20[arbel] Add missing iounmap()Michael Brown1-10/+14
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-20[hermon] Add missing iounmap()Michael Brown1-22/+20
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-16[pseudobit] Rename bitops.h to pseudobit.hMichael Brown2-4/+4
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-12[qib7322] Use standard readq() and writeq() implementationsMichael Brown1-26/+8
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-12[linda] Use standard readq() and writeq() implementationsMichael Brown1-26/+8
This driver is the original source of the current readq() and writeq() implementations for 32-bit iPXE. Switch to using the now-centralised definitions, to avoid including architecture-specific code in an otherwise architecture-independent driver. Signed-off-by: Michael Brown <mcb30@ipxe.org>