summaryrefslogtreecommitdiffstats
path: root/sys/ofed
Commit message (Collapse)AuthorAgeFilesLines
* MFC r258779,r258780,r258787,r258822:eadler2014-02-044-13/+13
| | | | | | | | | | | | | Fix undefined behavior: (1 << 31) is not defined as 1 is an int and this shifts into the sign bit. Instead use (1U << 31) which gets the expected result. Similar to the (1 << 31) case it is not defined to do (2 << 30). This fix is not ideal as it assumes a 32 bit int, but does fix the issue for most cases. A similar change was made in OpenBSD.
* MFC r260102:dim2014-01-092-2/+2
| | | | | | | | | | | | Similar to r260020, only use -fms-extensions with gcc, for all other modules which require this flag to compile. Use a GCC_MS_EXTENSIONS variable, defined in kern.pre.mk, which can be used to easily supply the flag (or not), depending on the compiler type. MFC r260322: In addition to r260102, also define GCC_MS_EXTENSIONS in bsd.sys.mk, since kernel module builds do not use kern.pre.mk.
* Revert MFC of r260102 for now, until I can merge the required fix fromdim2014-01-052-2/+2
| | | | | head. This should fix building modules which require -fms-extensions to compile them with gcc.
* MFC r260020:dim2014-01-042-2/+2
| | | | | | | | | | | | | | For sys/dev/drm2/radeon, only use -fms-extensions with gcc. This flag is only to stop gcc complaining about anonymous unions, which clang does not do. For clang 3.4 however, -fms-extensions enables the Microsoft __wchar_t type, which clashes with our own types.h. MFC r260102: Similar to r260020, only use -fms-extensions with gcc, for all other modules which require this flag to compile. Use a GCC_MS_EXTENSIONS variable, defined in kern.pre.mk, which can be used to easily supply the flag (or not), depending on the compiler type.
* Defer start/stop port to workqueues.alfred2013-12-192-25/+75
| | | | MFC: 259411
* MFC: 258276alfred2013-11-171-0/+6
| | | | | | | | | Fix creating a vlan over lagg over mlxen crash. PR: 181931 Submitted by: Shahar Klein (shahark mellanox.com) Approved by: re
* MFC: 257542alfred2013-11-171-2/+2
| | | | | | | | | | Fix API mismatch exposed by lagg. When destroying a lagg the driver tries to restore the old mac and fails due to API mismatch. Submitted by: Shahar Klein (shahark at mellanox.com) Approved by: re
* MFC: r257862, r257863, r257864alfred2013-11-084-70/+53
| | | | | | | | | | | | | | | | | | | | | | | | r257862: Use explicit long cast to avoid overflow in bitopts. This was causing problems with the buddy allocator inside of ofed. r257863: Fix for bad performance when mtu is increased. Update the auto moderation behavior in the mlxen driver to match the new LINUX OFED code. r257864: Do not use a sleep lock when protecting the driver flags. This was causing a locking issue with lagg. Approved by: re
* Fix resource free.alfred2013-10-201-3/+3
| | | | | | | | | | The order of releasing resources in mlxen was wrong, which caused panic on reload of the module. MFC: 256682 Submitted by: Shahar Klein (shahark at mellanox.com) Approved by: re
* Fix __free_pages() in the linux shim.alfred2013-10-171-3/+3
| | | | | | | | | __free_pages() is actaully supposed to take a "struct page *" not an address. MFC: 256546 Approved by: re
* Fix for When more than one NIC is present.alfred2013-10-101-34/+1
| | | | | | | | | | | | The device name was incorrect due to a specific function we ported from the Linux driver that is not FBSD compatible. This resulted with a false sysctl registration and some more problematic issues. The patch basically revokes it all together. Submitted by: Meny Yossefi (menyy mellanox.com) Approved by: re
* Remove redundant declaration of cmclass indim2013-10-091-3/+0
| | | | | | | sys/ofed/drivers/infiniband/core/ucm.c, to silence a gcc warning. Approved by: re (kib) X-MFC-With: r255932
* Give an unnamed union in sys/ofed/include/rdma/ib_verbs.h a name, todim2013-10-071-1/+1
| | | | | | | silence a gcc warning. Approved by: re (gjb) MFC after: 3 days
* Fixed kernel crash when running devinfoalfred2013-10-011-0/+2
| | | | | | | | | | When calling to ib_uverbs_cleanup_ucontext, there is a call to mutex_lock of xrcd_table_mutex, which was not initialized. Added missing initialization for xrcd_table_mutex. Submitted by: Orit Moskovich (oritm mellanox.com) Approved by: re
* Enable ib_dev.mmap functionalfred2013-10-013-2/+73
| | | | | | | | | Removed the ifdef linux from this function. Added stub function for contiguous pages to avoid compilation errors. Submitted by: Orit Moskovich (oritm mellanox.com) Approved by: re
* Fixed 'Couldn't Create QP' issue when running rc_pingpong, uc_pingpong,alfred2013-10-011-0/+18
| | | | | | | | | | | | srq_pingpong IBverbs Removed refrences using 'ifdef __linux__' to qpg functions and related fields in struct ib_qp_init_attr. Submitted by: Orit Moskovich (oritm mellanox.com) Approved by: re
* Fixed kernel crash when removing IPOIB_CM option from configuration filealfred2013-10-012-2/+2
| | | | | | | Changed module init from module_init() to module_init_order() with SI_ORDER_MIDDLE flag Submitted by: Orit Moskovich (oritm mellanox.com) Approved by: re
* Fix mis-merge of upstream fix.alfred2013-10-011-4/+0
| | | | | | | | We would accidentally make the string one byte too short. Submitted by: Orit Moskovich (oritm mellanox.com) Approved by: re
* Update OFED to Linux 3.7 and update Mellanox drivers.alfred2013-09-2996-3500/+24925
| | | | | | | | | | | | | | | | | | | | | | | Update the OFED Infiniband core to the version supplied in Linux version 3.7. The update to OFED is nearly all additional defines and functions with the exception of the addition of additional parameters to ib_register_device() and the reg_user_mr callback. In addition the ibcore (Infiniband core) and ipoib (IP over Infiniband) have both been made into completely loadable modules to facilitate testing of the OFED stack in FreeBSD. Finally the Mellanox Infiniband drivers are now updated to the latest version shipping with Linux 3.7. Submitted by: Mellanox FreeBSD driver team: Oded Shanoon (odeds mellanox.com), Meny Yossefi (menyy mellanox.com), Orit Moskovich (oritm mellanox.com) Approved by: re
* Handle cases where capability rights are not provided.pjd2013-09-051-3/+9
| | | | Reported by: kib
* Change m->pkthdr.header to m->pkthdr.PH_loc.ptr after r254804andre2013-08-251-2/+2
| | | | | | to transiently store pointers to packet headers. Sponsored by: The FreeBSD Foundation
* Fix implementation of sock_getname.np2013-08-231-5/+5
| | | | MFC after: 1 week
* Stop an ipoib interface before detaching it.jhb2013-08-201-0/+2
| | | | | | | PR: kern/181225 Submitted by: Shahar Klein Obtained from: Mellanox MFC after: 1 week
* Add m_clrprotoflags() to clear protocol specific mbuf flags at up andandre2013-08-191-1/+1
| | | | | | | | downwards layer crossings. Consistently use it within IP, IPv6 and ethernet protocols. Discussed with: trociny, glebius
* Make sendfile() a method in the struct fileops. Currently onlyglebius2013-08-151-0/+1
| | | | | | | | vnode backed file descriptors have this method implemented. Reviewed by: kib Sponsored by: Nginx, Inc. Sponsored by: Netflix
* - Reserve a special AF for SDP. The one we were incorrectly using beforejeff2013-08-091-0/+2
| | | | | | was taken by another AF. Sponsored by: EMC / Isilon Storage Division
* - Correctly handle various edge cases in sysfs emulation.jeff2013-08-091-4/+7
| | | | Sponsored by: EMC / Isilon Storage Division
* - Use the correct type in the linux bitops emulation.jeff2013-08-091-4/+9
| | | | Submitted by: Maxim Ignatenko <gelraen.ua@gmail.com>
* Split the pagequeues per NUMA domains, and split pageademon processkib2013-08-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into threads each processing queue in a single domain. The structure of the pagedaemons and queues is kept intact, most of the changes come from the need for code to find an owning page queue for given page, calculated from the segment containing the page. The tie between NUMA domain and pagedaemon thread/pagequeue split is rather arbitrary, the multithreaded daemon could be allowed for the single-domain machines, or one domain might be split into several page domains, to further increase concurrency. Right now, each pagedaemon thread tries to reach the global target, precalculated at the start of the pass. This is not optimal, since it could cause excessive page deactivation and freeing. The code should be changed to re-check the global page deficit state in the loop after some number of iterations. The pagedaemons reach the quorum before starting the OOM, since one thread inability to meet the target is normal for split queues. Only when all pagedaemons fail to produce enough reusable pages, OOM is started by single selected thread. Launder is modified to take into account the segments layout with regard to the region for which cleaning is performed. Based on the preliminary patch by jeff, sponsored by EMC / Isilon Storage Division. Reviewed by: alc Tested by: pho Sponsored by: The FreeBSD Foundation
* Replace kernel virtual address space allocation with vmem. This providesjeff2013-08-073-9/+9
| | | | | | | | | | | | | transparent layering and better fragmentation. - Normalize functions that allocate memory to use kmem_* - Those that allocate address space are named kva_* - Those that operate on maps are named kmap_* - Implement recursive allocation handling for kmem_arena in vmem. Reviewed by: alc Tested by: pho Sponsored by: EMC / Isilon Storage Division
* Add a missing prototype.jhb2013-07-291-0/+1
| | | | Pointy hat: me
* Various fixes to the mlxen(4) driver:jhb2013-07-291-21/+31
| | | | | | | | | | | | | | - Remove an incorrect assertion that can trigger when downing an interface. - Stop the interface during detach to avoid panics when unloading the driver. - A few locking fixes to be more consistent with other FreeBSD drivers: - Protect if_drv_flags with the driver lock, not atomic ops - Hold the driver lock when adjusting multicast state. - Hold the driver lock while adjusting if_capenable. PR: kern/180791 [1,2] Submitted by: Shakar Klein @ Mellanox [1,2] MFC after: 3 days
* Avoid trashing IP fragments:jhb2013-07-251-2/+6
| | | | | | | | | - Only enable UDP/TCP hardware checksums if CSUM_UDP or CSUM_TCP is set. - Only enable IP hardware checksums if CSUM_IP is set. PR: kern/180430 Submitted by: Meny Yossefi <menyy@mellanox.com> MFC after: 1 week
* rename scheduler->swapper and SI_SUB_RUN_SCHEDULER->SI_SUB_LASTavg2013-07-241-3/+3
| | | | | | | | | | | | | | | | Also directly call swapper() at the end of mi_startup instead of relying on swapper being the last thing in sysinits order. Rationale: - "RUN_SCHEDULER" was misleading, scheduling already takes place at that stage - "scheduler" was misleading, the function swaps in the swapped out processes - another SYSINIT(SI_SUB_RUN_SCHEDULER, SI_ORDER_ANY) could never be invoked depending on its relative order with scheduler; this was not obvious and the bug actually used to exist Reviewed by: kib (ealier version) MFC after: 14 days
* Rework the previous fix for the IB vs Ethernet sysctl handler to be morejhb2013-07-182-20/+18
| | | | | | | | | | | | | | | generic and apply to all sysfs attributes: - Use sysctl_handle_string() instead of reimplementing it. - Remove trailing newline from the current value before passing it to userland and append a newline to the new string value before passing it to the attribute's store function. - Don't leak the temporary buffer if the first error check triggers. - Revert earlier change to mlx4 port mode handler. PR: kern/174213 Submitted by: Garrett Cooper Reviewed by: Shakar Klein @ Mellanox MFC after: 1 week
* Remove check forbidding requests that would result in one port being setjhb2013-07-171-3/+0
| | | | | | | | to Ethernet and the subsequent port being set to IB. Submitted by: Shakar Klein @ Mellanox Tested by: Morgan Robertson <morganrobertson@gmail.com> MFC after: 1 week
* Allow mlx4 devices to switch from Ethernet to Infiniband (and vice versa):jhb2013-07-082-5/+10
| | | | | | | | | | | | - Fix sysctl wrapper for sysfs attributes to properly handle new string values similar to sysctl_handle_string() (only copyin the user's supplied length and nul-terminate the string). - Don't check for a trailing newline when evaluating the desired operating mode of a mlx4 device. PR: kern/179999 Submitted by: Shahar Klein <shahark@mellanox.com> MFC after: 1 week
* Store a reference to the vnode associated with a file descriptor in thejhb2013-06-112-1/+5
| | | | | | | | | | | linux_file structure and use it instead of directly accessing td_fpop when destroying the linux_file structure. The td_fpop pointer is not valid when a cdevpriv destructor is run, and the type-specific close method has already been called, so f_vnode may not be valid (and the vnode might have been recycled without our own reference). Tested by: Julian Stecklina <jsteckli@os.inf.tu-dresden.de> MFC after: 1 week
* Fxi a bunch of typos.eadler2013-05-101-1/+1
| | | | | PR: misc/174625 Submitted by: Jeremy Chadwick <jdc@koitsu.org>
* According to the documentation, on Linux, cancel_delayed_work() does notdelphij2013-05-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | do drain (flush_workqueue() in Linux terms) but instead returns true if the work was removed before it is run, or false otherwise. Simulate this by removing the taskqueue_drain() and return the value derived from taskqueue_cancel()'s return value. This would solve a witness warning caused by calling taskqueue_drain() with a non-sleepable lock held, like: taskqueue_drain with the following non-sleepable locks held: exclusive rw lle (lle) r = 0 (0xfffffe001450b410) locked @ /usr/src/sys/netinet/in.c:1484 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xffffff848d4f7690 kdb_backtrace() at kdb_backtrace+0x39/frame 0xffffff848d4f7740 witness_warn() at witness_warn+0x4a8/frame 0xffffff848d4f7800 taskqueue_drain() at taskqueue_drain+0x3a/frame 0xffffff848d4f7840 set_timeout() at set_timeout+0x4a/frame 0xffffff848d4f7860 netevent_callback() at netevent_callback+0x16/frame 0xffffff848d4f7870 arpintr() at arpintr+0x9b5/frame 0xffffff848d4f7930 This do not affect kernel without OFED compiled in. Reported by: Garrett Cooper <yaneurabeya gmail com> (who also tested an earlier version of this patch, but bugs are mine) MFC after: 2 weeks
* Add const qualifier to the dst parameter of the ifnet if_output method.glebius2013-04-271-2/+2
|
* Check for SS_NBIO in the socket state field rather than socket bufferjhb2013-04-031-2/+2
| | | | | | | flags. Submitted by: Vijay Singh MFC after: 1 week
* MFCattilio2013-03-081-7/+9
|\
| * Add protective parentheses for macro argument, missed in r247671.mav2013-03-021-1/+1
| |
| * MFcalloutng:mav2013-03-021-7/+9
| | | | | | | | | | Give OFED Linux wrapper own "expires" field instead of abusing callout's c_time, which will change its type and units with calloutng commit.
* | MFCattilio2013-03-021-4/+5
|\ \ | |/
| * Merge Capsicum overhaul:pjd2013-03-021-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Capability is no longer separate descriptor type. Now every descriptor has set of its own capability rights. - The cap_new(2) system call is left, but it is no longer documented and should not be used in new code. - The new syscall cap_rights_limit(2) should be used instead of cap_new(2), which limits capability rights of the given descriptor without creating a new one. - The cap_getrights(2) syscall is renamed to cap_rights_get(2). - If CAP_IOCTL capability right is present we can further reduce allowed ioctls list with the new cap_ioctls_limit(2) syscall. List of allowed ioctls can be retrived with cap_ioctls_get(2) syscall. - If CAP_FCNTL capability right is present we can further reduce fcntls that can be used with the new cap_fcntls_limit(2) syscall and retrive them with cap_fcntls_get(2). - To support ioctl and fcntl white-listing the filedesc structure was heavly modified. - The audit subsystem, kdump and procstat tools were updated to recognize new syscalls. - Capability rights were revised and eventhough I tried hard to provide backward API and ABI compatibility there are some incompatible changes that are described in detail below: CAP_CREATE old behaviour: - Allow for openat(2)+O_CREAT. - Allow for linkat(2). - Allow for symlinkat(2). CAP_CREATE new behaviour: - Allow for openat(2)+O_CREAT. Added CAP_LINKAT: - Allow for linkat(2). ABI: Reuses CAP_RMDIR bit. - Allow to be target for renameat(2). Added CAP_SYMLINKAT: - Allow for symlinkat(2). Removed CAP_DELETE. Old behaviour: - Allow for unlinkat(2) when removing non-directory object. - Allow to be source for renameat(2). Removed CAP_RMDIR. Old behaviour: - Allow for unlinkat(2) when removing directory. Added CAP_RENAMEAT: - Required for source directory for the renameat(2) syscall. Added CAP_UNLINKAT (effectively it replaces CAP_DELETE and CAP_RMDIR): - Allow for unlinkat(2) on any object. - Required if target of renameat(2) exists and will be removed by this call. Removed CAP_MAPEXEC. CAP_MMAP old behaviour: - Allow for mmap(2) with any combination of PROT_NONE, PROT_READ and PROT_WRITE. CAP_MMAP new behaviour: - Allow for mmap(2)+PROT_NONE. Added CAP_MMAP_R: - Allow for mmap(PROT_READ). Added CAP_MMAP_W: - Allow for mmap(PROT_WRITE). Added CAP_MMAP_X: - Allow for mmap(PROT_EXEC). Added CAP_MMAP_RW: - Allow for mmap(PROT_READ | PROT_WRITE). Added CAP_MMAP_RX: - Allow for mmap(PROT_READ | PROT_EXEC). Added CAP_MMAP_WX: - Allow for mmap(PROT_WRITE | PROT_EXEC). Added CAP_MMAP_RWX: - Allow for mmap(PROT_READ | PROT_WRITE | PROT_EXEC). Renamed CAP_MKDIR to CAP_MKDIRAT. Renamed CAP_MKFIFO to CAP_MKFIFOAT. Renamed CAP_MKNODE to CAP_MKNODEAT. CAP_READ old behaviour: - Allow pread(2). - Disallow read(2), readv(2) (if there is no CAP_SEEK). CAP_READ new behaviour: - Allow read(2), readv(2). - Disallow pread(2) (CAP_SEEK was also required). CAP_WRITE old behaviour: - Allow pwrite(2). - Disallow write(2), writev(2) (if there is no CAP_SEEK). CAP_WRITE new behaviour: - Allow write(2), writev(2). - Disallow pwrite(2) (CAP_SEEK was also required). Added convinient defines: #define CAP_PREAD (CAP_SEEK | CAP_READ) #define CAP_PWRITE (CAP_SEEK | CAP_WRITE) #define CAP_MMAP_R (CAP_MMAP | CAP_SEEK | CAP_READ) #define CAP_MMAP_W (CAP_MMAP | CAP_SEEK | CAP_WRITE) #define CAP_MMAP_X (CAP_MMAP | CAP_SEEK | 0x0000000000000008ULL) #define CAP_MMAP_RW (CAP_MMAP_R | CAP_MMAP_W) #define CAP_MMAP_RX (CAP_MMAP_R | CAP_MMAP_X) #define CAP_MMAP_WX (CAP_MMAP_W | CAP_MMAP_X) #define CAP_MMAP_RWX (CAP_MMAP_R | CAP_MMAP_W | CAP_MMAP_X) #define CAP_RECV CAP_READ #define CAP_SEND CAP_WRITE #define CAP_SOCK_CLIENT \ (CAP_CONNECT | CAP_GETPEERNAME | CAP_GETSOCKNAME | CAP_GETSOCKOPT | \ CAP_PEELOFF | CAP_RECV | CAP_SEND | CAP_SETSOCKOPT | CAP_SHUTDOWN) #define CAP_SOCK_SERVER \ (CAP_ACCEPT | CAP_BIND | CAP_GETPEERNAME | CAP_GETSOCKNAME | \ CAP_GETSOCKOPT | CAP_LISTEN | CAP_PEELOFF | CAP_RECV | CAP_SEND | \ CAP_SETSOCKOPT | CAP_SHUTDOWN) Added defines for backward API compatibility: #define CAP_MAPEXEC CAP_MMAP_X #define CAP_DELETE CAP_UNLINKAT #define CAP_MKDIR CAP_MKDIRAT #define CAP_RMDIR CAP_UNLINKAT #define CAP_MKFIFO CAP_MKFIFOAT #define CAP_MKNOD CAP_MKNODAT #define CAP_SOCK_ALL (CAP_SOCK_CLIENT | CAP_SOCK_SERVER) Sponsored by: The FreeBSD Foundation Reviewed by: Christoph Mallon <christoph.mallon@gmx.de> Many aspects discussed with: rwatson, benl, jonathan ABI compatibility discussed with: kib
* | Rename VM_OBJECT_LOCK(), VM_OBJECT_UNLOCK() and VM_OBJECT_TRYLOCK() toattilio2013-02-201-3/+3
| | | | | | | | | | | | their "write" versions. Sponsored by: EMC / Isilon storage division
* | Switch vm_object lock to be a rwlock.attilio2013-02-201-0/+1
|/ | | | | | | | * VM_OBJECT_LOCK and VM_OBJECT_UNLOCK are mapped to write operations * VM_OBJECT_SLEEP() is introduced as a general purpose primitve to get a sleep operation using a VM_OBJECT_LOCK() as protection * The approach must bear with vm_pager.h namespace pollution so many files require including directly rwlock.h
* Fix LINT build on amd64.delphij2013-02-091-4/+4
|
OpenPOWER on IntegriCloud