aboutsummaryrefslogtreecommitdiff
path: root/sys/ofed
Commit message (Collapse)AuthorAgeFilesLines
* LinuxKPI: Remove owner argument from class_create function on KBI layerVladimir Kondratyev2024-07-211-1/+0
| | | | | | | To chase Linux 6.4 Sponsored by: Serenity Cyber Security, LLC Differential Revision: https://reviews.freebsd.org/D45849
* net: Remove unneeded NULL check for the allocated ifnetZhenlei Huang2024-06-281-4/+0
| | | | | | | | | | | Change 4787572d0580 made if_alloc_domain() never fail, then also do the wrappers if_alloc(), if_alloc_dev(), and if_gethandle(). No functional change intended. Reviewed by: kp, imp, glebius, stevek MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D45740
* ibcore: Mark write-only variablesAndrew Turner2024-06-122-10/+10
| | | | | | | | | | | | Some LinuxKPI lock macros pass need a flags field passed in. This is written to but never read from so gcc complains. Fix this by marking the flags variables as unused to quieten the compiler. Reviewed by: brooks (earlier version), kib Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D45303
* ibcore: Remove the use of NULL_IB_OBJECTKa Ho Ng2024-04-121-5/+3
| | | | | | | | | | | LinuxKPI's XArray implementation accepts NULL as an input as of the following commit: - linuxkpi: Accept NULL as a value in linux_xarray (3102ea3b15b6) Sponsored by: Juniper Networks, Inc. MFC after: 1 week Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D44533
* sockets: provide correct pr_shutdown for keysock and SDPGleb Smirnoff2024-01-161-13/+39
| | | | | | | My failure to run all kinds of kernel builds lead to missing the keysock and incorrectly assuming SDP as not having a shutdown method. Fixes: 5bba2728079ed4da33f727dbc2b6ae1de02ba897
* ofed: garbage collect now unused sdp_sockaddr()Gleb Smirnoff2023-12-011-18/+0
| | | | Submitted by: zlei
* sockets: don't malloc/free sockaddr memory on getpeername/getsocknameGleb Smirnoff2023-11-301-18/+18
| | | | | | | | | | | | | Just like it was done for accept(2) in cfb1e92912b4, use same approach for two simplier syscalls that return socket addresses. Although, these two syscalls aren't performance critical, this change generalizes some code between 3 syscalls trimming code size. Following example of accept(2), provide VNET-aware and INVARIANT-checking wrappers sopeeraddr() and sosockaddr() around protosw methods. Reviewed by: tuexen Differential Revision: https://reviews.freebsd.org/D42694
* sockets: don't malloc/free sockaddr memory on accept(2)Gleb Smirnoff2023-11-301-14/+11
| | | | | | | | | | | | | | Let the accept functions provide stack memory for protocols to fill it in. Generic code should provide sockaddr_storage, specialized code may provide smaller structure. While rewriting accept(2) make 'addrlen' a true in/out parameter, reporting required length in case if provided length was insufficient. Our manual page accept(2) and POSIX don't explicitly require that, but one can read the text as they do. Linux also does that. Update tests accordingly. Reviewed by: rscheff, tuexen, zlei, dchagin Differential Revision: https://reviews.freebsd.org/D42635
* sys: Automated cleanup of cdefs and other formattingWarner Losh2023-11-271-1/+1
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* ibcore: Introduce enum ib_raw_packet_caps from Linux 4.11Ka Ho Ng2023-10-281-0/+14
| | | | | | | | | | | | This enum also exists as enum ibv_raw_packet_caps in libibverbs/verbs.h. [khng: cherry-picked from Linux ebaaee253ad3a3c573ab7d3d77e849056bdfa9ea] Sponsored by: Juniper Networks, Inc. MFC after: 7 days Reviewed by: kib, zlei Differential Revision: https://reviews.freebsd.org/D42177
* ofed: mask seq_num identifier to occupy only 3 bytesBartosz Sobczak2023-08-221-0/+1
| | | | | | | | | | | | | | | | | | The seq_num among other things is used to assign rq_psn value, which is a 24-bit identifier. When the seq_num is full 4-byte value, we are usually receiving: '_ib_modify_qp rq_psn overflow, masking to 24 bits' warning. This is burdensome for running rdma traffic with large number of connections, because the number of logs is growing fast. Signed-off-by: Bartosz Sobczak <bartosz.sobczak@intel.com> Signed-off-by: Eric Joyner <erj@FreeBSD.org> Reviewed by: kib@, erj@ MFC after: 3 days Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D41531
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-1640-80/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-1647-94/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* ofed: fix roce gid insertion for vlan interfacesBartosz Sobczak2023-08-141-1/+1
| | | | | | | | | | | | | | | | | When attempting to use vlan interface the correct GID wasn't created due to incorrect ifp validation. The problem was introduced in 3e142e07675b ('ofed: Mechanically convert to IfAPI) Signed-off-by: Bartosz Sobczak bartosz.sobczak@intel.com Signed-off-by: Eric Joyner <erj@FreeBSD.org> PR: 273043 Sponsored by: Intel Corporation Reviewed by: jhibbits@, erj@ MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D41426
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-121-1/+1
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* ofed: Fix a logic inversion from IfAPI conversionJustin Hibbits2023-04-191-1/+1
| | | | | | Reported by: bartosz.sobczak_intel.com Fixes: 3e142e07675b ("ofed: Mechanically convert to IfAPI") Sponsored by: Juniper Networks, Inc.
* net: replace IFF_KNOWSEPOCH with IFF_NEEDSEPOCHGleb Smirnoff2023-04-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Expect that drivers call into the network stack with the net epoch entered. This has already been the fact since early 2020. The net interrupts, that are marked with INTR_TYPE_NET, were entering epoch since 511d1afb6bf. For the taskqueues there is NET_TASK_INIT() and all drivers that were known back in 2020 we marked with it in 6c3e93cb5a4. However in e87c4940156 we took conservative approach and preferred to opt-in rather than opt-out for the epoch. This change not only reverts e87c4940156 but adds a safety belt to avoid panicing with INVARIANTS if there is a missed driver. With INVARIANTS we will run in_epoch() check, print a warning and enter the net epoch. A driver that prints can be quickly fixed with the IFF_NEEDSEPOCH flag, but better be augmented to properly enter the epoch itself. Note on TCP LRO: it is a backdoor to enter the TCP stack bypassing some layers of net stack, ignoring either old IFF_KNOWSEPOCH or the new IFF_NEEDSEPOCH. But the tcp_lro_flush_all() asserts the presence of network epoch. Indeed, all NIC drivers that support LRO already provide the epoch, either with help of INTR_TYPE_NET or just running NET_EPOCH_ENTER() in their code. Reviewed by: zlei, gallatin, erj Differential Revision: https://reviews.freebsd.org/D39510
* infiniband: Opt-in for net epochZhenlei Huang2023-04-054-4/+7
| | | | | | | | | This is counterpart to e87c4940156c, which did the same for ethernet. Suggested by: hselasky Reviewed by: hselasky, kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D39405
* ofed: Mechanically convert to IfAPIJustin Hibbits2023-03-2423-379/+401
| | | | | | | | | | Summary: Because of the intricacies of this code it wasn't purely scripted, but instead hand-mechanical. Reviewed by: hselasky Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D38560
* infiniband: Convert BPF handling for IfAPIJustin Hibbits2023-03-141-1/+1
| | | | | | | | | | | | Summary: All callers of infiniband_bpf_mtap() call it through the wrapper macro, which checks the if_bpf member explicitly. Since this is getting hidden, move this check into the internal function and remove the wrapper macro. Reviewed by: hselasky Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D39024
* ibcore: The use of IN_LOOPBACK() now requires a valid VNET context.Hans Petter Selasky2022-09-231-27/+54
| | | | | | | | | Make sure the VNET is set before using this macro. Fixes: efe58855f3ea2cfc24cb705aabce3bc0fe1fb6d5 PR: 266054 MFC after: 1 week Sponsored by: NVIDIA Networking
* ibcore: Add support for RDMA/RoCE using VLAN(4) devices.Hans Petter Selasky2022-08-221-1/+1
| | | | | | | | | | | | Classify VLAN devices as ethernet in rdma_copy_addr(). This fixes the following error message: rdma_bind_addr: No such file or directory Submitted by: bartosz.sobczak@intel.com (Bartosz Sobczak) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D36120 Sponsored by: NVIDIA Networking
* protosw: refactor protosw and domain static declaration and loadGleb Smirnoff2022-08-171-40/+34
| | | | | | | | | | | | | | | | | | | o Assert that every protosw has pr_attach. Now this structure is only for socket protocols declarations and nothing else. o Merge struct pr_usrreqs into struct protosw. This was suggested in 1996 by wollman@ (see 7b187005d18ef), and later reiterated in 2006 by rwatson@ (see 6fbb9cf860dcd). o Make struct domain hold a variable sized array of protosw pointers. For most protocols these pointers are initialized statically. Those domains that may have loadable protocols have spacers. IPv4 and IPv6 have 8 spacers each (andre@ dff3237ee54ea). o For inetsw and inet6sw leave a comment noting that many protosw entries very likely are dead code. o Refactor pf_proto_[un]register() into protosw_[un]register(). o Isolate pr_*_notsupp() methods into uipc_domain.c Reviewed by: melifaro Differential revision: https://reviews.freebsd.org/D36232
* sdp: garbage collect sdp_ctlinputGleb Smirnoff2022-08-161-34/+0
| | | | | | | | | | | | | | | The pr_ctlinput method was a feature of IPv4/IPv6 with exception of pfctlinput(), which broadcasted a call to pr_ctlinput on all protocols ever registered statically or with pf_proto_register(). Now that this broadcast call is gone, the only protocols that get their pr_ctlinput ever called are those that have registered itselves with ipproto_register() or ip6proto_register(). It is entirely possible that code deleted now was dead code from very beginning. Just a copy-paste from TCP. Reviewed by: rstone Differential revision: https://reviews.freebsd.org/D36208
* protosw: change prototype for pr_controlGleb Smirnoff2022-08-121-8/+0
| | | | | | | | For some reason protosw.h is used during world complation and userland is not aware of caddr_t, a relic from the first version of C. Broken buildworld is good reason to get rid of yet another caddr_t in kernel. Fixes: 886fc1e80490fb03e72e306774766cbb2c733ac6
* ofed/infiniband: fix ifdefs for new INET changes, fixing LINT-NOIPMike Karels2022-07-181-0/+11
| | | | | | | | | | | | | | Some of the ofed/infiniband code has INET and INET6 address handling code without using ifdefs. This failed with a recent change to INET, in which IN_LOOPBACK() started using a VNET variable, and which is not present if INET is not configured. Add #ifdef INET, and INET6 for good measure, in cma_loopback_addr(), along with inclusion of the options headers in ib_cma.c. Reviewed by: hselasky rgrimes bz Differential Revision: https://reviews.freebsd.org/D35835 (cherry picked from commit 752b7632776237f9c071783acdd1136ebf5f287d)
* sockets: use only soref()/sorele() as socket reference countGleb Smirnoff2022-07-041-8/+2
| | | | | | | | | | | | | | | | | | | o Retire SS_FDREF as it is basically a debug flag on top of already existing soref()/sorele(). o Convert SS_PROTOREF into soref()/sorele(). o Change reference model for the listen queues, see below. o Make sofree() private. The correct KPI to use is only sorele(). o Make soabort() respect the model and sorele() instead of sofree(). Note on listening queues. Until now the sockets on a queue had zero reference count. And the reference were given only upon accept(2). The assumption was that there is no way to see the queued socket from anywhere except its head. This is not true, since queued sockets already have pcbs, which are linked at least into the global pcb lists. With this change we put the reference right in the sonewconn() and on accept(2) path we just hand the existing reference to the file descriptor. Differential revision: https://reviews.freebsd.org/D35679
* ibcore: Fix a race with disassociate and exit_mmap()Hans Petter Selasky2022-06-211-0/+4
| | | | | | | | | | | | | | | | | | | | If uverbs_user_mmap_disassociate() is called while the mmap is concurrently doing exit_mmap then the ordering of the rdma_user_mmap_entry_put() is not reliable. The put must be done before uvers_user_mmap_disassociate() returns, otherwise there can be a use after free on the ucontext, and a left over entry in the xarray. If the put is not done here then it is done during rdma_umap_close() later. Add the missing put to the error exit path. Linux commit: 39c011a538272589b9eb02ff1228af528522a22c PR: 264473 MFC after: 3 days Sponsored by: NVIDIA Networking
* ibcore: Fix sysfs registration error flowHans Petter Selasky2022-06-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The kernel commit cited below restructured ib device management so that the device kobject is initialized in ib_alloc_device. As part of the restructuring, the kobject is now initialized in procedure ib_alloc_device, and is later added to the device hierarchy in the ib_register_device call stack, in procedure ib_device_register_sysfs (which calls device_add). However, in the ib_device_register_sysfs error flow, if an error occurs following the call to device_add, the cleanup procedure device_unregister is called. This call results in the device object being deleted -- which results in various use-after-free crashes. The correct cleanup call is device_del -- which undoes device_add without deleting the device object. The device object will then (correctly) be deleted in the ib_register_device caller's error cleanup flow, when the caller invokes ib_dealloc_device. Linux commit: b312be3d87e4c80872cbea869e569175c5eb0f9a PR: 264472 MFC after: 3 days Sponsored by: NVIDIA Networking
* ibcore: Fix use-after-free access in ucma_close()Hans Petter Selasky2022-06-131-0/+3
| | | | | | | | | | | | | The error in ucma_create_id() left ctx in the list of contexts belong to ucma file descriptor. The attempt to close this file descriptor causes to use-after-free accesses while iterating over such list. Linux commit: ed65a4dc22083e73bac599ded6a262318cad7baf PR: 264650 MFC after: 1 week Sponsored by: NVIDIA Networking
* ibcore: Fix missing ib_cm_destroy_id() in ib_cm_insert_listen()Hans Petter Selasky2022-05-301-0/+1
| | | | | | | | | | | | | The algorithm pre-allocates a cm_id since allocation cannot be done while holding the cm.lock spinlock, however it doesn't free it on one error path, leading to a memory leak. Linux commit: c14dfddbd869bf0c2bafb7ef260c41d9cebbcfec PR: 264248 MFC after: 1 week Sponsored by: NVIDIA Networking
* ibcore: Fix possible memory leak in ib_mad_post_receive_mads()Hans Petter Selasky2022-05-191-0/+1
| | | | | | | | | | | | | | If ib_dma_mapping_error() returns non-zero value, ib_mad_post_receive_mads() will jump out of loops and return -ENOMEM without freeing mad_priv. Fix this memory-leak problem by freeing mad_priv in this case. Linux commit: a17f4bed811c60712d8131883cdba11a105d0161 PR: 264057 MFC after: 1 week Sponsored by: NVIDIA Networking
* sockets: use socket buffer mutexes in struct socket directlyGleb Smirnoff2022-05-121-2/+2
| | | | | | | | | | | | | | | | | | Since c67f3b8b78e the sockbuf mutexes belong to the containing socket, and socket buffers just point to it. In 74a68313b50 macros that access this mutex directly were added. Go over the core socket code and eliminate code that reaches the mutex by dereferencing the sockbuf compatibility pointer. This change requires a KPI change, as some functions were given the sockbuf pointer only without any hint if it is a receive or send buffer. This change doesn't cover the whole kernel, many protocols still use compatibility pointers internally. However, it allows operation of a protocol that doesn't use them. Reviewed by: markj Differential revision: https://reviews.freebsd.org/D35152
* ibcore: Remove set, but not used variable.Hans Petter Selasky2022-05-051-3/+0
| | | | | MFC after: 1 week Sponsored by: NVIDIA Networking
* ibcore: Allow passing NULL-pointers to ib_umem_release()Hans Petter Selasky2022-05-021-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | FreeBSD commit b633e08c705fe43180567eae26923d6f6f98c8d9 removed the NULL-checks from the mlx4ib-driver. This fixes the following NULL-pointer panic when unloading mlx4ib: ib_umem_release() mlx4_ib_destroy_qp() ib_destroy_qp_user() ipoib_transport_dev_cleanup() ipoib_dev_cleanup() ipoib_remove_one() ib_unregister_client() ipoib_cleanup_module() linker_file_sysuninit() linker_file_unload() kern_kldunload() amd64_syscall() Linux commit: 836a0fbb3e76f704ad65ddfb57f00725245e509b MFC after: 1 week Submitted by: dandan@lysator.liu.se Sponsored by: Lysator ACS Sponsored by: NVIDIA Networking
* ofed: Fix a typo in a source code commentGordon Bergling2022-04-091-1/+1
| | | | | | - s/it it/it to/ MFC after: 3 days
* ofed: Remove a double word in a source code commentGordon Bergling2022-04-091-1/+1
| | | | | | - s/for for/for/ MFC after: 3 days
* ofed: Remove a double word in a source code commentGordon Bergling2022-04-091-1/+1
| | | | | | - s/is is/is/ MFC after: 3 days
* ibcore: Fix multiple includes of same header file.Hans Petter Selasky2022-03-031-1/+0
| | | | | MFC after: 1 week Sponsored by: NVIDIA Networking
* ibcore: Add support for NDR link speed.Hans Petter Selasky2022-02-212-1/+6
| | | | | | | | | | Add new IBTA speed NDR, supporting signaling rate of 100Gb. Linux commit: c7adf7717301558e8852949d8e3dc3748d1a4a97 MFC after: 1 week Sponsored by: NVIDIA Networking
* mlx5ib: Add support for parsing udata in mlx5_ib_create_flow().Hans Petter Selasky2022-02-101-0/+22
| | | | | | | | | Backport from Linux 5.17 (drivers/infiniband/hw/mlx5/fs.c) This fixes creating flow rules from user-space after the kernel space update based on Linux 5.7-rc1 . Sponsored by: NVIDIA Networking
* domains: init with standard SYSINIT(9) or VNET_SYSINIT()Gleb Smirnoff2022-01-031-2/+2
| | | | | | | There left only three modules that used dom_init(). And netipsec was the last one to use dom_destroy(). Differential revision: https://reviews.freebsd.org/D33540
* sys/ofed: Use C99 fixed-width integer types.John Baldwin2021-12-281-2/+2
| | | | | | | No functional change. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D33639
* socket: De-duplicate SBLOCKWAIT() definitionsMark Johnston2021-09-141-2/+0
| | | | | MFC after: 1 week Sponsored by: The FreeBSD Foundation
* socket: Rename sb(un)lock() and interlock with listen(2)Mark Johnston2021-09-071-6/+5
| | | | | | | | | | | | | | | | | | | | | | In preparation for moving sockbuf locks into the containing socket, provide alternative macros for the sockbuf I/O locks: SOCK_IO_SEND_(UN)LOCK() and SOCK_IO_RECV_(UN)LOCK(). These operate on a socket rather than a socket buffer. Note that these locks are used only to prevent concurrent readers and writters from interleaving I/O. When locking for I/O, return an error if the socket is a listening socket. Currently the check is racy since the sockbuf sx locks are destroyed during the transition to a listening socket, but that will no longer be true after some follow-up changes. Modify a few places to check for errors from sblock()/SOCK_IO_(SEND|RECV)_LOCK() where they were not before. In particular, add checks to sendfile() and sorflush(). Reviewed by: tuexen, gallatin MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31657
* routing: Allow using IPv6 next-hops for IPv4 routes (RFC 5549).Zhenlei Huang2021-08-221-3/+11
| | | | | | | | | | | | | | | | | | | | | | | Implement kernel support for RFC 5549/8950. * Relax control plane restrictions and allow specifying IPv6 gateways for IPv4 routes. This behavior is controlled by the net.route.rib_route_ipv6_nexthop sysctl (on by default). * Always pass final destination in ro->ro_dst in ip_forward(). * Use ro->ro_dst to exract packet family inside if_output() routines. Consistently use RO_GET_FAMILY() macro to handle ro=NULL case. * Pass extracted family to nd6_resolve() to get the LLE with proper encap. It leverages recent lltable changes committed in c541bd368f86. Presence of the functionality can be checked using ipv4_rfc5549_support feature(3). Example usage: route add -net 192.0.0.0/24 -inet6 fe80::5054:ff:fe14:e319%vtnet0 Differential Revision: https://reviews.freebsd.org/D30398 MFC after: 2 weeks
* lltable: Add support for "child" LLEs holding encap for IPv4oIPv6 entries.Alexander V. Chernikov2021-08-211-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we use pre-calculated headers inside LLE entries as prepend data for `if_output` functions. Using these headers allows saving some CPU cycles/memory accesses on the fast path. However, this approach makes adding L2 header for IPv4 traffic with IPv6 nexthops more complex, as it is not possible to store multiple pre-calculated headers inside lle. Additionally, the solution space is limited by the fact that PCB caching saves LLEs in addition to the nexthop. Thus, add support for creating special "child" LLEs for the purpose of holding custom family encaps and store mbufs pending resolution. To simplify handling of those LLEs, store them in a linked-list inside a "parent" (e.g. normal) LLE. Such LLEs are not visible when iterating LLE table. Their lifecycle is bound to the "parent" LLE - it is not possible to delete "child" when parent is alive. Furthermore, "child" LLEs are static (RTF_STATIC), avoding complex state machine used by the standard LLEs. nd6_lookup() and nd6_resolve() now accepts an additional argument, family, allowing to return such child LLEs. This change uses `LLE_SF()` macro which packs family and flags in a single int field. This is done to simplify merging back to stable/. Once this code lands, most of the cases will be converted to use a dedicated `family` parameter. Differential Revision: https://reviews.freebsd.org/D31379 MFC after: 2 weeks
* ibcore: Kernel space update based on Linux 5.7-rc1.Hans Petter Selasky2021-07-2842-3512/+11520
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Overview: This is the first stage of a RDMA stack upgrade introducing kernel changes only based on Linux 5.7-rc1. This patch is based on about four main areas of work: - Update of the IB uobjects system: - The memory holding so-called AH, CQ, PD, SRQ and UCONTEXT objects is now managed by ibcore. This also require some changes in the kernel verbs API. The updated verbs changes are typically about initialize and deinitialize objects, and remove allocation and free of memory. - Update of the uverbs IOCTL framework: - The parsing and handling of user-space commands has been completely refactored to integrate with the updated IB uobjects system. - Various changes and updates to the generic uverbs interfaces in device drivers including the new uAPI surface. - The mlx5_ib_devx.c in mlx5ib and related mlx5 core changes. Dependencies: - The mlx4ib driver code has been updated with the minimum changes needed. - The mlx5ib driver code has been updated with the minimum changes needed including DV support. Compatibility: - All user-space facing APIs are backwards compatible after this change. - All kernel-space facing RDMA APIs are backwards compatible after this change, with exception of ib_create_ah() and ib_destroy_ah() which takes a new flag. - The "ib_device_ops" structure exist, but only contains the driver ID and some structure sizes. Differences from Linux: - Infiniband drivers must use the INIT_IB_DEVICE_OPS() macro to set the sizes needed for allocating various IB objects, when adding IB device instances. Security: - PRIV_NET_RAW is needed to use raw ethernet transmit features. - PRIV_DRIVER is needed to use other privileged operations. Based on upstream Linux, Torvalds (5.7-rc1): 8632e9b5645bbc2331d21d892b0d6961c1a08429 MFC after: 1 week Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D31149 Sponsored by: NVIDIA Networking
* Fix LINT kernel build issues after c3987b8ea793c11f61fecb14ef93195a23e3522c .Hans Petter Selasky2021-07-123-7/+8
| | | | | | | | Fixes the IPOIB_CM and SDP kernel options. Reported by: lwhsu @ MFC after: 1 week Sponsored by: NVIDIA Networking
* ipoib: Fix for accessing uninitialized pointers and freed memory during ↵Hans Petter Selasky2021-07-121-7/+27
| | | | | | | | | | | | | | attach and detach. Call infiniband_ifdetach() early to stop ifioctl(9) calls from user-space during device removal. Also make sure that ifioctl(9) calls are blocked from executing until the device is fully initialized. Ideally we would delay the infiniband_ifattach() call, but because part of the initialization is to update the link level address, that is not possible without more significant changes. MFC after: 1 week Reviewed by: kib Sponsored by: Mellanox Technologies // NVIDIA Networking