[PATCH v2 2/2] IB/umad: Fix a use-after-free

2014-05-13 Thread Bart Van Assche
Avoid that closing /dev/infiniband/umadn or /dev/infiniband/issmn triggers a use-after-free. __fput() in fs/file_table.c invokes f_op-release() before it invokes cdev_put(). Make sure that the ib_umad_device structure is freed by the cdev_put() call instead of f_op-release(). This avoids that

[PATCH v2 0/2] Fix a use-after-free in ib_umad

2014-05-13 Thread Bart Van Assche
Changes compared to version 1 of this patch series: * Folded the first patch into the second. * Implemented Yann's suggestion to drop the test of ret in the non-error path of ib_umad_sm_open(). * Simplified the implementation of ib_umad_open() and ib_umad_sm_open() further. This patch series

[PATCH v2 1/2] IB/umad: Fix error handling

2014-05-13 Thread Bart Van Assche
Avoid leaking a kref count in ib_umad_open() if port-ib_dev == NULL or if nonseekable_open() fails. Avoid leaking a kref count, that sm_sem is kept down and also that the IB_PORT_SM capability mask is not cleared in ib_umad_sm_open() if nonseekable_open() fails. Since container_of() never returns

Re: [PATCH v1 for-next 0/3] IB: Use GFP_NOIO calls in IPoIB connected mode TX path

2014-05-13 Thread Jiri Kosina
On Sun, 11 May 2014, Or Gerlitz wrote: This series is a refactored form of the one posted by Jiri Kosina to LKML and netdev according to the discussion that followed and the guidelines you provided here https://lkml.org/lkml/2014/3/5/250 Basically, the functionality changes introduced by

Re: [PATCH libibverbs V3 3/3] Add ibv_query_port_ex support

2014-05-13 Thread Doug Ledford
- Original Message - BTW, before I forget, the patch that introduces the API must also include a man page for it. Jason, care to send a patch for the README or whatever with the rules? :) README.Extensions_API_and_Guidelines ? I wouldn't bury it in the generic README, people

[PATCH v2 0/9] SRP initiator patches for kernel 3.16

2014-05-13 Thread Bart Van Assche
Changes compared to v1: - Modified the FMR code such that one FMR pool is allocated per connection instead of one pool per HCA. - Dropped the patch Make srp_alloc_req_data() reallocate request data. - Moved introduction of the register_always kernel module parameter into a separate patch. -

[PATCH v2 1/9] IB/srp: Fix a sporadic crash triggered by cable pulling

2014-05-13 Thread Bart Van Assche
Avoid that srp_finish_req() can encounter a pointer to a SCSI command in req-scmnd that is no longer associated with that request. If the function srp_finish_req() is invoked twice for a SCSI command that is not in flight then that would cause srp_unmap_data() to try to invoke ib_fmr_pool_unmap()

[PATCH v2 2/9] IB/srp: Fix kernel-doc warnings

2014-05-13 Thread Bart Van Assche
Avoid that the kernel-doc tool warns about missing argument descriptions for the ib_srp.[ch] source files. Signed-off-by: Bart Van Assche bvanass...@acm.org Reviewed-by: Sagi Grimberg sa...@mellanox.com Cc: Roland Dreier rol...@purestorage.com Cc: David Dillow d...@thedillows.org Cc: Vu Pham

[PATCH v2 4/9] IB/srp: Introduce srp_map_fmr()

2014-05-13 Thread Bart Van Assche
This patch does not change any functionality. Signed-off-by: Bart Van Assche bvanass...@acm.org Reviewed-by: Sagi Grimberg sa...@mellanox.com Cc: Roland Dreier rol...@purestorage.com Cc: David Dillow d...@thedillows.org Cc: Vu Pham v...@mellanox.com Cc: Sebastian Parschauer

[PATCH v2 5/9] IB/srp: Introduce srp_finish_mapping()

2014-05-13 Thread Bart Van Assche
This patch does not change any functionality. Signed-off-by: Bart Van Assche bvanass...@acm.org Cc: Roland Dreier rol...@purestorage.com Cc: David Dillow d...@thedillows.org Cc: Sagi Grimberg sa...@mellanox.com Cc: Vu Pham v...@mellanox.com Cc: Sebastian Parschauer

[PATCH v2 6/9] IB/srp: Introduce the 'register_always' kernel module parameter

2014-05-13 Thread Bart Van Assche
Add a kernel module parameter that enables memory registration also for SG-lists that can be processed without memory registration. This makes it easier for kernel developers to test the memory registration code. Signed-off-by: Bart Van Assche bvanass...@acm.org Cc: Roland Dreier

[PATCH v2 7/9] IB/srp: One FMR pool per SRP connection

2014-05-13 Thread Bart Van Assche
Allocate one FMR pool per SRP connection instead of one SRP pool per HCA. This improves scalability of the SRP initiator. Only request the SCSI mid-layer to retry a SCSI command after a temporary mapping failure (-ENOMEM) but not after a permanent mapping failure. This avoids that SCSI commands

[PATCH v2 9/9] IB/srp: Add fast registration support

