Re: [PATCH 11/15] IB/srpt: Fix how aborted commands are processed

2016-01-06 Thread Bart Van Assche
On 01/06/2016 06:13 AM, Christoph Hellwig wrote: pr_debug("Aborting cmd with state %d and tag %lld\n", state, ioctx->cmd.tag); @@ -1299,14 +1291,16 @@ static int srpt_abort_cmd(struct srpt_send_ioctx *ioctx) case SRPT_STATE_NEW: case SRPT_STATE_DATA_IN:

Re: [PATCH 13/15] IB/srpt: Detect session shutdown reliably

2016-01-06 Thread Bart Van Assche
On 01/06/2016 06:21 AM, Christoph Hellwig wrote: On Tue, Jan 05, 2016 at 03:26:49PM +0100, Bart Van Assche wrote: The Last WQE Reached event is only generated after one or more work requests have been queued on the QP associated with a session. Since session shutdown can start before any work

Re: [PATCH 13/15] IB/srpt: Detect session shutdown reliably

2016-01-06 Thread Bart Van Assche
On 01/06/2016 03:39 PM, Sagi Grimberg wrote: On 05/01/2016 16:26, Bart Van Assche wrote: The Last WQE Reached event is only generated after one or more work requests have been queued on the QP associated with a session. Since session shutdown can start before any work requests have been queued

Re: [PATCH 10/15] IB/srpt: Fix srpt_handle_cmd() error paths

