Re: positive or negative error values from vendor library for immediate errors?

2014-12-12 Thread Dotan Barak
Hi Devesh. I wish that there was a header that maps the return errors to errno, to make things much more canonical. But currently we don't have it :( AFAIK, the guidelines is that kernel code returns negative values and userspace code should return positive values. Thanks Dotan On 08/12/2014

Re: CQEs in unreliable connection

2013-11-30 Thread Dotan Barak
On 29/11/2013 22:50, Anuj Kalia wrote: Dotan, Thanks for your reply again. I just wanted to confirm about the order in which messages are sent and received. I'm not worried about the memory policy. If you are talking about InfiniBand then this is the case ... Dotan -- To unsubscribe from

Re: CQEs in unreliable connection

2013-11-29 Thread Dotan Barak
On 29/11/2013 16:53, Anuj Kalia wrote: Dotan, In the example that I asked about, the 5 packets do not form one message - they are each individual messages. I assume this in the following. I now understand that packet reordering cannot happen in IB - thanks! Only packet loss can happen. From

Re: CQEs in unreliable connection

2013-11-28 Thread Dotan Barak
Hi Anuj. On 28/11/2013 14:24, Anuj Kalia wrote: Hi. I had 2 questions related to RDMA operations (reads and writes) over unreliable connections: 1. Are WQEs issued over an unreliable connection supposed to generate CQEs? The Infiniband spec says that such WQEs may not generate an 'ACK'. I'm

Re: CQEs in unreliable connection

2013-11-28 Thread Dotan Barak
at 1:19 AM, Dotan Barak dota...@gmail.com wrote: Hi Anuj. On 28/11/2013 14:24, Anuj Kalia wrote: Hi. I had 2 questions related to RDMA operations (reads and writes) over unreliable connections: 1. Are WQEs issued over an unreliable connection supposed to generate CQEs? The Infiniband spec says

Re: IBV_WR_SEND_WITH_IMM failure

2012-10-23 Thread Dotan Barak
Hi Xavier. I'm trying to understand exactly what you did... I'm guessing here the scenario, please correct me if I'm wrong: You've tried to work with RoCE over ConnectX-3 using RC QP. You were able to send messages up to 1024 (including this value) and it failed. You've to execute the same test

Re: IBV_WR_SEND_WITH_IMM failure

2012-10-18 Thread Dotan Barak
Hi Xavier. On Tue, Oct 16, 2012 at 8:13 PM, Xavier Guérin guer...@gmail.com wrote: Hello list, I am having a puzzling error with IBV_WR_SEND_WITH_IMM. Polling fails with IBV_WC_RETRY_EXC_ERR when I use buffer bigger that 1KB. Send/Receive buffers are of a larger size and properly registered.

[PATCH 2/5] [librdmacm] rsocket: added missing break

2012-10-09 Thread Dotan Barak
Signed-off-by: Dotan Barak dot...@dev.mellanox.co.il Reviewed-by: Yishai Hadas yish...@mellanox.com --- src/rsocket.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/rsocket.c b/src/rsocket.c index 278c8ec..4665ce7 100644 --- a/src/rsocket.c +++ b/src/rsocket.c

[PATCH 5/5] [librdmacm] rping: added checks to the return values functions

2012-10-09 Thread Dotan Barak
This will make rping to exit with return value other than zero in case of an error. Signed-off-by: Dotan Barak dot...@dev.mellanox.co.il Reviewed-by: Yishai Hadas yish...@mellanox.com --- examples/rping.c | 21 ++--- 1 files changed, 18 insertions(+), 3 deletions(-) diff --git

[PATCH 0/5] [librdmacm] librdmacm: batch of fixes

2012-10-09 Thread Dotan Barak
Here is a small batch of fixes for librdmacm. Dotan Barak (5): rsocket: add missing va_end() after calling va_end() rsocket: added missing break rstream: initialize return value in server_connect() rstream: added missing return is accept() failed rping: added checks to the return values

