summaryrefslogtreecommitdiffstats
path: root/sys/ofed/include
Commit message (Collapse)AuthorAgeFilesLines
* MFC r313555:hselasky2017-05-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | Flexible and asymmetric allocation of EQs and MSI-X vectors for PF/VFs. Previously, the mlx4 driver queried the firmware in order to get the number of supported EQs. Under SRIOV, since this was done before the driver notified the firmware how many VFs it actually needs, the firmware had to take into account a worst case scenario and always allocated four EQs per VF, where one was used for events while the others were used for completions. Now, when the firmware supports the asymmetric allocation scheme, denoted by exposing num_sys_eqs > 0 (--> MLX4_DEV_CAP_FLAG2_SYS_EQS), we use the QUERY_FUNC command to query the firmware before enabling SRIOV. Thus we can get more EQs and MSI-X vectors per function. Moreover, when running in the new firmware/driver mode, the limitation that the number of EQs should be a power of two is lifted. Obtained from: Linux (dual BSD/GPLv2 licensed) Submitted by: Dexuan Cui @ microsoft . com Differential Revision: https://reviews.freebsd.org/D8867 Sponsored by: Mellanox Technologies
* MFC r313556:hselasky2017-05-191-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change mlx4 QP allocation scheme. When using Blue-Flame, BF, the QPN overrides the VLAN, CV, and SV fields in the WQE. Thus, BF may only be used for QPNs with bits 6,7 unset. The current ethernet driver code reserves a TX QP range with 256b alignment. This is wrong because if there are more than 64 TX QPs in use, QPNs >= base + 65 will have bits 6/7 set. This problem is not specific for the Ethernet driver, any entity that tries to reserve more than 64 BF-enabled QPs should fail. Also, using ranges is not necessary here and is wasteful. The new mechanism introduced here will support reservation for "Eth QPs eligible for BF" for all drivers: bare-metal, multi-PF, and VFs (when hypervisors support WC in VMs). The flow we use is: 1. In mlx4_en, allocate Tx QPs one by one instead of a range allocation, and request "BF enabled QPs" if BF is supported for the function 2. In the ALLOC_RES FW command, change param1 to: a. param1[23:0] - number of QPs b. param1[31-24] - flags controlling QPs reservation Bit 31 refers to Eth blueflame supported QPs. Those QPs must have bits 6 and 7 unset in order to be used in Ethernet. Bits 24-30 of the flags are currently reserved. When a function tries to allocate a QP, it states the required attributes for this QP. Those attributes are considered "best-effort". If an attribute, such as Ethernet BF enabled QP, is a must-have attribute, the function has to check that attribute is supported before trying to do the allocation. In a lower layer of the code, mlx4_qp_reserve_range masks out the bits which are unsupported. If SRIOV is used, the PF validates those attributes and masks out unsupported attributes as well. In order to notify VFs which attributes are supported, the VF uses QUERY_FUNC_CAP command. This command's mailbox is filled by the PF, which notifies which QP allocation attributes it supports. Obtained from: Linux (dual BSD/GPLv2 licensed) Submitted by: Dexuan Cui @ microsoft . com Differential Revision: https://reviews.freebsd.org/D8868 Sponsored by: Mellanox Technologies
* sys/ofed: minor spelling fix.pfg2016-05-061-1/+1
| | | | | | No functional change. Reviewed by: hselasky
* More fixes for using IPv6 addresses with RDMA:hselasky2016-04-222-3/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Added check that the SCOPE ID is only restored for IPv6 linklocal addresses. - Changes made by r237263 in the "cma_bind_addr()" function did not check if the socket address was of type IPv6 and used the IPv4 socket address for IPv6 addresses. This caused the function to fail. Fixed this. - In the "rdma_gid2ip()" function and some other places the "sin6_len" and "sin6_scope_id" fields were not set for IPv6 socket addresses. Fixed this. - The scope ID is not stored as part of the GID entries and must be passed as an argument to "rdma_gid2ip()". - Added new method to "struct ib_device" which returns a pointer to the network interface which belongs to the given infiniband device. This is needed to be able to get the scope ID for IPv6 addresses via the associated ethernet interface. - Added convenience function, "rdma_get_ipv6_scope_id()", to get the scope ID for IPv6 addresses. - Implemented new "get_netdev" method for mlx4ib. Other IB controller drivers which want to support IPv6 addresses needs to implement this aswell. - Bumped the FreeBSD version due to changing "struct ib_device". Sponsored by: Mellanox Technologies MFC after: 1 week
* Fix for iWARP servers that listen on INADDR_ANY.np2016-01-222-3/+10
| | | | | | | | | | | | | | | | The iWARP Connection Manager (CM) on FreeBSD creates a TCP socket to represent an iWARP endpoint when the connection is over TCP. For servers the current approach is to invoke create_listen callback for each iWARP RNIC registered with the CM. This doesn't work too well for INADDR_ANY because a listen on any TCP socket already notifies all hardware TOEs/RNICs of the new listener. This patch fixes the server side of things for FreeBSD. We've tried to keep all these modifications in the iWARP/TCP specific parts of the OFED infrastructure as much as possible. Submitted by: Krishnamraju Eraparaju @ Chelsio (with design inputs from Steve Wise) Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D4801
* Remove unused file.hselasky2016-01-071-1/+0
|
* Fix i386 build WITH_OFED=YES. Remove some redundant KASSERTs.hselasky2015-12-041-1/+1
| | | | | | Suggested by: kib, ian Sponsored by: Mellanox Technologies MFC after: 1 week
* Updated the mlx4 and mlxen drivers to the latest version, v2.1.6:hselasky2015-12-033-1/+16
| | | | | | | | | | | | | - Added support for dumping the SFP EEPROM content to dmesg. - Fixed handling of network interface capability IOCTLs. - Fixed race when loading and unloading the mlxen driver by applying appropriate locking. - Removed two unused C-files. MFC after: 1 week Submitted by: Mark Bloch <markb@mellanox.com> Sponsored by: Mellanox Technologies Differential Revision: https://reviews.freebsd.org/D4283
* Add some defines needed by the coming mlx5 infiniband support.hselasky2015-11-241-0/+19
| | | | | Sponsored by: Mellanox Technologies MFC after: 1 week
* Finish process of moving the LinuxKPI module into the default kernel build.hselasky2015-10-2993-11588/+0
| | | | | | | | | | | | | | | | | | | - Move all files related to the LinuxKPI into sys/compat/linuxkpi and its subfolders. - Update sys/conf/files and some Makefiles to use new file locations. - Added description of COMPAT_LINUXKPI to sys/conf/NOTES which in turn adds the LinuxKPI to all LINT builds. - The LinuxKPI can be added to the kernel by setting the COMPAT_LINUXKPI option. The OFED kernel option no longer builds the LinuxKPI into the kernel. This was done to keep the build rules for the LinuxKPI in sys/conf/files simple. - Extend the LinuxKPI module to include support for USB by moving the Linux USB compat from usb.ko to linuxkpi.ko. - Bump the FreeBSD_version. - A universe kernel build has been done. Reviewed by: np @ (cxgb and cxgbe related changes only) Sponsored by: Mellanox Technologies
* Add missing FreeBSD RCS keyword and SVN properties.hselasky2015-10-275-5/+10
| | | | Sponsored by: Mellanox Technologies
* Add support for binding IRQs to CPUs in the LinuxKPI. The new functionhselasky2015-10-261-1/+18
| | | | | | | added is for BSD only and does not exist in Linux. MFC after: 1 week Sponsored by: Mellanox Technologies
* Build fix for MIPS.hselasky2015-10-261-3/+6
| | | | Sponsored by: Mellanox Technologies
* Build fix for non-i386 and non-amd64 platforms.hselasky2015-10-231-0/+6
| | | | Sponsored by: Mellanox Technologies
* Rename linuxapi[.ko] into linuxkpi[.ko], to reflect that it is ahselasky2015-10-221-2/+2
| | | | | | | | | | kernel programming interface module, KPI, to avoid confusion with the existing Linux userspace binary compatibility shims. Bump the FreeBSD_version number. Reviewed by: np @ Suggested by: dumbbell @ Sponsored by: Mellanox Technologies
* Remove all comments deriving from Linux.hselasky2015-10-211-48/+6
| | | | | | | Minor rework of ilog2() function. Suggested by: emaste @ Sponsored by: Mellanox Technologies
* Remove all comments deriving from Linux. Style file for FreeBSD.hselasky2015-10-211-146/+25
| | | | | Suggested by: emaste @ Sponsored by: Mellanox Technologies
* Reimplement header file, remove all comments deriving from Linux andhselasky2015-10-211-73/+38
| | | | | | | update copyright to 2-clause BSD. Suggested by: emaste @ Sponsored by: Mellanox Technologies
* Move location of RCS keyword according to style.hselasky2015-10-2088-133/+180
| | | | | Suggested by: jhb @ Sponsored by: Mellanox Technologies
* Add missing FreeBSD RCS keyword and SVN properties.hselasky2015-10-207-0/+7
| | | | Sponsored by: Mellanox Technologies
* Add missing FreeBSD RCS keyword and SVN properties.hselasky2015-10-207-1/+8
| | | | Sponsored by: Mellanox Technologies
* Add missing dash to copyright clause.hselasky2015-10-201-1/+1
| | | | Sponsored by: Mellanox Technologies
* Add missing FreeBSD RCS keyword and SVN properties.hselasky2015-10-2070-0/+70
| | | | Sponsored by: Mellanox Technologies
* Merge LinuxKPI changes from DragonflyBSD:hselasky2015-10-201-95/+46
| | | | | | | | | | | - Remove redundant NBLONG macro and use BIT_WORD() and BIT_MASK() instead. - Correctly define BIT_MASK() according to Linux and update all users of this macro. - Add missing GENMASK() macro. - Remove all comments deriving from Linux. Sponsored by: Mellanox Technologies
* The returned value from vm_fault_disable_pagefaults() must be storedhselasky2015-10-191-4/+13
| | | | | | | | and passed to vm_fault_enable_pagefaults(). Else possible recursion on the state can be lost. Sponsored by: Mellanox Technologies Suggested by: kib @
* Merge LinuxKPI changes from DragonflyBSD:hselasky2015-10-192-6/+59
| | | | | | | | | - Redefine DIV_ROUND_UP as a function macro taking two arguments instead of none. - Implement more Linux kernel functions related to various forms of DELAY() and basic mathematical operations. Sponsored by: Mellanox Technologies
* Merge LinuxKPI changes from DragonflyBSD:hselasky2015-10-191-1/+23
| | | | | | - Implement more Linux kernel functions. Sponsored by: Mellanox Technologies
* Merge LinuxKPI changes from DragonflyBSD:hselasky2015-10-191-5/+29
| | | | | | | | | - Define the kref structure identical to the one found in Linux. - Update clients referring inside the kref structure. - Implement kref_sub() for FreeBSD. Reviewed by: np @ Sponsored by: Mellanox Technologies
* Merge LinuxKPI changes from DragonflyBSD:hselasky2015-10-192-3/+9
| | | | | | - Map more Linux compiler related defines to FreeBSD ones. Sponsored by: Mellanox Technologies
* Map two more Linux error return codes to FreeBSD ones.hselasky2015-10-191-0/+2
| | | | Sponsored by: Mellanox Technologies
* Implement IS_ERR_OR_NULL() function.hselasky2015-10-191-1/+7
| | | | Sponsored by: Mellanox Technologies
* Merge LinuxKPI changes from DragonflyBSD:hselasky2015-10-191-4/+33
| | | | | | | - Add more list related functions and macros. - Update the hlist_for_each_entry() macro to take one less argument. Sponsored by: Mellanox Technologies
* Merge LinuxKPI changes from DragonflyBSD:hselasky2015-10-193-220/+223
| | | | | | | - Reimplement ktime header file to distinguish more from Linux. - Add new time header file to handle time related Linux functions. Sponsored by: Mellanox Technologies
* Fix compile warning.hselasky2015-10-191-1/+1
| | | | Sponsored by: Mellanox Technologies
* Merge LinuxKPI changes from DragonflyBSD:hselasky2015-10-191-96/+17
| | | | | | - Reimplement math64 header file to distinguish more from Linux. Sponsored by: Mellanox Technologies
* Merge LinuxKPI changes from DragonflyBSD:hselasky2015-10-191-18/+18
| | | | | | - Whitespace fixes. Sponsored by: Mellanox Technologies
* Merge LinuxKPI changes from DragonflyBSD:hselasky2015-10-191-1/+68
| | | | | | | | - Avoid using PAGE_MASK, because Linux defines it differently. Use (PAGE_SIZE - 1) instead. - Add support for for_each_sg_page() and sg_page_iter_dma_address(). Sponsored by: Mellanox Technologies
* Merge LinuxKPI changes from DragonflyBSD:hselasky2015-10-191-0/+11
| | | | | | - Implement schedule_timeout(). Sponsored by: Mellanox Technologies
* Merge LinuxKPI changes from DragonflyBSD:hselasky2015-10-191-1/+12
| | | | | | - Implement pagefault_disable() and pagefault_enable(). Sponsored by: Mellanox Technologies
* Merge LinuxKPI changes from DragonflyBSD:hselasky2015-10-191-6/+26
| | | | | | | | - Added support for multiple new Linux functions. - Properly implement DEFINE_WAIT() and init_waitqueue_head() macros. - Removed FreeBSD specific __wait_queue_head structure definition. Sponsored by: Mellanox Technologies
* Merge LinuxKPI changes from DragonflyBSD:hselasky2015-10-191-2/+8
| | | | | | | - Some minor whitespace fixes. - Added support for two new Linux functions. Sponsored by: Mellanox Technologies
* Currently the Linux character device mmap handling only supports mmapjhb2015-09-032-25/+22
| | | | | | | | | | | | | | | | | operations that map a single page that has an associated vm_page_t. This does not permit mapping larger regions (such as a PCI memory BAR) and it does not permit mapping addresses beyond the top of RAM (such as a 64-bit BAR located above the top of RAM). Instead of using a single OBJT_DEVICE object and passing the physaddr via the offset as a hack, create a new sglist and OBJT_SG object for each mmap request. The requested memory attribute is applied to the object thus affecting all pages mapped by the request. Reviewed by: hselasky, np MFC after: 1 week Sponsored by: Chelsio Differential Revision: https://reviews.freebsd.org/D3386
* ipv4_is_zeronet() and ipv4_is_loopback() expect an address in networkmarkj2015-08-071-2/+2
| | | | | | | | order, but IN_ZERONET and IN_LOOPBACK expect it in host order. Submitted by: Tao Liu <Tao.Liu@isilon.com> MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
* Fix broken implementation of "kvasprintf()" function by adding missinghselasky2015-07-032-16/+19
| | | | | | | | | kmalloc() call. Make function global instead of static inline to fix compiler warnings about passing variable argument lists to inline functions. MFC after: 1 week Sponsored by: Mellanox Technologies
* fd: make rights a mandatory argument to fget_unlockedmjg2015-06-161-6/+10
|
* Add SIOCGI2C ioctl support to the driver. Would work only on ConnectX-3glebius2015-05-271-0/+23
| | | | | | | | | | | | | with fresh firmware. The low level code is based on code provided by Mellanox. Thanks to Mellanox and their distributor Must (http://mustcompany.ru) for providing hardware. In collaboration with: Andre Melkoumian <andre mellanox.com> Reviewed by: hselasky Sponsored by: Netflix Sponsored by: Nginx, Inc.
* CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than tenjkim2015-05-222-3/+3
| | | | | | | | | | years for head. However, it is continuously misused as the mpsafe argument for callout_init(9). Deprecate the flag and clean up callout_init() calls to make them more consistent. Differential Revision: https://reviews.freebsd.org/D2613 Reviewed by: jhb MFC after: 2 weeks
* msecs_to_jiffies() is implemented using tvtohz(9), which always returns amarkj2015-05-101-1/+1
| | | | | | | | | | | positive value since it adds the current tick to its result. This differs from the behaviour in Linux, whose implementation does not add the extra tick, so subtract the extra tick in the OFED compat layer implementation. This addresses some incorrect handling of IB MAD timeouts, since some IB code depends on msecs_to_jiffies(0) returning 0. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
* find_next_bit() and find_next_zero_bit(): if the caller-specified offsetmarkj2015-05-101-0/+4
| | | | | | | | | | lies within the last block of the bit set and no bits are set beyond the offset, terminate the search immediately instead of continuing as though there are further blocks in the set and subsequently returning an incorrect result. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
* Don't drop the idr lock before verifying that the newly-inserted elementmarkj2015-05-021-10/+20
| | | | | | | | | | is present in the tree. Otherwise there exists a window during which the element could be removed by another thread, triggering an incorrect assertion failure. Reviewed by: jeff MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
OpenPOWER on IntegriCloud