aboutsummaryrefslogtreecommitdiff
path: root/sys/ofed
Commit message (Collapse)AuthorAgeFilesLines
* Remove unsafe access to the LinuxKPI file structure from ibcore.Hans Petter Selasky2017-09-094-9/+0
| | | | | | | | | | selwakeup() is now done by the wake_up() family of functions. MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=323350
* Fix indentation.Mark Johnston2017-09-071-3/+3
| | | | | | | | MFC after: 1 week Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=323280
* Change reject message type when destroying cm_id in ibore.Hans Petter Selasky2017-08-031-1/+1
| | | | | | | | | | | | | | This patch fixes an interopability issue between FreeBSD and non-FreeBSD systems when the connection establishment is aborted. Refer to the initial commit in Linux, drivers/infiniband/core/cm.c, for a more detailed description. Obtained from: Linux MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=321986
* Ticks are 32-bit in FreeBSD.Hans Petter Selasky2017-08-031-2/+2
| | | | | | | | MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=321985
* Avoid including list.h in LinuxKPI headers.Mark Johnston2017-06-184-0/+4
| | | | | | | | | | | | | list.h includes a number of FreeBSD headers as a workaround for the LIST_HEAD name collision. To reduce pollution, avoid including list.h in commonly used headers when it is not explicitly needed. Reviewed by: hselasky MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D11249 Notes: svn path=/head/; revision=320072
* Fix indentation.Mark Johnston2017-06-141-19/+19
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=319952
* Listening sockets improvements.Gleb Smirnoff2017-06-082-55/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Separate fields of struct socket that belong to listening from fields that belong to normal dataflow, and unionize them. This shrinks the structure a bit. - Take out selinfo's from the socket buffers into the socket. The first reason is to support braindamaged scenario when a socket is added to kevent(2) and then listen(2) is cast on it. The second reason is that there is future plan to make socket buffers pluggable, so that for a dataflow socket a socket buffer can be changed, and in this case we also want to keep same selinfos through the lifetime of a socket. - Remove struct struct so_accf. Since now listening stuff no longer affects struct socket size, just move its fields into listening part of the union. - Provide sol_upcall field and enforce that so_upcall_set() may be called only on a dataflow socket, which has buffers, and for listening sockets provide solisten_upcall_set(). o Remove ACCEPT_LOCK() global. - Add a mutex to socket, to be used instead of socket buffer lock to lock fields of struct socket that don't belong to a socket buffer. - Allow to acquire two socket locks, but the first one must belong to a listening socket. - Make soref()/sorele() to use atomic(9). This allows in some situations to do soref() without owning socket lock. There is place for improvement here, it is possible to make sorele() also to lock optionally. - Most protocols aren't touched by this change, except UNIX local sockets. See below for more information. o Reduce copy-and-paste in kernel modules that accept connections from listening sockets: provide function solisten_dequeue(), and use it in the following modules: ctl(4), iscsi(4), ng_btsocket(4), ng_ksocket(4), infiniband, rpc. o UNIX local sockets. - Removal of ACCEPT_LOCK() global uncovered several races in the UNIX local sockets. Most races exist around spawning a new socket, when we are connecting to a local listening socket. To cover them, we need to hold locks on both PCBs when spawning a third one. This means holding them across sonewconn(). This creates a LOR between pcb locks and unp_list_lock. - To fix the new LOR, abandon the global unp_list_lock in favor of global unp_link_lock. Indeed, separating these two locks didn't provide us any extra parralelism in the UNIX sockets. - Now call into uipc_attach() may happen with unp_link_lock hold if, we are accepting, or without unp_link_lock in case if we are just creating a socket. - Another problem in UNIX sockets is that uipc_close() basicly did nothing for a listening socket. The vnode remained opened for connections. This is fixed by removing vnode in uipc_close(). Maybe the right way would be to do it for all sockets (not only listening), simply move the vnode teardown from uipc_detach() to uipc_close()? Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D9770 Notes: svn path=/head/; revision=319722
* All these files need sys/vmmeter.h, but now they got it implicitlyGleb Smirnoff2017-04-171-0/+1
| | | | | | | included via sys/pcpu.h. Notes: svn path=/head/; revision=317055
* Add full VNET support to the inet_get_local_port_range() function inHans Petter Selasky2017-03-221-1/+1
| | | | | | | | | | the LinuxKPI. MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=315714
* Make sdp compilable after r315662.Gleb Smirnoff2017-03-211-5/+3
| | | | Notes: svn path=/head/; revision=315672
* Add basic support for VIMAGE to the LinuxKPI and ibcore.Hans Petter Selasky2017-03-161-0/+11
| | | | | | | | | | | Support is implemented by mapping Linux's "struct net" into FreeBSD's "struct vnet". Currently only vnet0 is supported by ibcore. MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=315404
* Renumber copyright clause 4Warner Losh2017-02-281-1/+1
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* cxgbe/iw_cxgbe: fix various double-close panics with iWARP sockets.Navdeep Parhar2017-02-282-19/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | Sockets representing the TCP endpoints for iWARP connections are allocated by the ibcore module. Before this revision they were closed either by the ibcore module or the iw_cxgbe hardware driver depending on the state transitions during connection teardown. This is error prone and there were cases where both iw_cxgbe and ibcore closed the socket leading to double-free panics. The fix is to let ibcore close the sockets it creates and never do it in the driver. - Use sodisconnect instead of soclose (preceded by solinger = 0) in the driver to tear down an RDMA connection abruptly. This does what's intended without releasing the socket's fd reference. - Close the socket in ibcore when the iWARP iw_cm_id is destroyed. This works for all kinds of sockets: clients that initiate connections, listeners, and sockets accepted off of listeners. Reviewed by: Steve Wise @ Open Grid Computing, hselasky@ MFC after: 3 days Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D9796 Notes: svn path=/head/; revision=314400
* Avoid NULL dereference in a couple of sysctl handlers in ibcore.Navdeep Parhar2017-02-231-2/+2
| | | | | | | | | | iw_cxgbe sets ib_device->dma_device to NULL (since r311880). Reviewed by: hselasky@ Sponsored by: Chelsio Communications Notes: svn path=/head/; revision=314131
* Move the ConnectX-3 and ConnectX-2 driver from sys/ofed into sys/dev/mlx4Hans Petter Selasky2016-09-3060-50118/+0
| | | | | | | | | | | | | | | | | | | | | | | | | like other PCI network drivers. The sys/ofed directory is now mainly reserved for generic infiniband code, with exception of the mthca driver. - Add new manual page, mlx4en(4), describing how to configure and load mlx4en. - All relevant driver C-files are now prefixed mlx4, mlx4_en and mlx4_ib respectivly to avoid object filename collisions when compiling the kernel. This also fixes an issue with proper dependency file generation for the C-files in question. - Device mlxen is now device mlx4en and depends on device mlx4, see mlx4en(4). Only the network device name remains unchanged. - The mlx4 and mlx4en modules are now built by default on i386 and amd64 targets. Only building the mlx4ib module depends on WITH_OFED=YES . Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=306486
* Set hardware stats flag to avoid double counting the number of incoming bytes.Hans Petter Selasky2016-09-291-0/+1
| | | | | | | | | Found by: Ben RUBSON <ben.rubson@gmail.com> Sponsored by: Mellanox Technologies MFC after: 1 week Notes: svn path=/head/; revision=306454
* Do not free an uninitialized pointer on soaccept failure in the iWARPNavdeep Parhar2016-08-261-0/+1
| | | | | | | | | connection manager. Sponsored by: Chelsio Communications Notes: svn path=/head/; revision=304838
* Add support for setting blocking and non-blocking mode on /dev/rdma_cmHans Petter Selasky2016-08-181-0/+16
| | | | | | | | | | | | by returning success on FIONBIO and FIOASYNC IOCTLs. The actual flags handling is done by the kern_ioctl() function. Reported by: Alex Bowden <alex.bowden@outlook.com> Sponsored by: Mellanox Technologies MFC after: 1 week Notes: svn path=/head/; revision=304342
* mthca: Add a wrapper for the firmware's DIAG_RPRT command.Mark Johnston2016-08-052-0/+18
| | | | | | | | MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=303786
* ipoib: Bound the number of egress mbufs buffered during pathrec lookups.Mark Johnston2016-08-011-1/+7
| | | | | | | | | | | | | | | In pathological situations where the master subnet manager becomes unresponsive for an extended period, we may otherwise end up queuing all of the system's mbufs while waiting for a response to a path record lookup. This addresses the same issue as commit 1e85b806f9 in Linux. Reviewed by: cem, ngie MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=303646
* MFV be9130cc9: "IB/cma: Check for GID on listening devices first"Mark Johnston2016-08-011-6/+30
| | | | | | | | | | | | This is an optimization that improves IB connection setup times. Discussed with: hselasky Obtained from: Linux MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=303636
* MFV 29f27e847: "IB/cma: Use cached gids"Mark Johnston2016-08-011-8/+7
| | | | | | | | | | | | | | | This addresses a regression from an earlier upstream change which caused cma_acquire_dev() to bypass the port GID cache and instead query the HCA for each entry in its GID table. These queries can become extremely slow on multiport devices, which has a negative impact on connection setup times. Discussed with: hselasky Obtained from: Linux MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=303635
* sdp: Destroy the RDMA ID after destroying the connection's queue pair.Mark Johnston2016-07-291-1/+4
| | | | | | | | | | This is the ordering documented by rdma_destroy_qp(). Also add a useful KASSERT to sdp_pcbfree(). Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=303513
* sdp: Use malloc(9) instead of the Linux compat layer.Mark Johnston2016-07-294-29/+15
| | | | | | | | | | SDP transmit and receive rings are always created in a sleepable context, so we can use M_WAITOK and remove error checks. Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=303512
* sdp: Use the correct socket buffer in sdp_post_recvs_needed().Mark Johnston2016-07-291-1/+1
| | | | | | | Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=303511
* sdp: Always free received control packets after they're handled.Mark Johnston2016-07-291-12/+4
| | | | | | | Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=303509
* Fix the KASSERT format string arguments after r303507.Mark Johnston2016-07-291-1/+2
| | | | Notes: svn path=/head/; revision=303508
* sdp: Use the PCB as the rx completion handler argument.Mark Johnston2016-07-291-7/+4
| | | | | | | | | | | The generic socket may be detached from the PCB before the completion queue is drained and destroyed, so this change closes a race condition in connection teardown. Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=303507
* sdp: Destroy the PCB lock before freeing to the zone.Mark Johnston2016-07-291-1/+1
| | | | | | | Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=303506
* sdp: Use an mbufq for received control packets.Mark Johnston2016-07-293-14/+6
| | | | | | | | | This is simpler than the hand-rolled queue, and fixes a use-after-free. Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=303505
* sdp: Remove Linux build files.Mark Johnston2016-07-292-34/+0
| | | | | | | | | | They aren't useful here, and Linux seems to have largely abandoned SDP anyway. Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=303504
* Fix bug in iwcm that caused a panic in iw_cm_wq when krping is runNavdeep Parhar2016-06-141-2/+11
| | | | | | | | | | repeatedly in a tight loop. Approved by: re (gjb@) Obtained from: hselasky@ (part of larger changes in D5791) Notes: svn path=/head/; revision=301896
* net: Use M_HASHTYPE_OPAQUE_HASH if the mbuf flowid has hash propertiesSepherosa Ziehau2016-06-071-1/+1
| | | | | | | | | Reviewed by: hps, erj, tuexen Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6688 Notes: svn path=/head/; revision=301538
* Fix up the Infiniband code to handle the new arpresolve.George V. Neville-Neil2016-06-022-4/+4
| | | | Notes: svn path=/head/; revision=301229
* Prepare for activation of LinuxKPI module parameters as read-onlyHans Petter Selasky2016-05-2519-2/+42
| | | | | | | | | | | | | | | | tunable SYSCTL's. Linux module parameters are associated with the module they belong to. FreeBSD does not share this concept of a parent module. Instead add macros which define the prefix to use for the module parameters in the LinuxKPI consumers. While at it convert all "bool" LinuxKPI module parameters to "byte" type, because we don't have a "bool" type of SYSCTL in FreeBSD. Sponsored by: Mellanox Technologies MFC after: 1 week Notes: svn path=/head/; revision=300676
* Don't repeat the the word 'the'Eitan Adler2016-05-173-3/+3
| | | | | | | | | | (one manual change to fix grammar) Confirmed With: db Approved by: secteam (not really, but this is a comment typo fix) Notes: svn path=/head/; revision=300050
* sys/ofed: minor spelling fix.Pedro F. Giffuni2016-05-061-1/+1
| | | | | | | | | No functional change. Reviewed by: hselasky Notes: svn path=/head/; revision=299181
* ofed/drivers: minor spelling fixes.Pedro F. Giffuni2016-05-0610-14/+14
| | | | | | | | | No functional change. Reviewed by: hselasky Notes: svn path=/head/; revision=299179
* Fix NOIP kernels to compile.Bjoern A. Zeeb2016-04-241-0/+2
| | | | Notes: svn path=/head/; revision=298543
* More fixes for using IPv6 addresses with RDMA:Hans Petter Selasky2016-04-227-24/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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 Notes: svn path=/head/; revision=298486
* Add KASSERT() and set error code in dead code case to help static codeHans Petter Selasky2016-04-221-0/+2
| | | | | | | | | | | analysis tools. Suggested by: ngie@ Sponsored by: Mellanox Technologies MFC after: 1 week Notes: svn path=/head/; revision=298459
* Add missing set of the current VNET when inputting IP packets in IPoIB.Hans Petter Selasky2016-04-221-2/+7
| | | | | | | | | | | | This fixes a kernel panic when using IPoIB with VIMAGE and infiniband. PR: 208957 Sponsored by: Mellanox Technologies Tested by: Justin Clift <justin@postgresql.org> MFC after: 1 week Notes: svn path=/head/; revision=298458
* Fix for using IPv6 addresses with RDMA:Hans Petter Selasky2016-04-211-39/+108
| | | | | | | | | | | | | | | | | IPv6 addresses has a scope ID which sometimes is stored in the "sin6_scope_id" field of "struct sockaddr_in6" and sometimes as part of the IPv6 address itself depending on the context. If the scope ID is not in the expected location, the IPv6 address lookups in the so-called GID table will fail. Some code factoring has been made to achieve a clean exit of the "addr_resolve" function via a common "done" label. Sponsored by: Mellanox Technologies Submitted by: Shani Michaeli <shanim@mellanox.com> MFC after: 1 week Notes: svn path=/head/; revision=298419
* Fix for resolving mac address when the destination address is a gateway.Hans Petter Selasky2016-04-211-4/+5
| | | | | | | | | | Remove some dead code while at it. Sponsored by: Mellanox Technologies MFC after: 1 week Notes: svn path=/head/; revision=298412
* Properly setup arguments for if_resolvemulti() callback.Hans Petter Selasky2016-04-211-1/+7
| | | | | | | | Sponsored by: Mellanox Technologies MFC after: 1 week Notes: svn path=/head/; revision=298400
* Fix inverted priv check calls. Priv check returns zero on success andHans Petter Selasky2016-04-201-3/+3
| | | | | | | | | | an error code on failure. Refer to man 9 priv_check . Sponsored by: Mellanox Technologies MFC after: 1 week Notes: svn path=/head/; revision=298342
* ofed: for pointers replace 0 with NULL.Pedro F. Giffuni2016-04-152-2/+2
| | | | | | | | | | These are mostly cosmetical, no functional change. Found with devel/coccinelle. Reviewed by: hselasky Notes: svn path=/head/; revision=298046
* Remove some unused fields.Hans Petter Selasky2016-04-143-13/+0
| | | | | | | | Sponsored by: Mellanox Technologies MFC after: 1 week Notes: svn path=/head/; revision=297968
* Ensure the received IP header gets 32-bits aligned.Hans Petter Selasky2016-04-142-4/+12
| | | | | | | | | | | | The FreeBSD's TCP/IP stack assumes that the IP-header is 32-bits aligned when decoding it. Else unaligned 32-bit memory access can happen, which not all processor architectures support. Sponsored by: Mellanox Technologies MFC after: 1 week Notes: svn path=/head/; revision=297967
* Add missing port_up checks.Hans Petter Selasky2016-04-141-2/+17
| | | | | | | | | | | | When downing a mlxen network adapter we need to check the port_up variable to ensure we don't continue to transmit data or restart timers which can reside in freed memory. Sponsored by: Mellanox Technologies MFC after: 1 week Notes: svn path=/head/; revision=297966