[PATCHv3 TRIVIAL] IB/core: Documentation fix to ib_mad_snoop_handler in the MAD header file

2016-01-05 Thread Hal Rosenstock
In ib_mad.h, ib_mad_snoop_handler uses send_buf rather than send_wr Signed-off-by: Hal Rosenstock --- Change since v2: Changed title to use "higher" language Change since v1: Fixed typo in patch description diff --git a/include/rdma/ib_mad.h b/include/rdma/ib_mad.h index

Re: [PATCH 10/11] IB: only keep a single key in struct ib_mr

2016-01-05 Thread Jason Gunthorpe
On Fri, Dec 25, 2015 at 06:46:07PM +0200, Liran Liss wrote: > > From: Jason Gunthorpe > > > > >fill mr->key by the lkey or rkey based on that and everything will > > > >work fine. > > > > > > But the ULP *can* register a memory buffer with local and remote > > >

RE: device attr cleanup

2016-01-05 Thread Steve Wise
> -Original Message- > From: linux-rdma-ow...@vger.kernel.org > [mailto:linux-rdma-ow...@vger.kernel.org] On Behalf Of Doug Ledford > Sent: Wednesday, December 23, 2015 9:19 PM > To: J. Bruce Fields; Chuck Lever > Cc: Christoph Hellwig; Anna Schumaker; Jason Gunthorpe; >

Re: device attr cleanup

2016-01-05 Thread Or Gerlitz
On Tue, Jan 5, 2016 at 6:46 PM, Steve Wise wrote: > Hey Doug, I don't see this branch. Which branch has the accepted device attr > change? k.o/for-4.5 on Doug's kernel.org tree -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of

RE: [PATCHv3 TRIVIAL] IB/core: Documentation fix to ib_mad_snoop_handler in the MAD header file

2016-01-05 Thread Hefty, Sean
> In ib_mad.h, ib_mad_snoop_handler uses send_buf rather than send_wr The MAD snooping should be removed from the mad stack. There are no in tree users and the only attempt at adding one was rejected.

