summaryrefslogtreecommitdiff
path: root/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
AgeCommit message (Collapse)Author
2017-07-27staging: lustre: ko2iblnd: check copy_from_iter/copy_to_iter return codeArnd Bergmann
commit 566e1ce22e04426fa52328b2adcdf1df49acd98e upstream. 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. 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>
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-19staging/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-18staging/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-18staging/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-18staging: 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-10staging: 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-08staging: 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>
2016-05-09staging: lustre: o2iblnd: cache FMR key in kib_fmr_tDmitry Eremin
Move the FMR key handling from kiblnd_fmr_map_tx() to the function kiblnd_fmr_pool_map(). This will allow the function kiblnd_fmr_map_tx() to handle keys for both FMR and Fast Registration. 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>
2016-03-28staging: lustre: lnet: Replace sg++ with sg = sg_next(sg)Amitoj Kaur Chawla
With scatterlist chaining, simply incrementing the array does not work. sg_next macro was thus introduced to follow the chain links when necessary. So replace sg++ with sg_next. This change was made with the help of the following Coccinelle semantic patch: //<smpl> @@ struct scatterlist *sg; @@ -sg++ +sg = sg_next(sg) //</smpl> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-12staging: lustre: lnet: o2iblnd: Use list_for_each_entry_safeBhaktipriya Shridhar
Doubly linked lists which are iterated using list_empty and list_entry macros have been replaced with list_for_each_entry_safe macro. This makes the iteration simpler and more readable. This patch replaces the while loop containing list_empty and list_entry with list_for_each_entry_safe. This was done with Coccinelle. @@ expression E1; identifier I1, I2; type T; iterator name list_for_each_entry_safe; @@ T *I1; + T *tmp; ... - while (list_empty(&E1) == 0) + list_for_each_entry_safe (I1, tmp, &E1, I2) { ...when != T *I1; - I1 = list_entry(E1.next, T, I2); ... } Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-03staging: lustre: avoid intensive reconnecting for ko2iblndLiang Zhen
When there is a connection race between two nodes and one side of the connection is rejected by the other side. o2iblnd will reconnect immediately, this is going to generate a lot of trashes if: - race winner is slow and can't send out connecting request in short time. - remote side leaves a cmid in TIMEWAIT state, which will reject future connection requests To resolve this problem, this patch changed the reconnection behave: reconnection is submitted by connd only if a zombie connection is being destroyed and there is a pending reconnection request for the corresponding peer. Also, after a few rejections, reconnection will have a time interval between each attempt. Signed-off-by: Liang Zhen <liang.zhen@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7569 Reviewed-on: http://review.whamcloud.com/17892 Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com> Reviewed-by: James Simmons <uja.ornl@yahoo.com> Tested-by: James Simmons <uja.ornl@yahoo.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-03staging: lustre: check wr_id returned by ib_poll_cqLiang Zhen
If ib_poll_cq returned +ve without initialising ib_wc::wr_id (bug in driver), then o2iblnd will run into unpredictable situation because ib_wc::wr_id may refer to stale tx/rx pointer in stack. It indicates bug in HCA driver if this happened, ko2iblnd should output console error then close current connection. This patch could also be helpful for LU-5271 Signed-off-by: Liang Zhen <liang.zhen@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-519 Reviewed-on: http://review.whamcloud.com/12747 Reviewed-by: Isaac Huang <he.huang@intel.com> Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com> Reviewed-by: James Simmons <uja.ornl@yahoo.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-03staging: lustre: Change connect peer failed cleanup orderDoug Oucharek
A race condition has been found where connd is cleaning up failed connections, the peer ref counter goes to zero, but we stil have a connecting counter > 0. One possible race is when we are retrying a connection by calling kiblnd_connect_peer() which itself fails and decrements the peer ref counter and gets swapped out before it can decrement the connecting counter. connd swaps in and cleans up the connection where it sees a peer ref counter of 1 and a connecting counter of 1. This will trigger the assert seen in LU-7210 when it decrements the peer counter. The solution: be sure to decrement the connecting counter before decrementing the peer counter in the peer connect failure path. Signed-off-by: Doug Oucharek <doug.s.oucharek@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7210 Reviewed-on: http://review.whamcloud.com/17004 Reviewed-by: James Simmons <uja.ornl@yahoo.com> Reviewed-by: Amir Shehata <amir.shehata@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-03staging: lustre: take extra refcount in kiblnd_connreq_doneLiang Zhen
refcount taken by cmid is not reliable after kiblnd_connreq_done released the glock because this connection is visible to other threads, another thread can find and close this connection right after kiblnd_connreq_done released the glock, if kiblnd_cm_callback for RDMA_CM_EVENT_DISCONNECTED is called, it can release the connection refcount taken by cmid. It means the connection could be destroyed before kiblnd_connreq_done() finish operations on it. Signed-off-by: Liang Zhen <liang.zhen@intel.com> ntel-bug-id: https://jira.hpdd.intel.com/browse/LU-7210 Reviewed-on: http://review.whamcloud.com/17527 Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com> Reviewed-by: James Simmons <uja.ornl@yahoo.com> Tested-by: James Simmons <uja.ornl@yahoo.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-03staging: lustre: make ko2iblnd connect parameters persistentAmir Shehata
Store map-on-demand and peertx credits in the peer, since the peer is persistent. Also made sure that when assigning the parameters received on the connection to the peer structure through create, that if another peer is added before grabbing the lock we assign these parameters to it as well. Signed-off-by: Amir Shehata <amir.shehata@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3322 Reviewed-on: http://review.whamcloud.com/17074 Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com> Reviewed-by: James Simmons <uja.ornl@yahoo.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-03staging: lustre: Support different ko2iblnd configs between systemsJeremy Filizetti
This patch adds suppoort for ko2iblnd to have different values for peer_credits and map_on_demand between systems. Signed-off-by: Jeremy Filizetti <jeremy.filizetti@gmail.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3322 Reviewed-on: http://review.whamcloud.com/11794 Reviewed-by: Amir Shehata <amir.shehata@intel.com> Reviewed-by: James Simmons <uja.ornl@yahoo.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-02staging: lustre: change ibh_mrs from array to pointerAmir Shehata
With the removal of PMR we no longer require ibh_mrs field to be a array so change it to a simple pointer. Signed-off-by: Amir Shehata <amir.shehata@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6850 Reviewed-on: http://review.whamcloud.com/15788 Reviewed-by: James Simmons <uja.ornl@yahoo.com> Reviewed-by: Frank Zago <fzago@cray.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-02staging: lustre: make o2iblnd_cb.c local functions staticFrank Zago
This reduces the code size by about 1KiB. Signed-off-by: Frank Zago <fzago@cray.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5396 Reviewed-on: http://review.whamcloud.com/11256 Reviewed-by: Patrick Farrell <paf@cray.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-02staging: lustre: replace direct LNet HZ access with kernel APIsJian Yu
On some customers' systems, the kernel was compiled with HZ defined to 100, instead of 1000. This improves performance for HPC applications. However, to use these systems with Lustre, customers have to re-build Lustre for the kernel because Lustre directly uses the defined constant HZ. Since kernel 2.6.21, some non-HZ dependent timing APIs become non- inline functions, which can be used in Lustre codes to replace the direct HZ access. These kernel APIs include: jiffies_to_msecs() jiffies_to_usecs() jiffies_to_timespec() msecs_to_jiffies() usecs_to_jiffies() timespec_to_jiffies() And here are some samples of the replacement: HZ -> msecs_to_jiffies(MSEC_PER_SEC) n * HZ -> msecs_to_jiffies(n * MSEC_PER_SEC) HZ / n -> msecs_to_jiffies(MSEC_PER_SEC / n) n / HZ -> jiffies_to_msecs(n) / MSEC_PER_SEC n / HZ * 1000 -> jiffies_to_msecs(n) This patch replaces the direct HZ access in lnet module. Signed-off-by: Jian Yu <jian.yu@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5443 Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com> Reviewed-by: James Simmons <uja.ornl@gmail.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-02staging: lustre: lnet: Use list_entry() rather than container_of()Janani Ravichandran
Use list_entry() rather than container_of() for nodes of doubly linked lists. Semantic patch used: @a exists@ identifier var; struct list_head *ptr; @@ var = - container_of + list_entry (ptr, ...); Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-15staging: lustre: fix all conditional comparison to zero in LNet layerJames Simmons
Doing if (rc != 0) or if (rc == 0) is bad form. This patch corrects the LNet code to behavior according to kernel coding standards. Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-15staging: lustre: fix all NULL comparisons in LNet layerJames Simmons
This removes every instance of checking a variable against NULL in the LNet source code. Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-15staging: lustre: balance braces properly in LNet layerJames Simmons
Properly balance the braces done wrong as reported by checkpatch.pl. Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-15staging: lustre: don't set more than one variable per line in LNet layerJames Simmons
Cleanup all occurances of more than one variable being set per line as reported by checkpatch.pl. Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-15staging: lustre: add missing spaces for LNet layer reported by checkpatch.plJames Simmons
Add missing spaces in the code reported by checkpatch.pl. Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-15staging: lustre: remove unnecessary blank lines reported by checkpatch.plJames Simmons
Remove any useless blank lines reported by checkpatch.pl for LNet layer. Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-15staging: lustre: remove unnecessary parentheses around LNet function pointerJames Simmons
No need for the parentheses around any function pointer. Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-15staging: lustre: align all code properly for LNet coreJames Simmons
In several places in the LNet core the code doesn't align up properly. This resolves those checkpath issues. Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-15staging: lustre: format properly all comment blocks for LNet coreJames Simmons
In several places in the LNet core comment blocks don't follow the linux kernel style. This patch cleans those problems up. Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03staging: lustre: add sparse locking annotationsfrank zago
Adds __acquires / __releases / __must_hold sparse locking annotations to several functions. Fixes sparse warnings such as: libcfs/libcfs/hash.c:127:1: warning: context imbalance in 'cfs_hash_spin_lock' - wrong count at exit libcfs/libcfs/hash.c:133:1: warning: context imbalance in 'cfs_hash_spin_unlock' - unexpected unlock libcfs/libcfs/hash.c:141:9: warning: context imbalance in 'cfs_hash_rw_lock' - wrong count at exit include/linux/rwlock_api_smp.h:221:9: warning: context imbalance in 'cfs_hash_rw_unlock' - unexpected unlock Signed-off-by: frank zago <fzago@cray.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5396 Reviewed-on: http://review.whamcloud.com/11295 Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Patrick Farrell <paf@cray.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-21staging: lustre: update Intel copyright messages 2015Andreas Dilger
Update copyright messages in files modified by Intel employees in 2015 by non-trivial patches. Exclude patches that are only deleting code, renaming functions, or adding or removing whitespace. Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7243 Reviewed-on: http://review.whamcloud.com/16758 Reviewed-by: James Nunez <james.a.nunez@intel.com> Reviewed-by: James Simmons <uja.ornl@yahoo.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-07Merge tag 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma Pull rdma updates from Doug Ledford: "This is my initial round of 4.4 merge window patches. There are a few other things I wish to get in for 4.4 that aren't in this pull, as this represents what has gone through merge/build/run testing and not what is the last few items for which testing is not yet complete. - "Checksum offload support in user space" enablement - Misc cxgb4 fixes, add T6 support - Misc usnic fixes - 32 bit build warning fixes - Misc ocrdma fixes - Multicast loopback prevention extension - Extend the GID cache to store and return attributes of GIDs - Misc iSER updates - iSER clustering update - Network NameSpace support for rdma CM - Work Request cleanup series - New Memory Registration API" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma: (76 commits) IB/core, cma: Make __attribute_const__ declarations sparse-friendly IB/core: Remove old fast registration API IB/ipath: Remove fast registration from the code IB/hfi1: Remove fast registration from the code RDMA/nes: Remove old FRWR API IB/qib: Remove old FRWR API iw_cxgb4: Remove old FRWR API RDMA/cxgb3: Remove old FRWR API RDMA/ocrdma: Remove old FRWR API IB/mlx4: Remove old FRWR API support IB/mlx5: Remove old FRWR API support IB/srp: Dont allocate a page vector when using fast_reg IB/srp: Remove srp_finish_mapping IB/srp: Convert to new registration API IB/srp: Split srp_map_sg RDS/IW: Convert to new memory registration API svcrdma: Port to new memory registration API xprtrdma: Port to new memory registration API iser-target: Port to new memory registration API IB/iser: Port to new fast registration API ...
2015-10-17Staging: lustre: lnet: Remove unnecessary cast on void pointerShraddha Barke
void pointers do not need to be cast to other pointer types. The semantic patch used to find this: @r@ expression x; void* e; type T; identifier f; @@ ( *((T *)e) | ((T *)x)[...] | ((T *)x)->f | - (T *) e ) Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-13staging: lustre: remove multiple blank linesMike Rapoport
Fixes checkpatch.pl CHECK:LINE_SPACING: Please don't use multiple blank lines. The patch is generated using checkpatch.pl --fix-inplace: for f in $(find drivers/staging/lustre/ -type f) ; do ./scripts/checkpatch.pl --types "LINE_SPACING" --test-only=multiple \ --fix-inplace -f $f done Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>