[PATCH 1/5] [librdmacm] rsocket: add missing va_end() after calling va_end()

2012-10-09 Thread Dotan Barak
Not doing so, may lead to resource leak. Signed-off-by: Dotan Barak dot...@dev.mellanox.co.il Reviewed-by: Yishai Hadas yish...@mellanox.com --- src/rsocket.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/rsocket.c b/src/rsocket.c index 4c4821b..278c8ec 100644

[PATCH 3/5] [librdmacm] rstream: initialize return value in server_connect()

2012-10-09 Thread Dotan Barak
If use_async == 0 and rs_accept() passes (i.e. non negative value), then the return value from the function was uninitialized. Signed-off-by: Dotan Barak dot...@dev.mellanox.co.il Reviewed-by: Yishai Hadas yish...@mellanox.com --- examples/rstream.c |2 +- 1 files changed, 1 insertions(+), 1

[PATCH] [TRIVIAL] ibacm: security fix: replace sprintf with snprintf

2012-04-23 Thread Dotan Barak
Replace sprintf with snprintf to protects from buffer overflow. Signed-off-by: Dotan Barak dot...@dev.mellanox.co.il Reviewed-by: Jack Morgenstein ja...@dev.mellanox.co.il --- linux/acme_linux.c |4 ++-- src/acm.c |6 +++--- src/parse.c|2 +- 3 files changed, 6

ibacm: Check dynamic memory allocation results

2011-11-28 Thread Dotan Barak
After allocation of dynamic memory blocks, check that the allocation succeeded, if it failed handle it gracefully. Signed-off-by: Dotan Barak dot...@dev.mellanox.co.il Reviewed-by: Erez Shitrit ere...@mellanox.co.il --- src/parse.c | 22 -- 1 files changed, 16 insertions

[PATCH] ibacm: Check dynamic memory allocation results

2011-11-28 Thread Dotan Barak
After allocation of dynamic memory blocks, check that the allocation succeeded, if it failed handle it gracefully. Signed-off-by: Dotan Barak dot...@dev.mellanox.co.il Reviewed-by: Erez Shitrit ere...@mellanox.co.il --- src/parse.c | 22 -- 1 files changed, 16 insertions

[PATCH 1/2] libibverbs: fix memory leaks in various error flows in the library source code

2011-11-15 Thread Dotan Barak
Signed-off-by: Dotan Barak dot...@dev.mellanox.co.il --- src/cmd.c|4 +++- src/compat-1_0.c |5 - src/init.c |3 ++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/cmd.c b/src/cmd.c index 39af833..1a04228 100644 --- a/src/cmd.c +++ b/src/cmd.c

[PATCH 2/2] libibverbs: fix resource leaks in pingpong examples in case of a failure

2011-11-15 Thread Dotan Barak
Signed-off-by: Dotan Barak dot...@dev.mellanox.co.il --- examples/rc_pingpong.c | 43 --- examples/srq_pingpong.c | 51 ++ examples/uc_pingpong.c | 43 --- examples

libibverbs: Added the man page verbs.7

2011-11-10 Thread Dotan Barak
Added the man page verbs.7 which is an introduction to libibverbs man pages. Signed-off-by: Dotan Barak dot...@dev.mellanox.co.il Signed-off-by: Or Gerlitz ogerl...@voltaire.com --- Makefile.am|2 +- libibverbs.spec.in |1 + man/verbs.7| 201

[PATCH V2] RDMA/cm: destroy idr as part of the cleanup in the error flow

2011-11-07 Thread Dotan Barak
Clean the idr as part of the cleanup flow since it is a resource too. Signed-off-by: Dotan Barak dot...@dev.mellanox.co.il Reviewed-by: Jack Morgenstein ja...@dev.mellanox.co.il Reviewed-by: Sean Hefty sean.he...@intel.com --- V2 - don't check if idr_pre_get() failed, , we'll just try again