[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 Cc: Christoph Hellwig --- drivers/infiniband/ulp/srpt/ib_srpt.c | 54 ++- 1 file changed, 2 insertions(+), 52

[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

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

2016-01-05 Thread Bart Van Assche
The target core guarantees that shutdown_session() is only invoked once per session. This means that the ib_srpt target driver doesn't have to track whether or not shutdown_session() has been called. Additionally, ensure that target_sess_cmd_list_set_waiting() is called before

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

2016-01-05 Thread Bart Van Assche
Although sizeof is an operator and hence in many cases parentheses can be left out, the recommended kernel coding style is to surround the sizeof argument with parentheses. This patch does not change any functionality. This patch has been generated by running the following shell command: sed -i

[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 Cc: Christoph Hellwig --- drivers/infiniband/ulp/srpt/ib_srpt.c | 14 ++ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git

[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 Cc: Christoph Hellwig --- drivers/infiniband/ulp/srpt/ib_srpt.c | 4 1 file changed, 4 insertions(+) diff --git

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

2016-01-05 Thread Bart Van Assche
srpt_abort_cmd() must not be called in state SRPT_STATE_DATA_IN. Issue a warning if this occurs. srpt_abort_cmd() must not invoke target_put_sess_cmd() for commands in state SRPT_STATE_DONE because the srpt_abort_cmd() callers already do this when necessary. Hence remove this call. If an RDMA

[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 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 Cc: Christoph Hellwig ---

[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 Cc:

[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 Cc: Christoph Hellwig --- drivers/infiniband/ulp/srpt/ib_srpt.c | 42 ++- 1

[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
The only allowed return values for the write_pending() callback function are 0, -EAGAIN and -ENOMEM. Since attempting to perform RDMA over a disconnecting channel will result in an IB error completion anyway, remove the code that checks the channel state from srpt_write_pending(). Signed-off-by:

[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 Cc: Christoph Hellwig --- drivers/infiniband/ulp/srpt/ib_srpt.c | 17 ++--- 1 file changed, 2 insertions(+), 15 deletions(-) diff

[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 Cc: Christoph Hellwig --- drivers/infiniband/ulp/srpt/ib_srpt.c |

RE: [PATCHv3 TRIVIAL] IB/core: Documentation fix to ib_mad_snoop_handler in the MAD header file

2016-01-05 Thread Hefty, Sean
> > There are no in tree users and the only attempt at adding one was > rejected. > > There are no in tree users of this but there is your madeye tool (which > is out of tree). This is still a useful debug tool for MADs and there > are people who still use that. It's an out of tree tool.

[PATCHv1 0/6] rdma controller support

2016-01-05 Thread Parav Pandit
This patchset adds support for RDMA cgroup by addressing review comments of [1] by implementing published RFC [2]. Overview: Currently user space applications can easily take away all the rdma device specific resources such as AH, CQ, QP, MR etc. Due to which other applications in other cgroup or

[PATCHv1 3/6] rdmacg: implements rdma cgroup

2016-01-05 Thread Parav Pandit
Adds RDMA controller to limit the number of RDMA resources that can be consumed by processes of a rdma cgroup. RDMA resources are global resource that can be exhauasted without reaching any kmemcg or other policy. RDMA cgroup implementation allows limiting RDMA/IB well defined resources to be

[PATCHv1 2/6] IB/core: Added members to support rdma cgroup

2016-01-05 Thread Parav Pandit
Added function pointer table to store resource pool specific operation for each resource type (verb and hw). Added list node to link device to rdma cgroup so that it can participate in resource accounting and limit configuration. Signed-off-by: Parav Pandit ---

[PATCHv4 TRIVIAL] IB/core: Documentation fix to the snoop handler in the MAD header file

2016-01-05 Thread Hal Rosenstock
In ib_mad.h, ib_mad_snoop_handler uses send_buf rather than send_wr Signed-off-by: Hal Rosenstock --- Change since v3: Fixed title to not include function name Change since v2: Changed title to use "higher" language Change since v1: Fixed typo in patch description diff

[PATCHv1 1/6] rdmacg: Added rdma cgroup header file

2016-01-05 Thread Parav Pandit
Added rdma cgroup header file which defines its APIs to perform charing/uncharing functionality. Signed-off-by: Parav Pandit --- include/linux/cgroup_rdma.h | 91 + 1 file changed, 91 insertions(+) create mode 100644

Re: [PATCHv3 TRIVIAL] IB/core: Documentation fix to ib_mad_snoop_handler in the MAD header file

2016-01-05 Thread Hal Rosenstock
On 1/5/2016 12:38 PM, Hefty, Sean wrote: >> In ib_mad.h, ib_mad_snoop_handler uses send_buf rather than send_wr > > The MAD snooping should be removed from the mad stack. This last discussed on linux-rdma list back in late September when Ira posted a partial RFC patch to do this. > There are

Re: [PATCH v2] staging/rdma/hfi1: check for ARMED->ACTIVE transition in receive interrupt

2016-01-05 Thread Jubin John
On Mon, Jan 04, 2016 at 10:23:46PM +0200, Leon Romanovsky wrote: > On Mon, Jan 04, 2016 at 11:21:19AM -0500, Jubin John wrote: > > From: Jim Snow > > > > } else { > > + /* Auto activate link on non-SC15 packet receive */ > > +

[PATCHv1 5/6] IB/core: use rdma cgroup for resource accounting

2016-01-05 Thread Parav Pandit
It uses charge API to perform resource charing before allocating low level resource. It continues to link the resource to the owning thread group leader task. It uncharges the resource after successful deallocation of resource. Signed-off-by: Parav Pandit ---

[PATCHv1 4/6] IB/core: rdmacg support infrastructure APIs

2016-01-05 Thread Parav Pandit
It defines verb RDMA resources that will be registered with RDMA cgroup. It defines new APIs to register device with RDMA cgroup and defines resource token table access interface. Signed-off-by: Parav Pandit --- drivers/infiniband/core/Makefile| 1 +

[PATCHv1 6/6] rdmacg: Added documentation for rdma controller.

2016-01-05 Thread Parav Pandit
Added documentation for rdma controller to use in legacy mode and using new unified hirerchy. Signed-off-by: Parav Pandit --- Documentation/cgroup-legacy/rdma.txt | 129 +++ Documentation/cgroup.txt | 79 +

[PATCH v3] staging/rdma/hfi1: check for ARMED->ACTIVE transition in receive interrupt

2016-01-05 Thread Jubin John
From: Jim Snow The link state will transition from ARMED to ACTIVE when a non-SC15 packet arrives, but the driver might not notice the change. With this fix, if the slowpath receive interrupt handler sees a non-SC15 packet while in the ARMED state, we queue work to call

Re: [PATCHv3 TRIVIAL] IB/core: Documentation fix to ib_mad_snoop_handler in the MAD header file

2016-01-05 Thread Or Gerlitz
On Tue, Jan 5, 2016 at 9:00 PM, Hefty, Sean wrote: >> > There are no in tree users and the only attempt at adding one was >> rejected. >> >> There are no in tree users of this but there is your madeye tool (which >> is out of tree). This is still a useful debug tool for MADs

[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 04/15] IB/srpt: Introduce target_reverse_dma_direction()

2016-01-05 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig -- 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 05/15] IB/srpt: Use scsilun_to_int()

2016-01-05 Thread Christoph Hellwig
On Tue, Jan 05, 2016 at 03:22:46PM +0100, Bart Van Assche wrote: > 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 > Cc:

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

2016-01-05 Thread Christoph Hellwig
On Tue, Jan 05, 2016 at 03:23:14PM +0100, Bart Van Assche wrote: > Let the target core check task existence instead of the SRP target > driver. Looks good, Reviewed-by: Christoph Hellwig -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a

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

2016-01-05 Thread Christoph Hellwig
On Tue, Jan 05, 2016 at 03:20:50PM +0100, Bart Van Assche wrote: > Although sizeof is an operator and hence in many cases parentheses can > be left out, the recommended kernel coding style is to surround the > sizeof argument with parentheses. This patch does not change any > functionality. This

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

2016-01-05 Thread Christoph Hellwig
On Tue, Jan 05, 2016 at 03:21:53PM +0100, Bart Van Assche wrote: > The callers of srpt_get_ch_state() can access ch->state safely without > using locking. Hence inline this function. Looks good, Reviewed-by: Christoph Hellwig -- To unsubscribe from this list: send the line

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

2016-01-05 Thread Christoph Hellwig
> 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: > case SRPT_STATE_MGMT: > + case

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

2016-01-05 Thread Christoph Hellwig
On Tue, Jan 05, 2016 at 03:24:49PM +0100, Bart Van Assche wrote: > 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

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

2016-01-05 Thread Christoph Hellwig
On Tue, Jan 05, 2016 at 03:24:15PM +0100, Bart Van Assche wrote: > The target core guarantees that shutdown_session() is only invoked > once per session. This means that the ib_srpt target driver doesn't > have to track whether or not shutdown_session() has been called. > Additionally, ensure that

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

2016-01-05 Thread Christoph Hellwig
On Tue, Jan 05, 2016 at 03:25:13PM +0100, Bart Van Assche wrote: > 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. I actually ran into this bug a long time ago

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

2016-01-05 Thread Christoph Hellwig
On Tue, Jan 05, 2016 at 03:23:45PM +0100, Bart Van Assche wrote: > 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

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

2016-01-05 Thread Christoph Hellwig
On Tue, Jan 05, 2016 at 03:26:22PM +0100, Bart Van Assche wrote: > 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. Looks fine, Reviewed-by:

Re: [PATCH 10/11] IB: only keep a single key in struct ib_mr

2016-01-05 Thread Christoph Hellwig
On Tue, Jan 05, 2016 at 10:46:36AM -0700, Jason Gunthorpe wrote: > > ULPs are *already* using the same registrations for both local and > > remote access. > > Where? Out of tree? I haven't found anything in-tree for sure. -- To unsubscribe from this list: send the line "unsubscribe linux-rdma"

[PATCH 2/2 v2] IB/mad: use CQ abstraction

2016-01-05 Thread Christoph Hellwig
Remove the local workqueue to process mad completions and use the CQ API instead. Signed-off-by: Christoph Hellwig Reviewed-by: Hal Rosenstock Reviewed-by: Ira Weiny --- drivers/infiniband/core/mad.c | 162

Unable to establish rdma connection, breaks rdma basic functionality

2016-01-05 Thread Hariprasad S
Hi Doug, I am trying to rping server, but it fails when bound to any address other then IF_ANY. # rping -s -a 102.1.1.129 -C1 -p -vd created cm_id 0x23d7800 rdma_bind_addr: No such file or directory destroy cm_id 0x23d7800 If bound to IF_ANY address, server starts but client fails to

Re: [PATCH 2/2] IB/mad: use CQ abstraction

2016-01-05 Thread Christoph Hellwig
On Mon, Jan 04, 2016 at 07:04:03PM -0500, ira.weiny wrote: > Sorry I did not catch this before but rather than void * wouldn't it be better > to use struct ib_cqe? Sure, I'll fix it up. -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to

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

2016-01-05 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig -- 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 15/15] IB/srpt: Fix a rare crash in srpt_close_session()

2016-01-05 Thread Christoph Hellwig
> srpt_disconnect_ch(ch); > > + kref_put(>kref, srpt_free_ch); At some point it might be a good idea to have a srpt_put_ch helper to wrap this pattern. Otherwise looks good: Reviewed-by: Christoph Hellwig -- To unsubscribe from this list: send the line "unsubscribe

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

2016-01-05 Thread Christoph Hellwig
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 requests have been queued, > use a zero-length

Re: [RFC PATCH 00/15] staging/rdma/hfi1: Initial patches to add rdmavt support in HFI1

2016-01-05 Thread ira.weiny
> > > > > > > > > > If Doug accepts the library changes, let me know that public git > > > > > commit > > > > > and I can pull it into the staging-next branch and you can continue to > > > > > send me staging patches that way. > > > > > > > > Won't this cause a conflict during the merge window?

Re: [PATCH rdma-RC] IB/cm: Fix sleeping while atomic when creating AH from WC

2016-01-05 Thread Matan Barak
On Thu, Dec 24, 2015 at 9:46 AM, Matan Barak wrote: > On Wed, Dec 23, 2015 at 10:04 PM, Doug Ledford wrote: >> On 10/15/2015 12:58 PM, Hefty, Sean wrote: >> ib_create_ah_from_wc needs to resolve the DMAC in order to create the >> AH (this

[PATCH][v4.2.y-ckt] net/mlx5e: Max mtu comparison fix

2016-01-05 Thread Joseph Salisbury
Hello, Please consider including mainline commit 50a9eea694ab8e0779069e0a4e0b12e145521468 in the next v4.2.y-ckt release. It was included in the mainline tree as of v4.4-rc2. It has been tested and confirmed to resolve: http://bugs.launchpad.net/bugs/1528466 commit

Re: [PATCHv1 2/6] IB/core: Added members to support rdma cgroup

2016-01-05 Thread Tejun Heo
On Wed, Jan 06, 2016 at 12:28:02AM +0530, Parav Pandit wrote: > Added function pointer table to store resource pool specific > operation for each resource type (verb and hw). > Added list node to link device to rdma cgroup so that it can > participate in resource accounting and limit

Re: [PATCHv4 TRIVIAL] IB/core: Documentation fix to the snoop handler in the MAD header file

2016-01-05 Thread ira.weiny
On Tue, Jan 05, 2016 at 01:52:55PM -0500, Hal Rosenstock wrote: > In ib_mad.h, ib_mad_snoop_handler uses send_buf rather than send_wr > > Signed-off-by: Hal Rosenstock First off I have to say; this comment is wrong and should be fixed. Reviewed-by: Ira Weiny

Re: [PATCH][v4.2.y-ckt] net/mlx5e: Max mtu comparison fix

2016-01-05 Thread Kamal Mostafa
On Tue, 2016-01-05 at 16:01 -0500, Joseph Salisbury wrote: > Hello, > > Please consider including mainline commit > 50a9eea694ab8e0779069e0a4e0b12e145521468 in the next v4.2.y-ckt > release. It was > included in the mainline tree as of v4.4-rc2. It has been tested and > confirmed to resolve: >

Re: [PATCHv1 0/6] rdma controller support

2016-01-05 Thread Tejun Heo
Hello, On Wed, Jan 06, 2016 at 12:28:00AM +0530, Parav Pandit wrote: > Resources are not defined by the RDMA cgroup. Resources are defined > by RDMA/IB stack & optionally by HCA vendor device drivers. As I wrote before, I don't think this is a good idea. Drivers will inevitably add non-sensical

Re: [PATCHv1 6/6] rdmacg: Added documentation for rdma controller.

2016-01-05 Thread Tejun Heo
Hello, On Wed, Jan 06, 2016 at 12:28:06AM +0530, Parav Pandit wrote: > +5-4-1. RDMA Interface Files > + > + rdma.resource.verb.list > + rdma.resource.verb.limit > + rdma.resource.verb.usage > + rdma.resource.verb.failcnt > + rdma.resource.hw.list > + rdma.resource.hw.limit > +

Re: [PATCHv1 3/6] rdmacg: implements rdma cgroup

2016-01-05 Thread Tejun Heo
Hello, On Wed, Jan 06, 2016 at 12:28:03AM +0530, Parav Pandit wrote: > +/* hash table to keep map of tgid to owner cgroup */ > +DEFINE_HASHTABLE(pid_cg_map_tbl, 7); > +DEFINE_SPINLOCK(pid_cg_map_lock);/* lock to protect hash table access */ > + > +/* Keeps mapping of pid to its owning cgroup