RE: [PATCH V3 01/17] xprtrdma: mind the device's max fast register page list depth

2014-05-16 Thread Devesh Sharma
Chuck This patch is causing a CPU soft-lockup if underlying vendor reports devattr.max_fast_reg_pagr_list_len = 0 and ia-ri_memreg_strategy = FRMR (Default option). I think there is need to refer to device capability flags. If strategy = FRMR is forced and devattr.max_fast_reg_pagr_list_len=0

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

2014-05-16 Thread Bart Van Assche
Changes compared to version 2 of this patch series: * Converted explicit kobject() get calls into implicit calls by moving the kobj.parent assignments in front of the corresponding cdev_add() calls. Changes compared to version 1 of this patch series: * Folded the first patch into the second.

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

2014-05-16 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

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

2014-05-16 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

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

2014-05-16 Thread Yann Droneaud
Le vendredi 16 mai 2014 à 13:05 +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 by

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

2014-05-16 Thread Bart Van Assche
Changes compared to v2: - Reconnect to the SRP target if a local invalidation work request fails. - Swapped the state-next_fmr / next_fr assignments to improve code readability. - Clarified a comment in patch 1/9. - Fixed error handling in srp_create_target() (was broken in v2). - Added a

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

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

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

2014-05-16 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 v3 8/9] IB/srp: Rename FMR-related variables

2014-05-16 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

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

2014-05-16 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 v3 6/9] IB/srp: Introduce the 'register_always' kernel module parameter

2014-05-16 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 v3 5/9] IB/srp: Introduce srp_finish_mapping()

2014-05-16 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 v3 3/9] IB/srp: Introduce an additional local variable

2014-05-16 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

Re: [PATCH V3 01/17] xprtrdma: mind the device's max fast register page list depth

2014-05-16 Thread Steve Wise
I guess the client code doesn't verify that the device supports the chosen memreg mode. That's not good. Lemme fix this and respin this patch. On 5/16/2014 2:08 AM, Devesh Sharma wrote: Chuck This patch is causing a CPU soft-lockup if underlying vendor reports

Re: [PATCH V3 01/17] xprtrdma: mind the device's max fast register page list depth

2014-05-16 Thread Steve Wise
By the way, Devesh: Is the device advertising FRMR support, yet setting the max page list len to zero? That's a driver bug... On 5/16/2014 9:10 AM, Steve Wise wrote: I guess the client code doesn't verify that the device supports the chosen memreg mode. That's not good. Lemme fix this

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

2014-05-16 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 v3 7/9] IB/srp: One FMR pool per SRP connection

2014-05-16 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

Re: [PATCH V3 01/17] xprtrdma: mind the device's max fast register page list depth

2014-05-16 Thread Steve Wise
Looks like ocrdma does this. See ocrdma_query_device(). It advertises IB_DEVICE_MEM_MGT_EXTENSIONS but sets max_fast_reg_page_list_len to 0. The Verbs spec sez if you advertise the mem extensions, then you need to support all of them. Is this just a bug in the driver? Or does it really

[PATCH] iw_cxgb4: fix vlan support

2014-05-16 Thread Steve Wise
RDMA connections over a vlan interface don't work due to import_ep() not using the correct egress device. - use the real device in import_ep() - use rdma_vlan_dev_real_dev() in get_real_dev(). Signed-off-by: Steve Wise sw...@opengridcomputing.com --- drivers/infiniband/hw/cxgb4/cm.c | 17

[PATCH] drivers: net: ethernet: mellanox: mlx4: let mlx4 depend on SMP

2014-05-16 Thread Chen Gang
'struct irq_affinity_notify' and the related functions are only defined when SMP enabled, so at present, mlx4 has to only run under SMP. The related error (allmodconfig under unicore32): CC [M] drivers/net/ethernet/mellanox/mlx4/eq.o drivers/net/ethernet/mellanox/mlx4/eq.c:58: error:

Re: [PATCH] drivers: net: ethernet: mellanox: mlx4: let mlx4 depend on SMP

2014-05-16 Thread David Miller
From: Chen Gang gang.chen.5...@gmail.com Date: Sat, 17 May 2014 13:26:16 +0800 'struct irq_affinity_notify' and the related functions are only defined when SMP enabled, so at present, mlx4 has to only run under SMP. The related error (allmodconfig under unicore32): Making the entire driver

Re: [PATCH] drivers: net: ethernet: mellanox: mlx4: let mlx4 depend on SMP

2014-05-16 Thread Chen Gang
On 05/17/2014 01:36 PM, David Miller wrote: From: Chen Gang gang.chen.5...@gmail.com Date: Sat, 17 May 2014 13:26:16 +0800 'struct irq_affinity_notify' and the related functions are only defined when SMP enabled, so at present, mlx4 has to only run under SMP. The related error