[PATCH] RDMA/cm: check that idr_pre_get didn't fail and clean it in error flow

2011-11-03 Thread Dotan Barak
The function idr_pre_get may fail, so there is a need to check the status of it. Since this function allocate resources, we need to clean them during the resource cleaning in case of error. Signed-off-by: Dotan Barak dot...@dev.mellanox.co.il Reviewed-by: Jack Morgenstein ja...@dev.mellanox.co.il

[PATCH] rdma/cma: minor code refactoring when saving a string content

2011-10-30 Thread Dotan Barak
In this case, using strdup will provide a cleaner code (and maybe a little bit faster too). Signed-off-by: Dotan Barak dot...@dev.mellanox.co.il --- src/addrinfo.c |4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/src/addrinfo.c b/src/addrinfo.c index 695430b..34c7fb4

[PATCH] rdma/cma: fixed resource leak in case of an error in udaddy

2011-10-25 Thread Dotan Barak
Fixed a resource leak in case of an error level in the udaddy example. Signed-off-by: Dotan Barak dot...@dev.mellanox.co.il --- examples/udaddy.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/examples/udaddy.c b/examples/udaddy.c index 637306a..1534df5 100644

[PATCH] ipoib: fix the function that performs dma unmap of memory buffers

2011-10-18 Thread Dotan Barak
Pages that were mapped using ib_dma_map_page() should be unmapped using the right function (i.e. ib_dma_unmap_page()). Signed-off-by: Dotan Barak dot...@dev.mellanox.co.il Reviewed-by: Jack Morgenstein ja...@dev.mellanox.co.il --- diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers

Re: [PATCH] mthca: Fix the attribute sq_sig_type value in query qp

2011-10-18 Thread Dotan Barak
Roland: did you have a change to review this patch? Thanks Dotan -- Forwarded Message -- Subject: [PATCH] mthca: Fix the attribute sq_sig_type value in query qp Date: Monday 05 September 2011 16:44 From: Dotan Barak dot...@sw.voltaire.com To: rol...@kernel.org Cc: linux-rdma

[PATCH] mthca: Fix the attribute sq_sig_type value in query qp

2011-09-05 Thread Dotan Barak
Fix the attribute sq_sig_type value in query qp. Signed-off-by: Dotan Barak dot...@dev.mellanox.co.il Reviewed-by: Jack Morgenstein ja...@dev.mellanox.co.il --- diff --git a/drivers/infiniband/hw/mthca/mthca_qp.c b/drivers/infiniband/hw/mthca/mthca_qp.c index 9601049..57b4325 100644

[PATCH 1/2] mlx4: fill the attribute masked_atomic_cap according to device capabilities

2011-08-31 Thread Dotan Barak
When the user queries for device capabilities, fill the attribute masked_atomic_cap according to the support level of the regular atomic capabilities and not using a hard coded value. Signed-off-by: Dotan Barak dot...@dev.mellanox.co.il Reviewed-by: Eli Cohen e...@mellanox.co.il --- drivers

[PATCH 2/2] mlx4: Fix the SQ size of an RC QP to support masked atomic operation

2011-08-31 Thread Dotan Barak
When calculating the required size of an RC QP send queue, leave enough space for masked atomic operation (which requires more space than regular atomic operation). Signed-off-by: Dotan Barak dot...@dev.mellanox.co.il Reviewed-by: Eli Cohen e...@mellanox.co.il --- drivers/infiniband/hw/mlx4/qp.c

[PATCH 2/2 v2] mlx4: Fix the SQ size of an RC QP to support masked atomic operation

2011-08-31 Thread Dotan Barak
) Signed-off-by: Dotan Barak dot...@dev.mellanox.co.il Reviewed-by: Eli Cohen e...@mellanox.co.il --- diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c index 3a91d9d..d91acbf 100644 --- a/drivers/infiniband/hw/mlx4/qp.c +++ b/drivers/infiniband/hw/mlx4/qp.c @@ -283,7

