aboutsummaryrefslogtreecommitdiff
path: root/sys/ofed
Commit message (Collapse)AuthorAgeFilesLines
* Add missing FreeBSD RCS keyword and SVN properties.Hans Petter Selasky2015-10-275-5/+10
| | | | | | | Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=290045
* Add support for binding IRQs to CPUs in the LinuxKPI. The new functionHans Petter Selasky2015-10-261-1/+18
| | | | | | | | | | added is for BSD only and does not exist in Linux. MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=290003
* Build fix for MIPS.Hans Petter Selasky2015-10-261-3/+6
| | | | | | | Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=289993
* Build fix for non-i386 and non-amd64 platforms.Hans Petter Selasky2015-10-231-0/+6
| | | | | | | Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=289830
* Rename linuxapi[.ko] into linuxkpi[.ko], to reflect that it is aHans Petter Selasky2015-10-227-8/+8
| | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=289749
* Remove all comments deriving from Linux.Hans Petter Selasky2015-10-211-48/+6
| | | | | | | | | | Minor rework of ilog2() function. Suggested by: emaste @ Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=289683
* Remove all comments deriving from Linux. Style file for FreeBSD.Hans Petter Selasky2015-10-211-146/+25
| | | | | | | | Suggested by: emaste @ Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=289682
* Reimplement header file, remove all comments deriving from Linux andHans Petter Selasky2015-10-211-73/+38
| | | | | | | | | | update copyright to 2-clause BSD. Suggested by: emaste @ Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=289680
* Move location of RCS keyword according to style.Hans Petter Selasky2015-10-2088-133/+180
| | | | | | | | Suggested by: jhb @ Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=289644
* Add missing FreeBSD RCS keyword and SVN properties.Hans Petter Selasky2015-10-207-0/+7
| | | | | | | Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=289633
* Add missing FreeBSD RCS keyword and SVN properties.Hans Petter Selasky2015-10-207-1/+8
| | | | | | | Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=289632
* Add missing dash to copyright clause.Hans Petter Selasky2015-10-201-1/+1
| | | | | | | Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=289625
* Add missing FreeBSD RCS keyword and SVN properties.Hans Petter Selasky2015-10-2070-0/+70
| | | | | | | Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=289624
* Merge LinuxKPI changes from DragonflyBSD:Hans Petter Selasky2015-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 Notes: svn path=/head/; revision=289621
* The returned value from vm_fault_disable_pagefaults() must be storedHans Petter Selasky2015-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 @ Notes: svn path=/head/; revision=289593
* Merge LinuxKPI changes from DragonflyBSD:Hans Petter Selasky2015-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 Notes: svn path=/head/; revision=289580
* Merge LinuxKPI changes from DragonflyBSD:Hans Petter Selasky2015-10-191-1/+23
| | | | | | | | | - Implement more Linux kernel functions. Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=289579
* Merge LinuxKPI changes from DragonflyBSD:Hans Petter Selasky2015-10-192-6/+30
| | | | | | | | | | | | - 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 Notes: svn path=/head/; revision=289578
* Merge LinuxKPI changes from DragonflyBSD:Hans Petter Selasky2015-10-192-3/+9
| | | | | | | | | - Map more Linux compiler related defines to FreeBSD ones. Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=289577
* Map two more Linux error return codes to FreeBSD ones.Hans Petter Selasky2015-10-191-0/+2
| | | | | | | Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=289576
* Implement IS_ERR_OR_NULL() function.Hans Petter Selasky2015-10-191-1/+7
| | | | | | | Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=289575
* Merge LinuxKPI changes from DragonflyBSD:Hans Petter Selasky2015-10-194-10/+36
| | | | | | | | | | - Add more list related functions and macros. - Update the hlist_for_each_entry() macro to take one less argument. Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=289574
* Merge LinuxKPI changes from DragonflyBSD:Hans Petter Selasky2015-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 Notes: svn path=/head/; revision=289572
* Fix compile warning.Hans Petter Selasky2015-10-191-1/+1
| | | | | | | Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=289571
* Merge LinuxKPI changes from DragonflyBSD:Hans Petter Selasky2015-10-191-96/+17
| | | | | | | | | - Reimplement math64 header file to distinguish more from Linux. Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=289569
* Merge LinuxKPI changes from DragonflyBSD:Hans Petter Selasky2015-10-191-18/+18
| | | | | | | | | - Whitespace fixes. Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=289568
* Merge LinuxKPI changes from DragonflyBSD:Hans Petter Selasky2015-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 Notes: svn path=/head/; revision=289567
* Merge LinuxKPI changes from DragonflyBSD:Hans Petter Selasky2015-10-191-0/+11
| | | | | | | | | - Implement schedule_timeout(). Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=289566
* Merge LinuxKPI changes from DragonflyBSD:Hans Petter Selasky2015-10-191-1/+12
| | | | | | | | | - Implement pagefault_disable() and pagefault_enable(). Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=289565
* Merge LinuxKPI changes from DragonflyBSD:Hans Petter Selasky2015-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 Notes: svn path=/head/; revision=289564
* Merge LinuxKPI changes from DragonflyBSD:Hans Petter Selasky2015-10-191-2/+8
| | | | | | | | | | - Some minor whitespace fixes. - Added support for two new Linux functions. Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=289563
* Fix build broken by r287861.Alexander V. Chernikov2015-09-161-1/+1
| | | | | | | Spotted by: zb Notes: svn path=/head/; revision=287862
* Simplify the way of attaching IPv6 link-layer header.Alexander V. Chernikov2015-09-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem description: How do we currently perform layer 2 resolution and header imposition: For IPv4 we have the following chain: ip_output() -> (ether|atm|whatever)_output() -> arpresolve() Lookup is done in proper place (link-layer output routine) and it is possible to provide cached lle data. For IPv6 situation is more complex: ip6_output() -> nd6_output() -> nd6_output_ifp() -> (whatever)_output() -> nd6_storelladdr() We have ip6_ouput() which calls nd6_output() instead of link output routine. nd6_output() does the following: * checks if lle exists, creates it if needed (similar to arpresolve()) * performes lle state transitions (similar to arpresolve()) * calls nd6_output_ifp() which pushes packets to link output routine along with running SeND/MAC hooks regardless of lle state (e.g. works as run-hooks placeholder). After that, iface output routine like ether_output() calls nd6_storelladdr() which performs lle lookup once again. As a result, we perform lookup twice for each outgoing packet for most types of interfaces. We also need to maintain runtime-checked table of 'nd6-free' interfaces (see nd6_need_cache()). Fix this behavior by eliminating first ND lookup. To be more specific: * make all nd6_output() consumers use nd6_output_ifp() instead * rename nd6_output[_slow]() to nd6_resolve_[slow]() * convert nd6_resolve() and nd6_resolve_slow() to arpresolve() semantics, e.g. copy L2 address to buffer instead of pushing packet towards lower layers * Make all nd6_storelladdr() users use nd6_resolve() * eliminate nd6_storelladdr() The resulting callchain is the following: ip6_output() -> nd6_output_ifp() -> (whatever)_output() -> nd6_resolve() Error handling: Currently sending packet to non-existing la results in ip6_<output|forward> -> nd6_output() -> nd6_output _lle() which returns 0. In new scenario packet is propagated to <ether|whatever>_output() -> nd6_resolve() which will return EWOULDBLOCK, and that result will be converted to 0. (And EWOULDBLOCK is actually used by IB/TOE code). Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D1469 Notes: svn path=/head/; revision=287861
* Ensure that the MAD agent's delayed taskqueue is completely stoppedMark Johnston2015-09-151-1/+1
| | | | | | | | | | | | before proceeding. Otherwise, nothing prevents it from running after the MAD agent struct has been been freed, and this results in a use-after-free when the task's ta_pending count is incremented in the callout handler. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=287837
* Currently the Linux character device mmap handling only supports mmapJohn Baldwin2015-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 Notes: svn path=/head/; revision=287440
* Reinstate unify_tcp_port_space and associated code that was lost duringNavdeep Parhar2015-08-121-1/+49
| | | | | | | | | | | | | the last OFED update (r278886). iWARP on FreeBSD is properly integrated with the network stack and the iWARP drivers _never_ operate out of any private TCP port-space that is invisible to the kernel. Instead, an iWARP connection shows up as a TCP socket (which is what it is) fully visible to the kernel and standard tools like netstat, sockstat, etc. Notes: svn path=/head/; revision=286703
* ipv4_is_zeronet() and ipv4_is_loopback() expect an address in networkMark Johnston2015-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 Notes: svn path=/head/; revision=286418
* Avoid calling into the random subsystem before it is initialized.Hans Petter Selasky2015-08-041-1/+5
| | | | | | | Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=286282
* ib mad: fix an incorrect use of list_for_each_entryMark Johnston2015-07-301-2/+5
| | | | | | | | | | | | | | | In tf_dequeue(), if we reach the end of the list without finding a non-cancelled element, "tmp" will be a pointer into the list head, so the tmp->canceled check is bogus. Use a flag instead. Submitted by: Tao Liu <Tao.Liu@isilon.com> Reviewed by: hselasky MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D3244 Notes: svn path=/head/; revision=286087
* Fix broken implementation of "kvasprintf()" function by adding missingHans Petter Selasky2015-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 Notes: svn path=/head/; revision=285088
* fd: make rights a mandatory argument to fget_unlockedMateusz Guzik2015-06-161-6/+10
| | | | Notes: svn path=/head/; revision=284443
* Implement lockless resource limits.Mateusz Guzik2015-06-102-2/+3
| | | | | | | | | | | | | Use the same scheme implemented to manage credentials. Code needing to look at process's credentials (as opposed to thred's) is provided with *_proc variants of relevant functions. Places which possibly had to take the proc lock anyway still use the proc pointer to access limits. Notes: svn path=/head/; revision=284215
* Add SIOCGI2C ioctl support to the driver. Would work only on ConnectX-3Gleb Smirnoff2015-05-273-0/+203
| | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=283612
* CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than tenJung-uk Kim2015-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 Notes: svn path=/head/; revision=283291
* Apply proper locking when iterating the multicast addresses and add aHans Petter Selasky2015-05-121-0/+4
| | | | | | | | | | | missing check for NULL from a non-blocking "kzalloc()" function call. MFC after: 1 week Sponsored by: Mellanox Technologies Found by: glebius @ Notes: svn path=/head/; revision=282817
* msecs_to_jiffies() is implemented using tvtohz(9), which always returns aMark Johnston2015-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 Notes: svn path=/head/; revision=282743
* find_next_bit() and find_next_zero_bit(): if the caller-specified offsetMark Johnston2015-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 Notes: svn path=/head/; revision=282741
* Don't drop the idr lock before verifying that the newly-inserted elementMark Johnston2015-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 Notes: svn path=/head/; revision=282331
* fd: remove filedesc argument from fdcloseMateusz Guzik2015-04-111-1/+1
| | | | | | | | | Just accept a thread instead. This makes it consistent with fdalloc. No functional changes. Notes: svn path=/head/; revision=281436
* Fix variable casting:Hans Petter Selasky2015-03-271-4/+2
| | | | | | | | | | - Jiffies or ticks in FreeBSD have integer type and are not long. MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=280768