2016-01-06 Thread Bart Van Assche
On 01/06/2016 03:31 PM, Sagi Grimberg wrote: On 05/01/2016 16:25, Bart Van Assche wrote: @@ -1518,8 +1517,7 @@ static int srpt_handle_cmd(struct srpt_rdma_ch *ch, if (srpt_get_desc_tbl(send_ioctx, srp_cmd, , _len)) { pr_err("0x%llx: parsing SRP descriptor table fail

[PATCH 06/15] IB/srpt: Simplify srpt_handle_tsk_mgmt()

2016-01-05 Thread Bart Van Assche
Let the target core check task existence instead of the SRP target driver. Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Cc: Christoph Hellwig <h...@lst.de> --- drivers/infiniband/ulp/srpt/ib_srpt.c | 54 ++- 1 file changed, 2 inser

[PATCH 07/15] IB/srpt: Simplify channel state management

2016-01-05 Thread Bart Van Assche
The only allowed channel state changes are those that change the channel state into a state with a higher numerical value. This allows to merge the functions srpt_set_ch_state() and srpt_test_and_set_ch_state() into a single function. Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com&

[PATCH 08/15] IB/srpt: Simplify srpt_shutdown_session()

2016-01-05 Thread Bart Van Assche
target_wait_for_sess_cmds() by moving it into srpt_release_channel_work(). Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Cc: Christoph Hellwig <h...@lst.de> --- drivers/infiniband/ulp/srpt/ib_srpt.c | 14 +- drivers/infiniband/ulp/srpt/ib_srpt.h | 1 - 2 files changed, 1 inse

[PATCH 01/15] IB/srpt: Add parentheses around sizeof argument

2016-01-05 Thread Bart Van Assche
's/sizeof \([^ );,]*\)/sizeof(\1)/g' drivers/infiniband/ulp/srpt/*.[ch] Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Cc: Christoph Hellwig <h...@lst.de> --- drivers/infiniband/ulp/srpt/ib_srpt.c | 42 +-- 1 file changed, 21 insertions(+),

[PATCH 02/15] IB/srpt: Inline srpt_sdev_name()

2016-01-05 Thread Bart Van Assche
srpt_sdev_name() is too trivial to keep it as a separate function. Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Cc: Christoph Hellwig <h...@lst.de> --- drivers/infiniband/ulp/srpt/ib_srpt.c | 14 ++ 1 file changed, 2 insertions(+), 12 deletions(-) diff --g

[PATCH 15/15] IB/srpt: Fix a rare crash in srpt_close_session()

2016-01-05 Thread Bart Van Assche
Keep the ib_srpt session as long as srpt_close_session() may access it. Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Cc: Christoph Hellwig <h...@lst.de> --- drivers/infiniband/ulp/srpt/ib_srpt.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/infinib

[PATCH 11/15] IB/srpt: Fix how aborted commands are processed

2016-01-05 Thread Bart Van Assche
read fails the corresponding SCSI command must fail. Hence add a transport_generic_request_failure() call. Remove an incorrect srpt_abort_cmd() call from srpt_rdma_write_done(). Avoid that srpt_send_done() calls srpt_abort_cmd() for finished SCSI commands. Signed-off-by: Bart Van Assche

[PATCH 12/15] IB/srpt: Eliminate srpt_find_channel()

2016-01-05 Thread Bart Van Assche
In the CM REQ message handler, store the channel pointer in cm_id->context such that the function srpt_find_channel() is no longer needed. Additionally, make the CM event messages more informative. Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Cc: Christoph Hellwig <

[PATCH 10/15] IB/srpt: Fix srpt_handle_cmd() error paths

2016-01-05 Thread Bart Van Assche
The target core function that should be called if target_submit_cmd() fails is target_put_sess_cmd(). Additionally, change the return type of srpt_handle_cmd() from int into void. Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Cc: Christoph Hellwig <h...@lst.de>

[PATCH 09/15] IB/srpt: Fix srpt_close_session()

2016-01-05 Thread Bart Van Assche
Avoid that srpt_close_session() waits if it doesn't have to wait. Additionally, increase the time during which srpt_close_session() waits until closing a session has finished. This makes it easier to detect session shutdown bugs. Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com&

[PATCH 03/15] IB/srpt: Inline srpt_get_ch_state()

2016-01-05 Thread Bart Van Assche
The callers of srpt_get_ch_state() can access ch->state safely without using locking. Hence inline this function. Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Cc: Christoph Hellwig <h...@lst.de> --- drivers/infiniband/ulp/srpt/ib_srpt.c | 42 ++-

[PATCH 13/15] IB/srpt: Detect session shutdown reliably

2016-01-05 Thread Bart Van Assche
The Last WQE Reached event is only generated after one or more work requests have been queued on the QP associated with a session. Since session shutdown can start before any work requests have been queued, use a zero-length RDMA write to wait until a QP has been drained. Signed-off-by: Bart Van

[PATCH 14/15] IB/srpt: Fix srpt_write_pending()

2016-01-05 Thread Bart Van Assche
-by: Bart Van Assche <bart.vanass...@sandisk.com> Cc: Christoph Hellwig <h...@lst.de> --- drivers/infiniband/ulp/srpt/ib_srpt.c | 33 - 1 file changed, 4 insertions(+), 29 deletions(-) diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infinib

[PATCH 04/15] IB/srpt: Introduce target_reverse_dma_direction()

2016-01-05 Thread Bart Van Assche
Use the function target_reverse_dma_direction() instead of reimplementing it. Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Cc: Christoph Hellwig <h...@lst.de> --- drivers/infiniband/ulp/srpt/ib_srpt.c | 17 ++--- 1 file changed, 2 insertions(+), 15 deleti

[PATCH 05/15] IB/srpt: Use scsilun_to_int()

2016-01-05 Thread Bart Van Assche
Just like other target drivers, use scsilun_to_int() to unpack SCSI LUN numbers. This patch only changes the behavior of ib_srpt for LUN numbers >= 16384. Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Cc: Christoph Hellwig <h...@lst.de> --- drivers/infiniband/ulp

[PATCH 00/15] Various ib_srpt patches

2016-01-05 Thread Bart Van Assche
The following series of patches is what I came up with while testing the most recent version of my SCSI target patch series (see also http://thread.gmane.org/gmane.linux.scsi.target.devel/10905): 0001-IB-srpt-Add-parentheses-around-sizeof-argument.patch 0002-IB-srpt-Inline-srpt_sdev_name.patch

Re: [PATCH] IB/sysfs: Fix sparse warning on attr_id

2016-01-04 Thread Bart Van Assche
On 01/04/2016 04:44 AM, ira.we...@intel.com wrote: From: Ira Weiny <ira.we...@intel.com> Attributed ID was declared as an int while the value should really be big endian 16. Fixes: 35c4cbb17811 ("IB/core: Create get_perf_mad function in sysfs.c") Reported-by: Bart Van Ass

Re: [PATCH 3/3] IB/srpt: Fix a race condition related to SRP login

2016-01-03 Thread Bart Van Assche
On 01/03/2016 12:25 PM, Sagi Grimberg wrote: But now the first I/O(s) could be lost if no other I/O comes in, right? I suspect that we need to keep this loop to protect against such corner cases. It can happen theoretically, but why do we even bother? Why not just post the recv buffer after

[PATCH] IB/cm: Fix a recently introduced deadlock

2016-01-01 Thread Bart Van Assche
ue work to a device that's going away") Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Cc: Erez Shitrit <ere...@mellanox.com> Cc: stable <sta...@vger.kernel.org> --- drivers/infiniband/core/cm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff -

Re: git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma.git/k.o/for-4.5 crash during boot

2015-12-31 Thread Bart Van Assche
On 12/30/2015 01:34 PM, Leon Romanovsky wrote: On Wed, Dec 30, 2015 at 02:22:23PM +0200, Or Gerlitz wrote: On 12/30/2015 2:04 PM, Bart Van Assche wrote: Hello Christoph, Can you check whether the branch in the subject of this e-mail works fine on your setup (commit 59caaed7a7) ? On my test

[PATCH 1/3] irq_poll: Fix irq_poll_sched()

2015-12-31 Thread Bart Van Assche
The IRQ_POLL_F_SCHED bit is set as long as polling is ongoing. This means that irq_poll_sched() must proceed if this bit has not yet been set. Fixes: commit ea51190c0315 ("irq_poll: fold irq_poll_sched_prep into irq_poll_sched"). Signed-off-by: Bart Van Assche <bart.vanass..

[PATCH 0/3] Three SRP driver patches for kernel 4.5

2015-12-31 Thread Bart Van Assche
Hello Doug, This series of three patches fixes new issues that exist in the git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma.git/k.o/for-4.5 branch. It would be appreciated if these patches could be included in the kernel 4.5 RDMA pull request.

[PATCH 2/3] IB/srpt: Fix the RDMA completion handlers

2015-12-31 Thread Bart Van Assche
[ib_srpt] [] __ib_process_cq+0x43/0xc0 [ib_core] [] ib_cq_poll_work+0x25/0x70 [ib_core] [] process_one_work+0x1bd/0x460 [] worker_thread+0x118/0x420 [] kthread+0xe4/0x100 [] ret_from_fork+0x3f/0x70 Fixes: commit 59fae4deaad3 ("IB/srpt: chain RDMA READ/WRITE requests"). Signed-off-by

[PATCH 3/3] IB/srpt: Fix a race condition related to SRP login

2015-12-31 Thread Bart Van Assche
ntext than IB WC processing, remove the wait list processing code from the RTU handler. Fixes: commit a42d985bd5b2 ("ib_srpt: Initial SRP Target merge for v3.3-rc1"). Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Cc: Christoph Hellwig <h...@lst.de> --- driver

Re: [PATCH] IB/core: Allocating larger memory than required for cma_configfs

2015-12-30 Thread Bart Van Assche
On 12/30/2015 03:14 PM, Matan Barak wrote: We were allocating larger memory space than requried for cma_dev_group->default_ports_group. Please change the subject into something like "Do not allocate more ...". Please also fix the spelling error in the patch description. Thanks, Bart. -- To

git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma.git/k.o/for-4.5 crash during boot

2015-12-30 Thread Bart Van Assche
Hello Christoph, Can you check whether the branch in the subject of this e-mail works fine on your setup (commit 59caaed7a7) ? On my test setup (Dell R430 with two ConnectX-3 adapters) this branch crashes during boot in get_counter_table() (see also the attached screenshot). Thanks, Bart.

Re: [PATCH for-next 2/3] IB/core: Change per-entry lock in RoCE GID table to one lock

2015-12-29 Thread Bart Van Assche
On 12/30/2015 07:01 AM, Or Gerlitz wrote: On 10/28/2015 4:52 PM, Matan Barak wrote: @@ -134,16 +138,14 @@ static int write_gid(struct ib_device *ib_dev, u8 port, { int ret = 0; struct net_device *old_net_dev; -unsigned long flags; /* in rdma_cap_roce_gid_table, this

Re: completion queue abstraction V2

2015-12-29 Thread Bart Van Assche
On 12/07/2015 09:51 PM, Christoph Hellwig wrote: This series adds a new RDMA core abstraction that insulated the ULPs from the nitty gritty details of CQ polling. See the individual patches for more details. Hello Christoph, After having tested the SRP initiator and target drivers with this

Re: [PATCH 03/13] irq_poll: fold irq_poll_sched_prep into irq_poll_sched

2015-12-29 Thread Bart Van Assche
On 12/07/2015 09:51 PM, Christoph Hellwig wrote: diff --git a/lib/irq_poll.c b/lib/irq_poll.c index 88af879..13cb149 100644 --- a/lib/irq_poll.c +++ b/lib/irq_poll.c @@ -21,13 +21,17 @@ static DEFINE_PER_CPU(struct list_head, blk_cpu_iopoll); * * Description: * Add this irq_poll

Re: [PATCH 08/13] IB/srpt: chain RDMA READ/WRITE requests

2015-12-29 Thread Bart Van Assche
On 12/07/2015 09:51 PM, Christoph Hellwig wrote: > Remove struct rdma_iu and instead allocate the struct ib_rdma_wr array > early and fill out directly. This allows us to chain the WRs, and thus > archive both less lock contention on the HCA workqueue as well as much > simpler error handling.

[PATCH] IB/core: Remove a set-but-not-used variable from ib_sg_to_pages()

2015-12-29 Thread Bart Van Assche
Detected this by building the IB core with W=1. See also patch "IB core: Fix ib_sg_to_pages()" (commit 8f5ba10ed40a). Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Cc: Sagi Grimberg <sa...@mellanox.com> Cc: Christoph Hellwig <h...@lst.de> --- drivers

Re: [PATCH 10/10] IB: remove the unused usecnt field from struct ib_mr

2015-12-18 Thread Bart Van Assche
On 12/18/2015 02:55 PM, Christoph Hellwig wrote: Signed-off-by: Christoph Hellwig <h...@lst.de> Shouldn't the description of this patch be changed into something like "Remove the usecnt field from ib_mr since it is always zero" ? Anyway: Reviewed-by: Bart Van Assche <bva

Re: [PATCH rdma-next V1 3/7] IB/ulps: Avoid calling ib_query_device

2015-12-18 Thread Bart Van Assche
On 12/18/2015 09:59 AM, Or Gerlitz wrote: Instead, use the cached copy of the attributes present on the device. Signed-off-by: Or Gerlitz --- drivers/infiniband/ulp/ipoib/ipoib_cm.c | 19 --- drivers/infiniband/ulp/ipoib/ipoib_ethtool.c | 14 +++--

Re: [PATCH rdma-next V1 0/7] dev attr cleanup (less is more)

2015-12-18 Thread Bart Van Assche
On 12/18/2015 09:59 AM, Or Gerlitz wrote: OK, Doug, this is my suggestion for the dev attr cleanup -- it has the advantages of leaving the attrs on a well defined location, a field in the IB device, the ability to get that through smaller patches, avoid touching any of the HW drivers, etc.

Re: [PATCH rdma-next 1/6] IB/core: Save the device attributes on the device structure

2015-12-17 Thread Bart Van Assche
On 12/17/2015 06:41 PM, Jason Gunthorpe wrote: On Thu, Dec 17, 2015 at 03:44:19PM +0200, Sagi Grimberg wrote: + ret = ib_query_device(device, >attrs); + if (ret) { + printk(KERN_WARNING "Couldn't query the device attributes\n"); + goto out; + } +

Re: [PATCH 06/13] irq_poll: remove unused data and max fields

2015-12-10 Thread Bart Van Assche
On 12/07/2015 12:51 PM, Christoph Hellwig wrote: [ ... ] Reviewed-by: Bart Van Assche <bart.vanass...@sandisk.com> -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majord...@vger.kernel.org More majordomo info at http:/

Re: [PATCH 09/13] IB/srpt: use the new CQ API

2015-12-10 Thread Bart Van Assche
On 12/07/2015 12:51 PM, Christoph Hellwig wrote: [ ... ] Reviewed-by: Bart Van Assche <bart.vanass...@sandisk.com> -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majord...@vger.kernel.org More majordomo info at http:/

Re: [PATCH 02/13] irq_poll: don't disable new irq_poll instances

2015-12-10 Thread Bart Van Assche
On 12/07/2015 12:51 PM, Christoph Hellwig wrote: There is no good reason to start out disabled - drivers can control if the poll instance can be scheduled by simply not scheduling it yet. Reviewed-by: Bart Van Assche <bart.vanass...@sandisk.com> -- To unsubscribe from this list: send th

Re: [PATCH 05/13] irq_poll: mark __irq_poll_complete static

2015-12-10 Thread Bart Van Assche
On 12/07/2015 12:51 PM, Christoph Hellwig wrote: [ ... ] Reviewed-by: Bart Van Assche <bart.vanass...@sandisk.com> -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majord...@vger.kernel.org More majordomo info at http:/

Re: [PATCH 04/13] irq_poll: fold irq_poll_disable_pending into irq_poll_softirq

2015-12-10 Thread Bart Van Assche
On 12/07/2015 12:51 PM, Christoph Hellwig wrote: > [ ... ] Reviewed-by: Bart Van Assche <bart.vanass...@sandisk.com> -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majord...@vger.kernel.org More majordomo info at htt

Re: [PATCH 03/13] irq_poll: fold irq_poll_sched_prep into irq_poll_sched

2015-12-10 Thread Bart Van Assche
addressed: Reviewed-by: Bart Van Assche <bart.vanass...@sandisk.com> -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 10/13] IB/srp: use the new CQ API

2015-12-10 Thread Bart Van Assche
On 12/07/2015 12:51 PM, Christoph Hellwig wrote: +static void srp_send_done(struct ib_cq *cq, struct ib_wc *wc) +{ + struct srp_iu *iu = container_of(wc->wr_cqe, struct srp_iu, cqe); + struct srp_rdma_ch *ch = cq->cq_context; + + if (likely(wc->status != IB_WC_SUCCESS)) { +

Re: [PATCH 07/13] IB: add a proper completion queue abstraction

2015-12-10 Thread Bart Van Assche
On 12/07/2015 12:51 PM, Christoph Hellwig wrote: This adds an abstraction that allows ULP to simply pass a completion ^^^ I think this should either be changed into either "an ULP" or "ULPs". +/** + * ib_process_direct_cq - process a CQ in caller

Re: [PATCH 01/13] irq_poll: make blk-iopoll available outside the block layer

2015-12-10 Thread Bart Van Assche
in the original code but no longer in the new code. Whether or not this gets addressed: Reviewed-by: Bart Van Assche <bart.vanass...@sandisk.com> -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majord...@vger.kernel.org Mor

Re: [PATCH 08/13] IB/srpt: chain RDMA READ/WRITE requests

2015-12-10 Thread Bart Van Assche
On 12/07/2015 12:51 PM, Christoph Hellwig wrote: Remove struct rdma_iu and instead allocate the struct ib_rdma_wr array early and fill out directly. This allows us to chain the WRs, and thus archive both less lock contention on the HCA workqueue as well as much ^^^ Did you perhaps

Re: [PATCH 0/6] SRP initiator related bug fixes

2015-12-07 Thread Bart Van Assche
On 12/05/2015 03:17 AM, Christoph Hellwig wrote: Hi Bart, On Fri, Dec 04, 2015 at 03:08:15PM -0800, Bart Van Assche wrote: While preparing this patch series I noticed that none of the SCSI RDMA initiator drivers syncs RDMA buffers before performing RDMA. Does anyone know why something like

Re: [PATCH 0/6] SRP initiator related bug fixes

2015-12-07 Thread Bart Van Assche
On 12/01/2015 10:16 AM, Bart Van Assche wrote: This patch series contains six bug fixes either for the SRP initiator itself or for IB core functionality used by the SRP initiator. The order of these patches matches the order in which the corresponding bugs have been introduced. The patches

Re: [PATCH 0/6] SRP initiator related bug fixes

2015-12-07 Thread Bart Van Assche
On 12/07/2015 01:07 PM, Doug Ledford wrote: On 12/07/2015 02:26 PM, Bart Van Assche wrote: On 12/01/2015 10:16 AM, Bart Van Assche wrote: This patch series contains six bug fixes either for the SRP initiator itself or for IB core functionality used by the SRP initiator. The order

Re: [PATCH 0/6] SRP initiator related bug fixes

2015-12-04 Thread Bart Van Assche
On 12/01/2015 10:16 AM, Bart Van Assche wrote: > [ ... ] Hello, While preparing this patch series I noticed that none of the SCSI RDMA initiator drivers syncs RDMA buffers before performing RDMA. Does anyone know why something like the code below is not present in these drivers and

Re: [PATCH 5/6] IB core: Fix ib_sg_to_pages()

2015-12-03 Thread Bart Van Assche
On 12/03/2015 01:18 AM, Christoph Hellwig wrote: > The patch looks good to me, but while we touch this area, how about > throwing in a few cosmetic fixes as well? How about the patch below ? In that version of the ib_sg_to_pages() fix these concerns have been addressed and additionally to more

Re: [PATCH 5/6] IB core: Fix ib_sg_to_pages()

2015-12-02 Thread Bart Van Assche
On 12/02/2015 01:31 AM, Sagi Grimberg wrote: > On 01/12/2015 21:10, Bart Van Assche wrote: >> On 12/01/2015 10:32 AM, Sagi Grimberg wrote: >> How ib_sg_to_pages() reports to its caller that mapping the first >> scatterlist element failed is not important to me. I in

[PATCH 6/6] IB/srp: Fix srp_map_sg_fr()

2015-12-01 Thread Bart Van Assche
After dma_map_sg() has been called the return value of that function must be used as the number of elements in the scatterlist instead of scsi_sg_count(). Fixes: commit f7f7aab1a5c0 ("IB/srp: Convert to new registration API") Reported-by: Christoph Hellwig <h...@lst.de> Signed-

[PATCH 0/6] SRP initiator related bug fixes

2015-12-01 Thread Bart Van Assche
This patch series contains six bug fixes either for the SRP initiator itself or for IB core functionality used by the SRP initiator. The order of these patches matches the order in which the corresponding bugs have been introduced. The patches in this series are:

[PATCH 5/6] IB core: Fix ib_sg_to_pages()

2015-12-01 Thread Bart Van Assche
returns a negative error code instead of zero if the first set_page() call fails. Fixes: commit 4c67e2bfc8b7 ("IB/core: Introduce new fast registration API") Reported-by: Christoph Hellwig <h...@lst.de> Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Cc: stable &

[PATCH 3/6] IB/srp: Initialize dma_length in srp_map_idb

2015-12-01 Thread Bart Van Assche
From: Christoph Hellwig Without this sg_dma_len will return 0 on architectures tha have the dma_length field. Fixes: commit f7f7aab1a5c0 ("IB/srp: Convert to new registration API") Signed-off-by: Christoph Hellwig --- drivers/infiniband/ulp/srp/ib_srp.c | 3 +++ 1

[PATCH 4/6] IB/srp: Fix indirect data buffer rkey endianness

2015-12-01 Thread Bart Van Assche
Detected by sparse. Fixes: commit 330179f2fa93 ("IB/srp: Register the indirect data buffer descriptor") Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Cc: stable <sta...@vger.kernel.org> # v4.3+ Cc: Sagi Grimberg <sa...@mellanox.com> Cc: Christoph Hellwig

[PATCH 1/6] IB/srp: Fix a memory leak

2015-12-01 Thread Bart Van Assche
ite+0x54/0xc0 [] entry_SYSCALL_64_fastpath+0x12/0x6f Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Reviewed-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Sagi Grimberg <sa...@mellanox.com> Cc: Sebastian Parschauer <sebastian.rie...@profitbricks.com> Cc: stable <sta...@

[PATCH 2/6] IB/srp: Fix possible send queue overflow

2015-12-01 Thread Bart Van Assche
From: Sagi Grimberg When using work request based memory registration (fast_reg) we must reserve SQ entries for registration and invalidation in addition to send operations. Each IO consumes 3 SQ entries (registration, send, invalidation) so we need to allocate 3x larger

Re: [PATCH 6/6] IB/srp: Fix srp_map_sg_fr()

2015-12-01 Thread Bart Van Assche
On 12/01/2015 10:35 AM, Sagi Grimberg wrote: After dma_map_sg() has been called the return value of that function must be used as the number of elements in the scatterlist instead of scsi_sg_count(). Umm, but ib_map_mr_sg iterates on the sg list. Say you have sg_nents=3 and after mapping you

Re: [PATCH 5/6] IB core: Fix ib_sg_to_pages()

2015-12-01 Thread Bart Van Assche
On 12/01/2015 10:32 AM, Sagi Grimberg wrote: Fix the code for detecting gaps and disable the code for chunking. A gap occurs not only if the second or later scatterlist element is not aligned but also if any scatterlist element other than the last does not end at a page boundary. Disable the

Re: [PATCH 4/6] IB/srp: Fix indirect data buffer rkey endianness

2015-12-01 Thread Bart Van Assche
On 12/01/2015 10:37 AM, Sagi Grimberg wrote: On 01/12/2015 20:18, Bart Van Assche wrote: Detected by sparse. Fixes: commit 330179f2fa93 ("IB/srp: Register the indirect data buffer descriptor") Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Cc: stable <sta

[PATCH 4/4] Fix compiler warnings about set-but-not-used variables

2015-11-29 Thread Bart Van Assche
. Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> --- cmdif/tools_cif.c| 1 - cmdparser/my_getopt.c| 3 - common/compatibility.h | 7 + flint/Makefile.am| 2 +- flint/subcomman

[PATCH 1/4] Fix several automake warnings

2015-11-29 Thread Bart Van Assche
' (or '*_CPPFLAGS') Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> --- cmdif/Makefile.am| 2 +- cmdparser/Makefile.am| 2 -- configure.ac | 4 +++- dev_mgt/Makefile.am | 2 +- flint/Makefile.am| 2 +- mflash/Makefile.am

[PATCH 2/4] Makefile.am: Remove the undefined variable MFT_EXT_LIBS_INC_DIR

2015-11-29 Thread Bart Van Assche
This avoids that the option sequence "-I -I" is passed to the compiler, a sequence that causes weird error messages to be printed. Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> --- mlxconfig/Makefile.am| 2 +- mlxfwops/lib/Makefile.am | 2 +- 2 files changed, 2

[PATCH 3/4] crd_read_line(): Rework code to suppress a compiler warning

2015-11-29 Thread Bart Van Assche
Avoid that gcc prints a warning about not checking the result of fgets(). Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> --- mstdump/crd_lib/crdump.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mstdump/crd_lib/crdump.c b/mstdump/crd_lib/crdump.c

[PATCH 0/4] mstflint source code cleanup patches

2015-11-29 Thread Bart Van Assche
These four patches bring the mstflint coding style closer to that of the other RDMA user space software. The patches in this series are: 0001-Fix-several-automake-warnings.patch 0002-Makefile.am-Remove-the-undefined-variable-MFT_EXT_LI.patch

Re: srp state in current mainline

2015-11-25 Thread Bart Van Assche
On 11/25/2015 11:34 AM, Bart Van Assche wrote: > On 11/23/2015 05:14 PM, Bart Van Assche wrote: >> On 11/22/2015 07:31 AM, Christoph Hellwig wrote: >>> On Sun, Nov 22, 2015 at 05:26:28PM +0200, Sagi Grimberg wrote: >>>>> No. register_always=Y is already broken in

Re: srp state in current mainline

2015-11-25 Thread Bart Van Assche
On 11/23/2015 05:14 PM, Bart Van Assche wrote: On 11/22/2015 07:31 AM, Christoph Hellwig wrote: On Sun, Nov 22, 2015 at 05:26:28PM +0200, Sagi Grimberg wrote: No. register_always=Y is already broken in 4.3, but register_always=N is now also broken in 4.4. OK, I'm confused so please let me

Re: [PATCH 2/9] IB: add a proper completion queue abstraction

2015-11-23 Thread Bart Van Assche
On 11/23/2015 02:18 PM, Jason Gunthorpe wrote: On Mon, Nov 23, 2015 at 01:54:05PM -0800, Bart Van Assche wrote: What I don't see is how SRP handles things when the sendq fills up, ie the case where __srp_get_tx_iu() == NULL. It looks like the driver starts to panic and generates printks. I can't

Re: [PATCH 2/9] IB: add a proper completion queue abstraction

2015-11-23 Thread Bart Van Assche
On 11/23/2015 01:28 PM, Jason Gunthorpe wrote: On Mon, Nov 23, 2015 at 01:04:25PM -0800, Bart Van Assche wrote: Considerable time ago the send queue in the SRP initiator driver was modified from signaled to non-signaled to reduce the number of interrupts triggered by the SRP initiator driver

Re: [PATCH] IB/srp: Fix possible send queue overflow

2015-11-23 Thread Bart Van Assche
On 11/22/2015 05:37 AM, Christoph Hellwig wrote: On Tue, Nov 10, 2015 at 12:35:05PM +0200, Sagi Grimberg wrote: Are you planning to pick this up? Note that this patch is stable material as well. Doug? any plans for this patch? We should really get this in an into -stable. Bart, can you

Re: srp state in current mainline

2015-11-23 Thread Bart Van Assche
On 11/22/2015 07:31 AM, Christoph Hellwig wrote: On Sun, Nov 22, 2015 at 05:26:28PM +0200, Sagi Grimberg wrote: No. register_always=Y is already broken in 4.3, but register_always=N is now also broken in 4.4. OK, I'm confused so please let me understand slowly :) Your patch "ib_srp:

Re: [PATCH 2/9] IB: add a proper completion queue abstraction

2015-11-23 Thread Bart Van Assche
On 11/23/2015 12:37 PM, Jason Gunthorpe wrote: On Sat, Nov 14, 2015 at 08:13:44AM +0100, Christoph Hellwig wrote: On Fri, Nov 13, 2015 at 03:06:36PM -0700, Jason Gunthorpe wrote: Looking at that thread and then at the patch a bit more.. +void ib_process_cq_direct(struct ib_cq *cq) [..] +

Re: [PATCH 2/9] IB: add a proper completion queue abstraction

2015-11-22 Thread Bart Van Assche
On 11/22/15 06:57, Sagi Grimberg wrote: I think that bart wants to allow the caller to select cpu affinity per CQ. In this case ib_alloc_cq in workqueue mode would need to accept a affinity_hint from the caller (default to wild-card WORK_CPU_UNBOUND). Hmm, true. How would be set that hint

Re: [PATCH 2/9] IB: add a proper completion queue abstraction

2015-11-20 Thread Bart Van Assche
On 11/20/2015 02:16 AM, Christoph Hellwig wrote: > On Wed, Nov 18, 2015 at 10:20:14AM -0800, Bart Van Assche wrote: >> Are you perhaps referring to the sysfs CPU mask that allows to control >> workqueue affinity ? > > I think he is referring to the defintion of WQ_UNBOUN

[PATCH] IB/cma: Add a missing rcu_read_unlock()

2015-11-20 Thread Bart Van Assche
Ensure that validate_ipv4_net_dev() calls rcu_read_unlock() if fib_lookup() fails. Detected by sparse. Compile-tested only. Fixes: "IB/cma: Validate routing of incoming requests" (commit f887f2ac87c2). Cc: Haggai Eran Cc: stable ---

Re: [PATCH 3/9] IB: add a helper to safely drain a QP

2015-11-17 Thread Bart Van Assche
On 11/15/2015 01:34 AM, Sagi Grimberg wrote: This is taken from srp, and srp drains using a recv wr due to a race causing a use-after-free condition in srp which re-posts a recv buffer in the recv completion handler. Hello Sagi, Would it be possible to clarify this ? Does this refer to an

Re: [PATCH 1/9] move blk_iopoll to limit and make it generally available

2015-11-17 Thread Bart Van Assche
On 11/13/2015 11:02 PM, Christoph Hellwig wrote: On Fri, Nov 13, 2015 at 11:19:24AM -0800, Bart Van Assche wrote: On 11/13/2015 05:46 AM, Christoph Hellwig wrote: The new name is irq_poll as iopoll is already taken. Better suggestions welcome. Would it be possible to provide more background

Re: [PATCH 1/9] move blk_iopoll to limit and make it generally available

2015-11-17 Thread Bart Van Assche
On 11/17/2015 09:16 AM, Bart Van Assche wrote: On 11/13/2015 11:02 PM, Christoph Hellwig wrote: On Fri, Nov 13, 2015 at 11:19:24AM -0800, Bart Van Assche wrote: On 11/13/2015 05:46 AM, Christoph Hellwig wrote: The new name is irq_poll as iopoll is already taken. Better suggestions welcome

Re: [PATCH 5/9] srpt: use the new CQ API

2015-11-17 Thread Bart Van Assche
On 11/13/2015 05:46 AM, Christoph Hellwig wrote: > [ ... ] The previous patch and this patch look like great work to me. However, this patch not only reworks the SRP target driver but also prevents users to move the SRP completion thread to another CPU core than the CPU core that processes

Re: [PATCH 2/9] IB: add a proper completion queue abstraction

2015-11-17 Thread Bart Van Assche
On 11/13/2015 05:46 AM, Christoph Hellwig wrote: + * context and does not ask from completion interrupts from the HCA. Should this perhaps be changed into "for" ? + */ +void ib_process_cq_direct(struct ib_cq *cq) +{ + WARN_ON_ONCE(cq->poll_ctx !=

Re: [PATCH 5/9] srpt: use the new CQ API

2015-11-17 Thread Bart Van Assche
On 11/13/2015 05:46 AM, Christoph Hellwig wrote: [ ... ] This patch contains two logical changes: - Conversion to the new CQ API. - Removal of the ib_srpt_compl thread. Had it been considered to implement these changes as two separate patches ? Thanks, Bart. -- To unsubscribe from this

Re: [PATCH 4/9] srpt: chain RDMA READ/WRITE requests

2015-11-17 Thread Bart Van Assche
On 11/13/2015 05:46 AM, Christoph Hellwig wrote: - ret = ib_post_send(ch->qp, , _wr); - if (ret) - break; + if (i == n_rdma - 1) { + /* only get completion event for the last rdma read */ +

Re: [PATCH] ib_srp: initialize dma_length in srp_map_idb

2015-11-16 Thread Bart Van Assche
On 11/15/2015 09:59 AM, Christoph Hellwig wrote: Without this sg_dma_len will return 0 on architectures tha have the dma_length field. Signed-off-by: Christoph Hellwig --- drivers/infiniband/ulp/srp/ib_srp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git

Re: [PATCH] ib_srp: initialize dma_length in srp_map_idb

2015-11-16 Thread Bart Van Assche
On 11/16/2015 09:22 AM, Christoph Hellwig wrote: the code in this area changed enough since 4.3 that it won't easily apply. But a backport would still be very useful! In that case: Reviewed-by: Bart Van Assche <bart.vanass...@sandisk.com> -- To unsubscribe from this list: send th

Re: srp state in current mainline

2015-11-15 Thread Bart Van Assche
On 11/15/15 10:06, Christoph Hellwig wrote: FYI, I sent a patch for the zero S/G length issue. With this xfstests does fine for ext4 and btrfs. With XFS I still run into corruption warnings for the slab use after free poison pattern. I suspect that issue might be related to uniqueue XFS I/O

Re: [PATCH 2/9] IB: add a proper completion queue abstraction

2015-11-13 Thread Bart Van Assche
On 11/13/2015 10:25 AM, Jason Gunthorpe wrote: On Fri, Nov 13, 2015 at 02:46:43PM +0100, Christoph Hellwig wrote: This adds an abstraction that allows ULP to simply pass a completion object and completion callback with each submitted WR and let the RDMA core handle the nitty gritty details of

Re: [PATCH 1/9] move blk_iopoll to limit and make it generally available

2015-11-13 Thread Bart Van Assche
On 11/13/2015 05:46 AM, Christoph Hellwig wrote: The new name is irq_poll as iopoll is already taken. Better suggestions welcome. Hello Christoph, Would it be possible to provide more background information about this ? Which other kernel subsystem is using the name iopoll ? I think the

Re: srp state in current mainline

2015-11-12 Thread Bart Van Assche
On 11/12/2015 09:59 AM, Christoph Hellwig wrote: [ 108.998574] WARNING: CPU: 0 PID: 1258 at kernel/sched/core.c:7389 __might_sleep+0xa7/0xb0() [ 108.998580] do not call blocking ops when !TASK_RUNNING; state=1 set Although this is most likely unrelated to the issue reported at the start of

Re: [PATCH] IB/mad: In validate_mad, validate CM method and attribute

2015-11-12 Thread Bart Van Assche
On 11/12/2015 03:48 AM, Hal Rosenstock wrote: A new SRP target has been observed to respond to Send CM REQ with GetResp of CM REQ with bad status. This is non conformant with IBA spec but exposes a vulnerability in the current MAD/CM code which will respond to the incoming GetResp of CM REQ as

Re: srp state in current mainline

2015-11-11 Thread Bart Van Assche
On 11/10/2015 09:15 AM, Christoph Hellwig wrote: This is a simply xfstests run using XFS on a remote LIO ramdisk. Hello Christoph, Which version of the kernel and LIO were installed at the target side ? Bart. -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the

Re: srp state in current mainline

2015-11-11 Thread Bart Van Assche
On 11/11/2015 07:46 AM, Christoph Hellwig wrote: On Wed, Nov 11, 2015 at 07:35:47AM -0800, Bart Van Assche wrote: On 11/10/2015 09:15 AM, Christoph Hellwig wrote: This is a simply xfstests run using XFS on a remote LIO ramdisk. Hello Christoph, Which version of the kernel and LIO were

Re: srp state in current mainline

2015-11-11 Thread Bart Van Assche
On 11/10/2015 09:15 AM, Christoph Hellwig wrote: scsi host3: ib_srp: failed receive status WR flushed (5) for iu 880313f4ca40 Can you also post the logs from the target system from around the time this message was logged on the initiator system ? Usually this message means that the

Re: [PATCH ib-next 2/3] IB/core: IB/core: Allow legacy verbs through extended interfaces

2015-11-10 Thread Bart Van Assche
On 11/10/2015 07:40 AM, Eli Cohen wrote: > On Tue, Nov 10, 2015 at 05:23:10PM +0200, Eli Cohen wrote: >>> >>> Call it ENOTSUP then: >>> >>> ENOTSUP Operation not supported (POSIX.1) >>> >>> Same value on Linux. >>> >> >> Yes, that's better. I will resend. > > > Well it seems like

Re: [PATCH 4/7] IB/srp: Fix a potential queue overflow in an error path

2015-11-04 Thread Bart Van Assche
On 11/03/2015 08:03 PM, Christoph Hellwig wrote: On Tue, Nov 03, 2015 at 12:50:59PM -0800, Bart Van Assche wrote: Such a check wouldn't be that simple because the only way to perform such a check is either by doubling the number of ib_map_mr_sg() calls or by performing additional memory

Re: [PATCH 4/7] IB/srp: Fix a potential queue overflow in an error path

2015-11-03 Thread Bart Van Assche
On 11/03/2015 09:36 AM, Sagi Grimberg wrote: On 28/10/2015 00:02, Bart Van Assche wrote: Wait until memory registration has finished in the srp_queuecommand() error path before invalidating memory regions to avoid a send queue overflow. This looks backwards to me... Why do we even post

  1   2   3   4   5   6   7   8   9   10   >