[PATCH 1/2] librdmacm: Fix resource leak in error flow

2011-08-15 Thread Dotan Barak
Prevent resource leak by destroying the event channel before returning from function in an error flow. Signed-off-by: Dotan Barak dot...@dev.mellanox.co.il --- diff --git a/src/cma.c b/src/cma.c index bad1ba3..1367779 100755 --- a/src/cma.c +++ b/src/cma.c @@ -2122,8 +2122,11 @@ int

[PATCH 2/2] librdmacm: fix resource leaks when CMA_CREATE_MSG_CMD_RESP fails

2011-08-15 Thread Dotan Barak
If the macro CMA_CREATE_MSG_CMD_RESP is being called and there is a failure, the macro should release the allocated resources before returning from the called function Signed-off-by: Dotan Barak dot...@dev.mellanox.co.il --- diff --git a/src/cma.c b/src/cma.c index bad1ba3..0512187 100755

[PATCH] IB/core - delete redundant check for DR SMP

2011-08-10 Thread Dotan Barak
The function handle_outgoing_dr_smp() is only called if the MAD to be sent is a directed route SMP. Thus, the check for IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE is redundant. Signed-off-by: Ralph Campbell ralph.campb...@qlogic.com Signed-off-by: Dotan Barak dot...@dev.mellanox.co.il Acked-by: Sean

[PATCH] mlx4: Fix the release func to be consistent with the allocation one

2011-07-28 Thread Dotan Barak
Fix the memory release function to be consistent with the memory allocation one to prevent problems where the implementation of pci_free_consistent and dma_free_coherent are different. Signed-off-by: Dotan Barak dot...@dev.mellanox.co.il Reviewed-by: Eli Cohen e...@mellanox.co.il --- diff --git

[PATCH] mlx4: Change the driver version

2011-07-14 Thread Dotan Barak
Many features were added to this driver, and the driver version should change too. Signed-off-by: Dotan Barak dot...@dev.mellanox.co.il --- diff --git a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h index dd7d745..ea529b4 100644 --- a/drivers/net/mlx4/mlx4.h +++ b/drivers/net/mlx4/mlx4.h

[PATCH/libmlx4] Use BlueFlame for RDMA_WRITE_WITH_IMM without data requests too

2011-07-11 Thread Dotan Barak
Use BlueFlame for RDMA Write with immediate without any data (no s/g) too. This improves latency. Signed-off-by: Dotan Barak dot...@dev.mellanox.co.il Reviewed-by: Jack Morgenstein ja...@dev.mellanox.co.il --- src/qp.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git

Re: [PATCH 2/2] libibverbs: Add support for XRC QPs

2011-06-16 Thread Dotan Barak
Hi. I noticed minor issue: @@ -564,6 +597,16 @@ struct ibv_srq { pthread_mutex_t mutex; pthread_cond_t cond; uint32_tevents_completed; + + /* Following fields only available if device supports extensions */ + enum ibv_srq_type

Re: P

2010-06-19 Thread Dotan Barak
I call rdma_create_id to create an ib id, then do resolve remote addr, resolve route work, then setup qp and call rdma_connect to setup connection, before ack or error replies, the thread will wait on a wait queue. The listening ib id of remote node will catch the connect request, setup qp,

Re: Mellanox implementation for atomic operations

2010-06-15 Thread Dotan Barak
Hi. On 10/05/2010 08:42, lihaidong wrote: Hi, I have a question about atomic operations. According to IB specification o10-48, all atomic operation request made to the same HCA, referencing the same physical memory are serialized with respect to each other. I know this should be

Re: A strange problem when using IB to transfer things

2010-06-11 Thread Dotan Barak
Hi. On 11/06/2010 10:51, Ding Dinghua wrote: Hi all: I'm using RDMA to do fs-metadata mirror between nodes. I encountered a strange problem when the program was running: Complete queue handler reported that the RDMA-Write operation failed, the status of corresponding struct ib_wc