aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/mlx5/mlx5_ib
Commit message (Collapse)AuthorAgeFilesLines
* Make mlx5_cmd_exec_cb() a safe API in mlx5core.Hans Petter Selasky2020-11-162-4/+10
| | | | | | | | | | | | | | | | | | | | APIs that have deferred callbacks should have some kind of cleanup function that callers can use to fence the callbacks. Otherwise things like module unloading can lead to dangling function pointers, or worse. The IB MR code is the only place that calls this function and had a really poor attempt at creating this fence. Provide a good version in the core code as future patches will add more places that need this fence. Linux commit: e355477ed9e4f401e3931043df97325d38552d54 MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Notes: svn path=/head/; revision=367719
* Report EQE data upon CQ completion in mlx5core.Hans Petter Selasky2020-11-162-2/+2
| | | | | | | | | | | | | Report EQE data upon CQ completion to let upper layers use this data. Linux commit: 4e0e2ea1886afe8c001971ff767f6670312a9b04 MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Notes: svn path=/head/; revision=367718
* Enhance the mlx5_core_create_cq() function in mlx5core.Hans Petter Selasky2020-11-161-1/+2
| | | | | | | | | | | | | | Enhance mlx5_core_create_cq() to get the command out buffer from the callers to let them use the output. Linux commit: 38164b771947be9baf06e78ffdfb650f8f3e908e MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Notes: svn path=/head/; revision=367717
* Fix error handling order in create_kernel_qp in mlx5ib.Hans Petter Selasky2020-11-161-2/+2
| | | | | | | | | | | | | Make sure order of cleanup is exactly the opposite of initialization. Linux commit: f4044dac63e952ac1137b6df02b233d37696e2f5 MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Notes: svn path=/head/; revision=367715
* Infiniband clients must be attached and detached in a specific order in ibcore.Hans Petter Selasky2020-07-061-2/+2
| | | | | | | | | | | | | | | | | | | Currently the linking order of the infiniband, IB, modules decide in which order the clients are attached and detached. For example one IB client may use resources from another IB client. This can lead to a potential deadlock at shutdown. For example if the ipoib is unregistered after the ib_multicast client is detached, then if ipoib is using multicast addresses a deadlock may happen, because ib_multicast will wait for all its resources to be freed before returning from the remove method. Fix this by using module_xxx_order() instead of module_xxx(). Differential Revision: https://reviews.freebsd.org/D23973 MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=362953
* mlx5en: Support 50GBase-KR4 media type in mlx5en driver.Konstantin Belousov2020-03-041-0/+1
| | | | | | | | | | Submitted by: Adam Peace <adam.e.peace@gmail.com> Reviewed by: hselasky Sponsored by: Mellanox Technologies MFC after: 1 week Notes: svn path=/head/; revision=358624
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki2020-02-261-3/+6
| | | | | | | | | | | | | | | | | | | r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly marked). Use it in preparation for a general review of all nodes. This is non-functional change that adds annotations to SYSCTL_NODE and SYSCTL_PROC nodes using one of the soon-to-be-required flags. Mark all obvious cases as MPSAFE. All entries that haven't been marked as MPSAFE before are by default marked as NEEDGIANT Approved by: kib (mentor, blanket) Commented by: kib, gallatin, melifaro Differential Revision: https://reviews.freebsd.org/D23718 Notes: svn path=/head/; revision=358333
* Fix broken MLX5_IB_INDEX() macro in mlx5ib(4).Hans Petter Selasky2020-02-212-5/+11
| | | | | | | | | | | | | | The index should be computed as distance from arg[0] and not the beginning of struct mlx5_ib_congestion . While at it fix a use of zero length array to avoid depending on undefined compiler behaviour. MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=358220
* Bump driver version for mlx5core, mlx5en(4) and mlx5ib(4).Hans Petter Selasky2019-10-021-2/+2
| | | | | | | | MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=352998
* Update warning and error print formats in mlx5ib.Hans Petter Selasky2019-10-021-2/+2
| | | | | | | | | Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=352957
* Fix reported max SGE calculation in mlx5ib.Hans Petter Selasky2019-10-022-4/+33
| | | | | | | | | | | | | Add the 512 bytes limit of RDMA READ and the size of remote address to the max SGE calculation. Submitted by: slavash@ Linux commit: 288c01b746aa MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=352956
* Bump the Mellanox driver version numbers and the FreeBSD version number.Hans Petter Selasky2019-05-081-2/+2
| | | | | | | | MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347325
* Always return success for RoCE modify port in mlx5ib.Hans Petter Selasky2019-05-081-0/+8
| | | | | | | | | | | | | | | | | | CM layer calls ib_modify_port() regardless of the link layer. For the Ethernet ports, qkey violation and Port capabilities are meaningless. Therefore, always return success for ib_modify_port calls on the Ethernet ports. Linux Commit: ec2558796d25e6024071b6bcb8e11392538d57bf Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347304
* Add support for new rates to mlx5ib.Hans Petter Selasky2019-05-082-7/+69
| | | | | | | | | Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347303
* Add support for 200Gb ethernet speeds to mlx5core.Hans Petter Selasky2019-05-081-2/+2
| | | | | | | | | Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347299
* Remove unused module parameter in mlx5ib.Hans Petter Selasky2019-05-081-7/+0
| | | | | | | | MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347259
* Make sure to error out when arming the CQ fails in mlx4ib and mlx5ib.Hans Petter Selasky2019-05-081-2/+5
| | | | | | | | MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347258
* Import Linux code to implement mlx5_ib_disassociate_ucontext() in mlx5ib.Hans Petter Selasky2019-05-081-0/+66
| | | | | | | | | Submitted by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347251
* mlx4/mlx5: Updated driver version to 3.5.0Slava Shwartsman2018-12-051-2/+2
| | | | | | | | | Approved by: hselasky (mentor) MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=341587
* mlx5ib: Set default active width and speed when querying port.Slava Shwartsman2018-12-051-0/+2
| | | | | | | | | | | | | | | | | Make sure the active width and speed is set in case the translate_eth_proto_oper() function doesn't recognize the current port operation mask. Linux commit: 7672ed33c4c15dbe9d56880683baaba4227cf940 Submitted by: hselasky@ Approved by: hselasky (mentor) MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=341571
* mlx5ib: Make sure the congestion work timer does not escape the drain procedure.Slava Shwartsman2018-12-051-1/+2
| | | | | | | | | | | | | | | If the mlx5_ib_read_cong_stats() function was running when mlx5ib was unloaded, because this function unconditionally restarts the timer, the timer can still be pending after the delayed work has been cancelled. To fix this simply loop on the delayed work cancel procedure as long as it returns non-zero. Submitted by: hselasky@ Approved by: hselasky (mentor) MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=341570
* mlx5ib: Fix null pointer dereference in mlx5_ib_create_srqSlava Shwartsman2018-12-051-1/+1
| | | | | | | | | | | | Although "create_srq_user" does overwrite "in.pas" on some paths, it also contains at least one feasible path which does not overwrite it. Approved by: hselasky (mentor) MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=341569
* mlx5ib: Fix sign extension in mlx5_ib_query_deviceSlava Shwartsman2018-12-051-1/+1
| | | | | | | | | | | | | | | "fw_rev_min(dev->mdev)" with type "unsigned short" (16 bits, unsigned) is promoted in "fw_rev_min(dev->mdev) << 16" to type "int" (32 bits, signed), then sign-extended to type "unsigned long" (64 bits, unsigned). If "fw_rev_min(dev->mdev) << 16" is greater than 0x7FFFFFFF, the upper bits of the result will all be 1. Approved by: hselasky (mentor) MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=341568
* mlx5: Fix driver version locationSlava Shwartsman2018-12-051-3/+9
| | | | | | | | | | | Driver description should be set by core and not by the Ethernet driver. Approved by: hselasky (mentor) MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=341567
* mlx5: Add SRQ fixes from LinuxSlava Shwartsman2018-12-051-15/+19
| | | | | | | | | | | | | | | | Combine multiple fixes from Linux to SRQ. Linux commits: c73b791 IB/mlx5: Assign SRQ type earlier 0fd27a8 IB/mlx5: Fix out-of-bound access c2b37f7 IB/mlx5: Fix integer overflows in mlx5_ib_create_srq d63c467 RDMA/mlx5: Fix memory leak in mlx5_ib_create_srq() error path Approved by: hselasky (mentor) MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=341557
* mlx5: Raise fatal IB event when sys error occursSlava Shwartsman2018-12-051-8/+2
| | | | | | | | | | | | | | | | | | | | | All other mlx5_events report the port number as 1 based, which is how FW reports it in the port event EQE. Reporting 0 for this event causes mlx5_ib to not raise a fatal event notification to registered clients due to a seemingly invalid port. All switch cases in mlx5_ib_event that go through the port check are supposed to set the port now, so just do it once at variable declaration. Linux commit: aba462134634b502d720e15b23154f21cfa277e5 Approved by: hselasky (mentor) MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=341554
* mlx5: Fix integer overflow while resizing CQSlava Shwartsman2018-12-051-1/+6
| | | | | | | | | | | | | | | The user can provide very large cqe_size which will cause to integer overflow. Linux commit: 28e9091e3119933c38933cb8fc48d5618eb784c8 Approved by: hselasky (mentor) MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=341553
* Update version information for the mlx5ib module.Hans Petter Selasky2018-07-171-4/+6
| | | | | | | | MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=336395
* Don't pass unsupported events to ibcore from mlx5ib.Hans Petter Selasky2018-07-171-2/+3
| | | | | | | | MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=336394
* Use static device naming instead of dynamic one in mlx5ib.Hans Petter Selasky2018-07-171-4/+1
| | | | | | | | | | | | | When resetting mlx5core instances it can happen that the order of attach and detach for mlx5ib instances is changed. Take the unit number for mlx5_%d from the parent PCI device, similarly to what is done in mlx5en(4), so that there is a direct relationship between mce<N> and mlx5_<N>. MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=336393
* Implement support for Differentiated Service Code Point, DSCP, in mlx5en(4).Hans Petter Selasky2018-07-173-0/+30
| | | | | | | | | | | | | | | | | The DSCP feature is controlled using a set of sysctl(8) fields under the qos sysctl directory entry for mlx5en(4). For Routable RoCE QPs, the DSCP should be set in the QP's address path. The DSCP's value is derived from the traffic class. Linux commit: ed88451e1f2d400fd6a743d0a481631cf9f97550 MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=336392
* Add support for prio-tagged traffic for RDMA in ibcore.Hans Petter Selasky2018-07-171-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | When receiving a PCP change all GID entries are reloaded. This ensures the relevant GID entries use prio tagging, by setting VLAN present and VLAN ID to zero. The priority for prio tagged traffic is set using the regular rdma_set_service_type() function. Fake the real network device to have a VLAN ID of zero when prio tagging is enabled. This is logic is hidden inside the rdma_vlan_dev_vlan_id() function which must always be used to retrieve the VLAN ID throughout all of ibcore and the infiniband network drivers. The VLAN presence information then propagates through all of ibcore and so incoming connections will have the VLAN bit set. The incoming VLAN ID is then checked against the return value of rdma_vlan_dev_vlan_id(). MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=336372
* UDP: further performance improvements on txMatt Macy2018-05-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cumulative throughput while running 64 netperf -H $DUT -t UDP_STREAM -- -m 1 on a 2x8x2 SKL went from 1.1Mpps to 2.5Mpps Single stream throughput increases from 910kpps to 1.18Mpps Baseline: https://people.freebsd.org/~mmacy/2018.05.11/udpsender2.svg - Protect read access to global ifnet list with epoch https://people.freebsd.org/~mmacy/2018.05.11/udpsender3.svg - Protect short lived ifaddr references with epoch https://people.freebsd.org/~mmacy/2018.05.11/udpsender4.svg - Convert if_afdata read lock path to epoch https://people.freebsd.org/~mmacy/2018.05.11/udpsender5.svg A fix for the inpcbhash contention is pending sufficient time on a canary at LLNW. Reviewed by: gallatin Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D15409 Notes: svn path=/head/; revision=334118
* Set correct SL in completion for RoCE in mlx5ib(4).Hans Petter Selasky2018-03-081-3/+16
| | | | | | | | | | | | | | | | | | | | There is a difference when parsing a completion entry between Ethernet and IB ports. When link layer is Ethernet the bits describe the type of L3 header in the packet. In the case when link layer is Ethernet and VLAN header is present the value of SL is equal to the 3 UP bits in the VLAN header. If VLAN header is not present then the SL is undefined and consumer of the completion should check if IB_WC_WITH_VLAN is set. While that, this patch also fills the vlan_id field in the completion if present. linux commit 12f8fedef2ec94c783f929126b20440a01512c14 MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=330662
* Add support for explicit congestion notification, ECN, to mlx5ib(4).Hans Petter Selasky2018-03-083-0/+520
| | | | | | | | | | | | ECN configuration and statistics is available through a set of sysctl(8) nodes under sys.class.infiniband.mlx5_X.cong . The ECN configuration nodes can also be used as loader tunables. MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=330648
* Use the autogenerated interface file for all commands in mlx5core.Hans Petter Selasky2018-03-084-97/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch accumulates the following Linux commits: - 90b3e38d048f09b22fb50bcd460cea65fd00b2d7 mlx5_core: Modify CQ moderation parameters - 09a7d9eca1a6cf5eb4f9abfdf8914db9dbd96f08 mlx5_core: QP/XRCD commands via mlx5 ifc - 1a412fb1caa2c1b77719ccb5ed8b0c3c2bc65da7 mlx5_core: Modify QP commands via mlx5 ifc - ec22eb53106be1472ba6573dc900943f52f8fd1e mlx5_core: MKey/PSV commands via mlx5 ifc - 73b626c182dff06867ceba996a819e8372c9b2ce mlx5_core: EQ commands via mlx5 ifc - 20ed51c643b6296789a48adc3bc2cc875a1612cf mlx5_core: Access register and MAD IFC commands via mlx5 ifc - a533ed5e179cd15512d40282617909d3482a771c mlx5_core: Pages management commands via mlx5 ifc - b8a4ddb2e8f44f872fb93bbda2d541b27079fd2b mlx5_core: Add MLX5_ARRAY_SET64 to fix BUILD_BUG_ON - af1ba291c5e498973cc325c501dd8da80b234571 mlx5_core: Refactor internal SRQ API - b06e7de8a9d8d1d540ec122bbdf2face2a211634 mlx5_core: Refactor device capability function - c4f287c4a6ac489c18afc4acc4353141a8c53070 mlx5_core: Unify and improve command interface Submitted by: Matthew Finlay <matt@mellanox.com> MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=330647
* Implement missing query for current port rate in mlx5ib(4).Hans Petter Selasky2018-03-071-4/+71
| | | | | | | | | | | | | - Factor out port speed definitions into new port.h header file, similarly as done in Linux upstream. - Correct two existing port speed definitions in mlx5en according to Linux upstream. MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=330606
* Disable unsupported disassociate ucontext functionality in mlx5ib(4).Hans Petter Selasky2018-03-071-58/+0
| | | | | | | | MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=330597
* Optimize ibcore RoCE address handle creation from user-space.Hans Petter Selasky2018-03-053-3/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Creating a UD address handle from user-space or from the kernel-space, when the link layer is ethernet, requires resolving the remote L3 address into a L2 address. Doing this from the kernel is easy because the required ARP(IPv4) and ND6(IPv6) address resolving APIs are readily available. In userspace such an interface does not exist and kernel help is required. It should be noted that in an IP-based GID environment, the GID itself does not contain all the information needed to resolve the destination IP address. For example information like VLAN ID and SCOPE ID, is not part of the GID and must be fetched from the GID attributes. Therefore a source GID should always be referred to as a GID index. Instead of going through various racy steps to obtain information about the GID attributes from user-space, this is now all done by the kernel. This patch optimises the L3 to L2 address resolving using the existing create address handle uverbs interface, retrieving back the L2 address as an additional user-space information structure. This commit combines the following Linux upstream commits: IB/core: Let create_ah return extended response to user IB/core: Change ib_resolve_eth_dmac to use it in create AH IB/mlx5: Make create/destroy_ah available to userspace IB/mlx5: Use kernel driver to help userspace create ah IB/mlx5: Report that device has udata response in create_ah MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=330508
* Compile fixes for 32-bit architectures.Hans Petter Selasky2017-11-241-6/+6
| | | | | | | Sponsored by: Mellanox Technologies Notes: svn path=/projects/bsd_rdma_4_9/; revision=326160
* Merge ^/head r325663 through r325841.Hans Petter Selasky2017-11-151-1/+1
|\ | | | | | | Notes: svn path=/projects/bsd_rdma_4_9/; revision=325842
| * Make sure the ib_wr_opcode enum is signed by adding a negative dummy element.Hans Petter Selasky2017-11-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | Different compilers may optimise the enum type in different ways. This ensures coherency when range checking the value of enums in ibcore. Sponsored by: Mellanox Technologies MFC after: 1 week Notes: svn path=/head/; revision=325807
* | Update mlx5ib(4) to match Linux 4.9 and the new ibcore APIs.Hans Petter Selasky2017-11-1014-3514/+7080
|/ | | | | | | Sponsored by: Mellanox Technologies Notes: svn path=/projects/bsd_rdma_4_9/; revision=325665
* Add more and update existing mlx5 core firmware structure definitions and bits.Hans Petter Selasky2017-11-101-7/+0
| | | | | | | | | | This change is part of coming ibcore and mlx5ib updates. Sponsored by: Mellanox Technologies MFC after: 1 week Notes: svn path=/head/; revision=325662
* The remote DMA TCP portspace selector, RDMA_PS_TCP, is used for bothHans Petter Selasky2017-10-202-1/+53
| | | | | | | | | | | | | | | | | iWarp and RoCE in ibcore. The selection of RDMA_PS_TCP can not be used to indicate iWarp protocol use. Backport the proper IB device capabilities from Linux upstream to distinguish between iWarp and RoCE. Only allocate the additional socket required for iWarp for RDMA IDs when at least one iWarp device present. This resolves interopability issues between iWarp and RoCE in ibcore Reviewed by: np @ Differential Revision: https://reviews.freebsd.org/D12563 Sponsored by: Mellanox Technologies MFC after: 3 days Notes: svn path=/head/; revision=324792
* Use common rdma_ip2gid() function instead of custom mlx5_ip2gid() one.Hans Petter Selasky2017-10-101-21/+1
| | | | | | | | Sponsored by: Mellanox Technologies MFC after: 1 week Notes: svn path=/head/; revision=324491
* Compile fixes for LINT on 32-bit platforms.Hans Petter Selasky2017-08-242-2/+4
| | | | | | | | MFC after: 2 weeks Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=322830
* Add new mlx5ib(4) driver to the kernel source tree which supportsHans Petter Selasky2017-08-2312-0/+10707
Remote DMA over Converged Ethernet, RoCE, for the ConnectX-4 series of PCI express network cards. There is currently no user-space support and this driver only supports kernel side non-routable RoCE V1. The krping kernel module can be used to test this driver. Full user-space support including RoCE V2 will be added as part of the ongoing upgrade to ibcore from Linux 4.9. Otherwise this driver is feature equivalent to mlx4ib(4). The mlx5ib(4) kernel module will only be built when WITH_OFED=YES is specified. MFC after: 2 weeks Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=322810