summaryrefslogtreecommitdiff
path: root/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
AgeCommit message (Collapse)Author
2018-06-05staging: lustre: delete the filesystem from the tree.Greg Kroah-Hartman
The Lustre filesystem has been in the kernel tree for over 5 years now. While it has been an endless source of enjoyment for new kernel developers learning how to do basic codingstyle cleanups, as well as an semi-entertaining source of bewilderment from the vfs developers any time they have looked into the codebase to try to figure out how to port their latest api changes to this filesystem, it has not really moved forward into the "this is in shape to get out of staging" despite many half-completed attempts. And getting code out of staging is the main goal of that portion of the kernel tree. Code should not stagnate and it feels like having this code in staging is only causing the development cycle of the filesystem to take longer than it should. There is a whole separate out-of-tree copy of this codebase where the developers work on it, and then random changes are thrown over the wall at staging at some later point in time. This dual-tree development model has never worked, and the state of this codebase is proof of that. So, let's just delete the whole mess. Now the lustre developers can go off and work in their out-of-tree codebase and not have to worry about providing valid changelog entries and breaking their patches up into logical pieces. They can take the time they have spend doing those types of housekeeping chores and get the codebase into a much better shape, and it can be submitted for inclusion into the real part of the kernel tree when ready. Cc: Oleg Drokin <oleg.drokin@intel.com> Cc: Andreas Dilger <andreas.dilger@intel.com> Cc: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-31staging: lustre: include linux/highmem.h when neededArnd Bergmann
Something in recent linux-next kernels caused linux/highmem.h to no longer be included implicitly from o2iblnd_cb.c, causing a build failure: drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c: In function 'kiblnd_kvaddr_to_page': drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:549:15: error: 'PKMAP_BASE' undeclared (first use in this function); did you mean 'RTM_BASE'? if (vaddr >= PKMAP_BASE && ^~~~~~~~~~ RTM_BASE drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:549:15: note: each undeclared identifier is reported only once for each function it appears in drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:550:28: error: 'LAST_PKMAP' undeclared (first use in this function); did you mean 'AT_HWCAP'? vaddr < (PKMAP_BASE + LAST_PKMAP * PAGE_SIZE)) { ^~~~~~~~~~ AT_HWCAP This adds back an explicit include for the header. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-14staging: lustre: o2iblnd: Fix crash in kiblnd_handle_early_rxs()Doug Oucharek
Under upstream staging commit 5a2ca43fa54f561c252c2, the list handling code in kiblnd_handle_early_rxs() got changed to list_for_each_safe(). That protects against the current thread from deleting the current entry it is looking at. It does not protect against another thread from deleting the next item in the list (which the tmp variable points to). The way this routine holds then releases a lock opens the door to other threads doing just that. This patch reverts this commit on this routine. Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-9886 Fixes: 5a2ca43fa54f ("Staging: lustre: Iterate list using list_for_each_entry") Signed-off-by: Doug Oucharek <dougso@me.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-08staging: lustre: o2iblnd: Enable Multiple OPA Endpoints between NodesDoug Oucharek
OPA driver optimizations are based on the MPI model where it is expected to have multiple endpoints between two given nodes. To enable this optimization for Lustre, we need to make it possible, via an LND-specific tuneable, to create multiple endpoints and to balance the traffic over them. Both sides of a connection must have this patch for it to work. Only the active side of the connection (usually the client) needs to have the new tuneable set > 1. Signed-off-by: Doug Oucharek <doug.s.oucharek@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8943 Reviewed-on: https://review.whamcloud.com/25168 Reviewed-by: Amir Shehata <amir.shehata@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: James Simmons <uja.ornl@yahoo.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Doug Oucharek <dougso@me.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06staging: lustre: o2iblnd: fix race at kiblnd_connect_peerDoug Oucahrek
cmid will be destroyed at OFED if kiblnd_cm_callback return error. if error happen before the end of kiblnd_connect_peer, it will touch destroyed cmid and fail as (o2iblnd_cb.c:1315:kiblnd_connect_peer()) ASSERTION( cmid->device != ((void *)0) ) failed: Signed-off-by: Alexander Boyko <alexander.boyko@seagate.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-10015 Reviewed-by: Alexey Lyashkov <c17817@cray.com> Reviewed-by: Doug Oucharek <dougso@me.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Signed-off-by: Doug Oucharek <dougso@me.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06staging: lustre: o2iblnd: Fix FastReg map/unmap for MLX5Doug Oucharek
The FastReg support in ko2iblnd was not unmapping pool items causing the items to leak. In addition, the mapping code is not growing the pool like we do with FMR. This patch makes sure we are unmapping FastReg pool elements when we are done with them. It also makes sure the pool will grow when we depleat the pool. Signed-off-by: Doug Oucharek <doug.s.oucharek@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-9472 Reviewed-on: https://review.whamcloud.com/27015 Reviewed-by: Andrew Perepechko <andrew.perepechko@seagate.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: James Simmons <uja.ornl@yahoo.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Doug Oucharek <dougso@me.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: lustre: discard cfs_duration_sec()NeilBrown
cfs_duration_sec() simply divides by HZ. It is mostly used to report durations in debug messages. Remove and just use X/HZ. Signed-off-by: NeilBrown <neilb@suse.com> Reviewed-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: lustre: libcfs: discard cfs_time_after()NeilBrown
cfs_time_after() behaves exactly like time_after() similarly cfs_time_aftereq() matches time_after_eq() so discard the cfs versions. Signed-off-by: NeilBrown <neilb@suse.com> Reviewed-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: lustre: libcfs: discard cfs_time_shift().NeilBrown
This function simply multiplies by HZ and adds jiffies. This is simple enough to be opencoded, and doing so makes the code easier to read. Same for cfs_time_shift_64() Signed-off-by: NeilBrown <neilb@suse.com> Reviewed-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: lustre: cfs_time_current() -> jiffies.NeilBrown
Discard cfs_time_current() and cfs_time_current64() and use jiffies and get_jiffies_64() like the rest of the kernel. Signed-off-by: NeilBrown <neilb@suse.com> Reviewed-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-22staging: lustre: remove unnecessary cfs_block_allsigs() callsNeilBrown
Threads started by kthread_run() ignore all signals, as kthreadd() calls ignore_signals(), and this is inherited by all children. So there is no need to call cfs_block_allsigs() in functions that are only run from kthread_run(). Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-16staging: lustre: discard cfs_time_seconds()NeilBrown
cfs_time_seconds() converts a number of seconds to the matching number of jiffies. The standard way to do this in Linux is "* HZ". So discard cfs_time_seconds() and use "* HZ" instead. Reviewed-by: James Simmons <jsimmons@infradead.org> Signed-off-by: NeilBrown <neilb@suse.com> Reviewed-by: Patrick Farrell <paf@cray.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-26staging: lustre: separate a connection destroy from free struct kib_connDmitry Eremin
The logic of the original commit 4d99b2581eff ("staging: lustre: avoid intensive reconnecting for ko2iblnd") was assumed conditional free of struct kib_conn if the second argument free_conn in function kiblnd_destroy_conn(struct kib_conn *conn, bool free_conn) is true. But this hunk of code was dropped from original commit. As result the logic works wrong and current code use struct kib_conn after free. > drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c > 3317 kiblnd_destroy_conn(conn, !peer); > ^^^^ Freed always (but should be conditionally) > 3318 > 3319 spin_lock_irqsave(lock, flags); > 3320 if (!peer) > 3321 continue; > 3322 > 3323 conn->ibc_peer = peer; > ^^^^^^^^^^^^^^ Use after free > 3324 if (peer->ibp_reconnected < KIB_RECONN_HIGH_RACE) > 3325 list_add_tail(&conn->ibc_list, > ^^^^^^^^^^^^^^ Use after free > 3326 &kiblnd_data.kib_reconn_list); > 3327 else > 3328 list_add_tail(&conn->ibc_list, > ^^^^^^^^^^^^^^ Use after free > 3329 &kiblnd_data.kib_reconn_wait); To avoid confusion this fix moved the freeing a struct kib_conn outside of the function kiblnd_destroy_conn() and free as it was intended in original commit. Cc: <stable@vger.kernel.org> # v4.6 Fixes: 4d99b2581eff ("staging: lustre: avoid intensive reconnecting for ko2iblnd") Signed-off-by: Dmitry Eremin <Dmitry.Eremin@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-09staging: lustre: replace simple cases of LIBCFS_ALLOC with kzalloc.NeilBrown
All usages of the form LIBCFS_ALLOC(variable, sizeof(variable)) or LIBCFS_ALLOC(variable, sizeof(variable's-type)) are changed to variable = kzalloc(sizeof(...), GFP_NOFS); Similarly, all LIBCFS_FREE(variable, sizeof(variable)) become kfree(variable); None of these need the vmalloc option, or any of the other minor benefits of LIBCFS_ALLOC(). Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-11staging: lustre: add SPDX identifiers to all lustre filesGreg Kroah-Hartman
It's good to have SPDX identifiers in all files to make it easier to audit the kernel tree for correct licenses. Update the drivers/staging/lustre files files with the correct SPDX license identifier based on the license text in the file itself. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. This work is based on a script and data from Thomas Gleixner, Philippe Ombredanne, and Kate Stewart. Cc: Oleg Drokin <oleg.drokin@intel.com> Cc: James Simmons <jsimmons@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Kate Stewart <kstewart@linuxfoundation.org> Cc: Philippe Ombredanne <pombredanne@nexb.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-18staging: lustre: ko2iblnd: check copy_from_iter/copy_to_iter return codeArnd Bergmann
We now get a helpful warning for code that calls copy_{from,to}_iter without checking the return value, introduced by commit aa28de275a24 ("iov_iter/hardening: move object size checks to inlined part"). drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c: In function 'kiblnd_send': drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:1643:2: error: ignoring return value of 'copy_from_iter', declared with attribute warn_unused_result [-Werror=unused-result] drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c: In function 'kiblnd_recv': drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:1744:3: error: ignoring return value of 'copy_to_iter', declared with attribute warn_unused_result [-Werror=unused-result] In case we get short copies here, we may get incorrect behavior. I've added failure handling for both rx and tx now, returning -EFAULT as expected. Cc: stable@vger.kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-20sched/wait: Rename wait_queue_t => wait_queue_entry_tIngo Molnar
Rename: wait_queue_t => wait_queue_entry_t 'wait_queue_t' was always a slight misnomer: its name implies that it's a "queue", but in reality it's a queue *entry*. The 'real' queue is the wait queue head, which had to carry the name. Start sorting this out by renaming it to 'wait_queue_entry_t'. This also allows the real structure name 'struct __wait_queue' to lose its double underscore and become 'struct wait_queue_entry', which is the more canonical nomenclature for such data types. Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-03-12staging: lustre: Use min3 macroGargi Sharma
Replace comparsions between three expressions using two min macros with min3 macro. Done using Coccinelle Script: @@ expression e1; expression e2; expression e3; @@ ( - min(min(e1, e2), e3) + min3(e1, e2, e3) | - min(e1, min(e2, e3)) + min3(e1, e2, e3) ) Signed-off-by: Gargi Sharma <gs051095@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging: lustre: lnet: use struct bio_vec instead of typedefJames Simmons
Kill off lnet_kiov_t and use struct bio_vec directly. Signed-off-by: James Simmons <uja.ornl@yahoo.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging: lustre: lnet: change lnet_process_id_t to proper structureJames Simmons
Change lnet_process_id_t from typedef to proper structure. Signed-off-by: James Simmons <uja.ornl@yahoo.com> Reviewed-on: https://review.whamcloud.com/20831 Reviewed-by: Olaf Weber <olaf@sgi.com> Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging: lustre: lnet: change lnet_ni_t to proper structureJames Simmons
Change lnet_ni_t from typedef to proper structure. Signed-off-by: James Simmons <uja.ornl@yahoo.com> Reviewed-on: https://review.whamcloud.com/20831 Reviewed-by: Olaf Weber <olaf@sgi.com> Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging: lustre: lnet: change lnet_msg_t to proper structureJames Simmons
Change lnet_msg_t from typedef to proper structure. Signed-off-by: James Simmons <uja.ornl@yahoo.com> Reviewed-on: https://review.whamcloud.com/20831 Reviewed-by: Olaf Weber <olaf@sgi.com> Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging: lustre: ko2iblnd: Adapt to the removal of ib_get_dma_mr()Doug Oucharek
In Linux kernel 4.9-rc1, the function ib_get_dma_mr() was removed and a second parameter was added to ib_alloc_pd(). As this broke the building of the ko2iblnd module in staging, the Kconfig for LNet has marked ko2iblnd as broken and stopped building it. This patch fixes this breakage by: - Removing the BROKEN tag from lnet/Kconfig. - Make it so the module parameter map_on_demand can no longer be zero (we have to configure FMR/FastReg pools; it can no longer be off). - No longer try to use the global DMA memory region, but make use of the FMR/FastReg pool for all RDMA Tx operations. - Everywhere we are using the device DMA mr to derive the L-key for non-registered memory regions, use the pd->local_dma_lkey value instead. - Make the default map_on_demand = 256. This will allow nodes with this patch to still connected to older nodes without this patch and FMR/FastReg turned off. When FMR/FastReg is turned off, we use 256 as the max frags so the two sides will still be able to communicate and work. - Fix a mistake with BUILD_BUG_ON calls in o2iblnd.c which caused compiling to fail. Signed-off-by: Doug Oucharek <doug.s.oucharek@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-9026 Reviewed-on: https://review.whamcloud.com/#/c/24931/ Reviewed-by: James Simmons <uja.ornl@yahoo.com> Reviewed-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-03staging: lustre: libcfs: fix error messagesDmitry Eremin
Don't treat unability to set CPU partition affinity as error. Improve those warning messages. Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8703 Reviewed-on: https://review.whamcloud.com/23307 Reviewed-by: Patrick Farrell <paf@cray.com> Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-23staging: lustre: lnet: change lnet_hdr_t to proper structureJames Simmons
Change lnet_hdr_t from typedef to proper structure. Signed-off-by: James Simmons <uja.ornl@yahoo.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6142 Reviewed-on: https://review.whamcloud.com/24566 Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com> Reviewed-by: Olaf Weber <olaf@sgi.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-12-07staging/lustre/o2iblnd: Fix misspelled attemps->attemptsOleg Drokin
Highlighted by checkpatch: WARNING: 'attemps' may be misspelled - perhaps 'attempts'? #20278: FILE: drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:3272: + * reconnection attemps. Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-12-07staging/lustre/o2iblnd: Add missing spaceOleg Drokin
checkpatch highlighted missing space before assignment for lock variable. + spinlock_t *lock= &kiblnd_data.kib_connd_lock; Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-07staging: lustre: o2iblnd: replace space indentation with tabsNicholas Hanley
This patch fixes all CODE_INDENT checkpatch errors in o2iblnd. Signed-off-by: Nicholas Hanley <nicholasjhanley@gmail.com> Reviewed-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-19staging: lustre: o2iblnd: Put back work queue check previously removedDoug Oucharek
The previous patch, http://review.whamcloud.com/21304/, removed a check needed until LU-5718 is properly addressed. With the check, LU-5718 results in an error message and a lost RDMA operation. Without it, we have memory corruption and a crash (much harder to debug). Putting the check back in case LU-5718 is not fixed soon. Signed-off-by: Doug Oucharek <doug.s.oucharek@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7650 Reviewed-on: http://review.whamcloud.com/22281 Reviewed-by: James Simmons <uja.ornl@yahoo.com> Reviewed-by: Olaf Weber <olaf@sgi.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01staging/lustre/o2iblnd: handle mixed page size configurations.James Simmons
Currently it is not possible to send LNet traffic between two nodes using infiniband hardware that have different page sizes for the case when RDMA fragments are used. When two nodes establish a connection they tell the other node the maximum number of RDMA fragments they support. The issue is that the units are pages, and 256 64K pages corresponds to 16MB of data, whereas a 4K page system is limited to messages with 1MB of data. The solution is to report over the wire the maximum number of fragments in 4K unites regardless of the native page size. The recipient then uses its native page size to translate into the maximum number of pages sized fragments it can send to the other node. Signed-off-by: James Simmons <uja.ornl@yahoo.com> Reviewed-on: http://review.whamcloud.com/21304 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7650 Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com> Reviewed-by: Olaf Weber <olaf@sgi.com> Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21staging/lustre: Make alignment match open parenthesisOleg Drokin
This patch fixes most of checkpatch occurences of "CHECK: Alignment should match open parenthesis" in Lustre code. Signed-off-by: Emoly Liu <emoly.liu@intel.com> Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21lustre: introduce lnet_copy_{k, }iov2iter(), kill lnet_copy_{k, }iov2{k, }iov()Al Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21lustre: pass iov_iter to ->lnd_recv()Al Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21staging: lustre: lnet: Stop Infinite CON RACE ConditionDoug Oucharek
In current code, when a CON RACE occurs, the passive side will let the node with the higher NID value win the race. We have a field case where a node can have a "stuck" connection which never goes away and is the trigger of a never-ending loop of re-connections. This patch introduces a counter to how many times a connection in a connecting state has been the cause of a CON RACE rejection. After 20 times (constant MAX_CONN_RACES_BEFORE_ABORT), we assume the connection is stuck and let the other side (with lower NID) win. Signed-off-by: Doug Oucharek <doug.s.oucharek@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7646 Reviewed-on: http://review.whamcloud.com/19430 Reviewed-by: Amir Shehata <amir.shehata@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21staging: lustre: lnet: lock improvement for ko2iblndLiang Zhen
kiblnd_check_sends() takes conn::ibc_lock at the begin and release this lock at the end, this is inefficient because most use-case needs to explicitly release ibc_lock before caling this function. This patches changes it to kiblnd_check_sends_locked() and avoid unnecessary lock dances. Signed-off-by: Liang Zhen <liang.zhen@intel.com> Signed-off-by: Doug Oucharek <doug.s.oucharek@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7099 Reviewed-on: http://review.whamcloud.com/20322 Reviewed-by: Amir Shehata <amir.shehata@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21staging: lustre: lnet: make connection more stable with packet lossAlexander Boyko
IB network may lose last connection handshake packet. This problem isn't Lustre specific and described at https://oss.oracle.com/pipermail/rds-devel/2007-December/000271.html for example. Solution is to make conection established if any packet is received for it. Signed-off-by: Alexander Boyko <alexander.boyko@seagate.com> Signed-off-by: Alexey Lyashkov <alexey.lyashkov@seagate.com> Seagate-bug-id: MRP-2883 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8303 Reviewed-on: http://review.whamcloud.com/20874 Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com> Reviewed-by: Alexander Zarochentsev <alexander.zarochentsev@seagate.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21staging: lustre: lnet: Correct position of lnet_ni_decref()Doug Oucharek
In fix http://review.whamcloud.com/#/c/19614/, the call to lnet_ni_decref() should have followed the routines which are using the NI. This patch correct that. Signed-off-by: Doug Oucharek <doug.s.oucharek@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8022 Reviewed-on: http://review.whamcloud.com/21001 Reviewed-by: James Simmons <uja.ornl@yahoo.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-15lustre: don't reinvent struct bio_vecAl Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-20Merge 4.7-rc4 into staging-nextGreg Kroah-Hartman
We want the fixes in here, and we can resolve a merge issue in drivers/iio/industrialio-trigger.c Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-18staging/lustre: Remove unnecessary space after a castOleg Drokin
This patch fixes all checkpatch occurences of "CHECK: No space is necessary after a cast" in Lustre code. Signed-off-by: Emoly Liu <emoly.liu@intel.com> Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-17staging/lustre: Replace sun.com GPLv2 URL with gnu.org one.Oleg Drokin
http://www.sun.com/software/products/lustre/docs/GPLv2.pdf is no longer around, so replae it with (hopefully more permanent) http://http://www.gnu.org/licenses/gpl-2.0.html Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Reported-by: Xose Vazquez Perez <xose.vazquez@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-17staging/lustre: Remove the "Please contact SUN for GPL" from headersOleg Drokin
Since SUN is no longer around and there's no point in contacting them, just remove that whole thing. Copy of GPL is available online anyway (URLs to be updated in next patch). This patch was generated with: find drivers/staging/lustre -name "*.[ch]" -exec perl -0777 -i -pe 's/ \* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,\n \* CA 95054 USA or visit www.sun.com if you need additional information or\n \* have any questions.\n \*\n//igs' {} \; Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Reported-by: Xose Vazquez Perez <xose.vazquez@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-17staging: lustre: o2iblnd: remove typedefsJames Simmons
Remove all remaining typedefs in o2iblnd driver. Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-09staging: lustre: lnet: Don't access NULL NI on failure pathDoug Oucharek
In kiblnd_passive_connect(), if we are failing the connection attempt because we cannot find a valid NI (we have a NULL NI), we were coring after the "goto fail" because the failure path was assuming non-NULL NI. This patch ensures we don't dereference a NULL NI on that failure path. Signed-off-by: Doug Oucharek <doug.s.oucharek@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8022 Reviewed-on: http://review.whamcloud.com/19614 Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: James Simmons <uja.ornl@yahoo.com> Reviewed-by: Matt Ezell <ezellma@ornl.gov> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-07staging: lustre: ko2iblnd: fix memory corruption with fragmentsJames Simmons
In my test of the upstream client this change exposed a long standing issues where we have a offset that is not page algined would causes us to access memory beyond the scatter gather list which was causing memory corruption when all 256 fragments were in use. Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-09staging: lustre: o2iblnd: properly set ibr_whyAmir Shehata
For the case of when the connections supported fragment count is smaller than what is supported locally only set ibr_why to IBLND_REJECT_RDMA_FRAGS if the ko2iblnd protocol verison is IBLND_MSG_VERSION. Signed-off-by: Amir Shehata <amir.shehata@intel.com> Signed-off-by: James Simmons <uja.ornl@yahoo.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7101 Reviewed-on: http://review.whamcloud.com/16367 Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com> Reviewed-by: Olaf Weber <olaf@sgi.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-09staging: lustre: o2iblnd: per NI map-on-demand valueAmir Shehata
Enables support of different map-on-demand values per NI. This is required to support OPA coexistence with MLX5 cards. MLX5 does not support FMR, which is enabled via map-on-demand. However OPA's performance is greatly enahanced when FMR is enabled. In order to enable coexistence of both of these two types of cards we need to be able to set different map-on-demand values for both NIs. This patch also lays the ground work for other per NI tunables to be added in future patches. Signed-off-by: Amir Shehata <amir.shehata@intel.com> Signed-off-by: James Simmons <uja.ornl@yahoo.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7101 Reviewed-on: http://review.whamcloud.com/16367 Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com> Reviewed-by: Olaf Weber <olaf@sgi.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-09staging: lustre: o2iblnd: convert macros to inline functionsAmir Shehata
Convert a few macros in o2iblnd.h to inline functions. Signed-off-by: Amir Shehata <amir.shehata@intel.com> Signed-off-by: James Simmons <uja.ornl@yahoo.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7101 Reviewed-on: http://review.whamcloud.com/16367 Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com> Reviewed-by: Olaf Weber <olaf@sgi.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-09staging: lustre: o2iblnd: Add Fast Reg memory registration supportDmitry Eremin
FMR is deprecated and it not supported by the mlx5 driver. This patch adds memory management extensions support as backup of FMR. This was combined with the work from Li Dongyang to make it work with the latest kernels. Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com> Signed-off-by: Li Dongyang <dongyang.li@anu.edu.au> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5783 Reviewed-on: http://review.whamcloud.com/17606 Reviewed-by: James Simmons <uja.ornl@yahoo.com> Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-09staging: lustre: o2iblnd: handle unmapping of FMR in kiblnd_fmr_pool_unmapDmitry Eremin
Move FMR unmapping from kiblnd_unmap_tx() to the function kiblnd_fmr_pool_unmap() so kiblnd_unmap_tx() can be used with the Fast Registration API as well. Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5783 Reviewed-on: http://review.whamcloud.com/17606 Reviewed-by: James Simmons <uja.ornl@yahoo.com> Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>