2014-05-13 Thread Bart Van Assche
Certain HCA types (e.g. Connect-IB) and certain configurations (e.g. ConnectX VF) support fast registration but not FMR. Hence add fast registration support. In function srp_rport_reconnect(), move the the srp_finish_req() loop from after to before the srp_create_target_ib() call. This is needed

[PATCH v2 8/9] IB/srp: Rename FMR-related variables

2014-05-13 Thread Bart Van Assche
The next patch will cause the renamed variables to be shared between the code for FMR and for FR memory registration. Make the names of these variables independent of the memory registration mode. This patch does not change any functionality. The start of this patch was the changes applied via the

Re: [PATCH] IB: allows build of hw/ and ulp/ subdirectory independently

2014-05-13 Thread Bart Van Assche
On 03/27/14 12:10, Yann Droneaud wrote: It is not possible to build only drivers/infiniband/hw/ (and ulp/) subdirectory with command such as: $ make ARCH=x86_64 O=./obj-x86_64/ drivers/infiniband/hw/ This fails with following error messages: make[2]: Nothing to be done for

Re: [PATCH v2 9/9] IB/srp: Add fast registration support

2014-05-13 Thread Sagi Grimberg
On 5/13/2014 5:44 PM, Bart Van Assche wrote: Certain HCA types (e.g. Connect-IB) and certain configurations (e.g. ConnectX VF) support fast registration but not FMR. Hence add fast registration support. In function srp_rport_reconnect(), move the the srp_finish_req() loop from after to before

Re: Soft lockup in unloading kernel modules

2014-05-13 Thread Klemens Senn
Hi Anna, today I retried unloading the kernel modules with your updated kernel and additionally I tried the nfsd-next kernel from J. Bruce Fields and Chuck's nfs-rdma-client kernel. In short: None of these was able to unload the kernel modules with an active connection. In detail: With your

Re: [PATCH v2 0/9] SRP initiator patches for kernel 3.16

2014-05-13 Thread Sagi Grimberg
On 5/13/2014 5:38 PM, Bart Van Assche wrote: Changes compared to v1: - Modified the FMR code such that one FMR pool is allocated per connection instead of one pool per HCA. - Dropped the patch Make srp_alloc_req_data() reallocate request data. - Moved introduction of the register_always

Re: [PATCH v2 2/2] IB/umad: Fix a use-after-free

2014-05-13 Thread Yann Droneaud
Hi, Le mardi 13 mai 2014 à 12:31 +0200, Bart Van Assche a écrit : Avoid that closing /dev/infiniband/umadn or /dev/infiniband/issmn triggers a use-after-free. __fput() in fs/file_table.c invokes f_op-release() before it invokes cdev_put(). Make sure that the ib_umad_device structure is freed

Re: [PATCH V2 RFC 2/3] svcrdma: Recvfrom changes

2014-05-13 Thread Chuck Lever
Hi Steve- Some random review comments, see below. On May 6, 2014, at 1:46 PM, Steve Wise sw...@opengridcomputing.com wrote: From: Tom Tucker t...@opengridcomputing.com Based on device support, RDMA read target sgls are fast-registered, or composed using the local dma lkey or a dma_mr

Re: [PATCH libibverbs V3 3/3] Add ibv_query_port_ex support

2014-05-13 Thread Jason Gunthorpe
On Tue, May 13, 2014 at 09:18:01AM -0400, Doug Ledford wrote: BTW, before I forget, the patch that introduces the API must also include a man page for it. Jason, care to send a patch for the README or whatever with the rules? :) README.Extensions_API_and_Guidelines ? I wouldn't

RE: [PATCH V2 RFC 2/3] svcrdma: Recvfrom changes

2014-05-13 Thread Steve Wise
-Original Message- From: Chuck Lever [mailto:chuckle...@gmail.com] Sent: Tuesday, May 13, 2014 1:22 PM To: Steve Wise Cc: J. Bruce Fields; Linux NFS Mailing List; linux-rdma@vger.kernel.org; Tom Tucker Subject: Re: [PATCH V2 RFC 2/3] svcrdma: Recvfrom changes Hi Steve- Some

Re: [PATCH] [resend] net: get rid of SET_ETHTOOL_OPS

2014-05-13 Thread David Miller
From: Wilfried Klaebe w-l...@lebenslange-mailadresse.de Date: Sun, 11 May 2014 00:12:32 + net: get rid of SET_ETHTOOL_OPS Dave Miller mentioned he'd like to see SET_ETHTOOL_OPS gone. This does that. Mostly done via coccinelle script: @@ struct ethtool_ops *ops; struct net_device

Re: [PATCH V2 RFC 2/3] svcrdma: Recvfrom changes

2014-05-13 Thread Chuck Lever
On May 13, 2014, at 4:37 PM, Steve Wise sw...@opengridcomputing.com wrote: -Original Message- From: Chuck Lever [mailto:chuckle...@gmail.com] Sent: Tuesday, May 13, 2014 1:22 PM To: Steve Wise Cc: J. Bruce Fields; Linux NFS Mailing List; linux-rdma@vger.kernel.org; Tom Tucker