All of lore.kernel.org
 help / color / mirror / Atom feed
* RDMA atomic operations fail
@ 2014-12-24  3:08 floaterions
       [not found] ` <loom.20141224T040342-951-eS7Uydv5nfjZ+VzJOa5vwg@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: floaterions @ 2014-12-24  3:08 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA

When I try to submit an RDMA FETCH_AND_ADD or CMP_AND_SWAP ,
the ibv_post_send() function fails, with Errno set to "Invalid argument".
I have no such problems with RDMA READ/WRITE. 

I developed my entire code using RDMA CM (so no manual QP transitioning). 
The queue pair is RC, and Atomic is enabled at the responder queue pair,
and the memory regions are registered with atomic access.

I suspected that there might be the source of this problem,
so I wrote a small program using libibcm where I transition the QPs manually
and set the flags fro atomic operations:
qp_attr->qp_access_flags = IBV_ACCESS_REMOTE_ATOMIC; 
qp_attr->max_rd_atomic = <something greater than zero>; 
qp_attr->max_dest_rd_atomic = <something greater than zero>; 

But still, the same error (invalid argument).

I'd appreciate your help.

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: RDMA atomic operations fail
       [not found] ` <loom.20141224T040342-951-eS7Uydv5nfjZ+VzJOa5vwg@public.gmane.org>
@ 2014-12-25  8:42   ` Sagi Grimberg
       [not found]     ` <CAJRcJr1QKB-7=xx6fD80RjfikR5ZJU+_6WTidXwCB-CocsPqzA@mail.gmail.com>
  2014-12-28 10:13   ` Eli Cohen
  1 sibling, 1 reply; 5+ messages in thread
From: Sagi Grimberg @ 2014-12-25  8:42 UTC (permalink / raw)
  To: floaterions, linux-rdma-u79uwXL29TY76Z2rM5mHXA

On 12/24/2014 5:08 AM, floaterions wrote:
> When I try to submit an RDMA FETCH_AND_ADD or CMP_AND_SWAP ,
> the ibv_post_send() function fails, with Errno set to "Invalid argument".
> I have no such problems with RDMA READ/WRITE.
>
> I developed my entire code using RDMA CM (so no manual QP transitioning).
> The queue pair is RC, and Atomic is enabled at the responder queue pair,
> and the memory regions are registered with atomic access.
>
> I suspected that there might be the source of this problem,
> so I wrote a small program using libibcm where I transition the QPs manually
> and set the flags fro atomic operations:
> qp_attr->qp_access_flags = IBV_ACCESS_REMOTE_ATOMIC;
> qp_attr->max_rd_atomic = <something greater than zero>;
> qp_attr->max_dest_rd_atomic = <something greater than zero>;
>
> But still, the same error (invalid argument).
>
> I'd appreciate your help.

Which device are you using?

It would help if you add the send wr setting code...

Sagi.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: RDMA atomic operations fail
       [not found]       ` <CAJRcJr1QKB-7=xx6fD80RjfikR5ZJU+_6WTidXwCB-CocsPqzA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2014-12-28  9:59         ` Sagi Grimberg
  0 siblings, 0 replies; 5+ messages in thread
From: Sagi Grimberg @ 2014-12-28  9:59 UTC (permalink / raw)
  To: Just Floaterions; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Eli Cohen

On 12/26/2014 4:29 AM, Just Floaterions wrote:
> I'm using ConnectIB.
>
> This is my send_wr code:
>
> struct ibv_send_wr wr, *bad_wr = NULL;
> struct ibv_sge sge;
> memset(&sge, 0, sizeof(sge));
> sge.addr = (uintptr_t)conn->local_buffer;
> sge.length = 8;
> sge.lkey = conn->local_mr->lkey;
> memset(&wr, 0, sizeof(wr));
> wr.wr_id= 0;
> wr.opcode = IBV_WR_ATOMIC_FETCH_AND_ADD;
> wr.sg_list = &sge;
> wr.num_sge = 1;
> wr.send_flags = IBV_SEND_SIGNALED;
> wr.wr.atomic.remote_addr= (uintptr_t)conn->peer_mr.addr;
> wr.wr.atomic.rkey = conn->peer_mr.rkey;
> wr.wr.atomic.compare_add= 1ULL;
>
> if (ibv_post_send(conn->qp, &wr, &bad_wr)) {
> fprintf(stderr, "Error, ibv_post_send() failed\n");
> die("");
> }

What libmlx5 are you using? Are you using MLNX_OFED?

I see that libmlx5 from openfabrics don't have support for
atomic operations yet (MLNX_OFED libmlx5 does have atomic support).

CC'ing Eli, the mlx5 maintainer.

Cheers,
Sagi.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: RDMA atomic operations fail
       [not found] ` <loom.20141224T040342-951-eS7Uydv5nfjZ+VzJOa5vwg@public.gmane.org>
  2014-12-25  8:42   ` Sagi Grimberg
@ 2014-12-28 10:13   ` Eli Cohen
  2014-12-29  1:26     ` Just Floaterions
  1 sibling, 1 reply; 5+ messages in thread
From: Eli Cohen @ 2014-12-28 10:13 UTC (permalink / raw)
  To: floaterions; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Wed, Dec 24, 2014 at 03:08:45AM +0000, floaterions wrote:
> When I try to submit an RDMA FETCH_AND_ADD or CMP_AND_SWAP ,
> the ibv_post_send() function fails, with Errno set to "Invalid argument".
> I have no such problems with RDMA READ/WRITE. 
> 
> I developed my entire code using RDMA CM (so no manual QP transitioning). 
> The queue pair is RC, and Atomic is enabled at the responder queue pair,
> and the memory regions are registered with atomic access.
> 
> I suspected that there might be the source of this problem,
> so I wrote a small program using libibcm where I transition the QPs manually
> and set the flags fro atomic operations:
> qp_attr->qp_access_flags = IBV_ACCESS_REMOTE_ATOMIC; 
> qp_attr->max_rd_atomic = <something greater than zero>; 
> qp_attr->max_dest_rd_atomic = <something greater than zero>; 
> 
> But still, the same error (invalid argument).
> 

Hi,
the current code in upstream does not support atomic operations.
Patches were sent already that will allow to use atomic operations
over mlx5 supported devices.

For now, if you query the HCA capabilites you should get ATOMIC_NONE
at the atomic_cap field when you query the device capabilites.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: RDMA atomic operations fail
  2014-12-28 10:13   ` Eli Cohen
@ 2014-12-29  1:26     ` Just Floaterions
  0 siblings, 0 replies; 5+ messages in thread
From: Just Floaterions @ 2014-12-29  1:26 UTC (permalink / raw)
  To: Eli Cohen; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Sagi Grimberg

Thank you both for your replies. I have a few follow-up questions:

1- How do I know which driver library I'm using (libmlx4, libmlx5,
..)? Also, how can I find out what version of libmlx5 is installed on
my machine?

2- Assuming that I'm using mlx5, how can I install those patches you
mentioned? As far as I know, all libraries on the cluster which I'm
working on are always kept up-to-date.

3- The atomic tests in Perftest benchmarking tool run successfully.
Does this mean the problem is not with the installed libraries? If so,
then what do you think might be the reasons that my code doesn't get
through?

Thank you

On Sun, Dec 28, 2014 at 5:13 AM, Eli Cohen <eli-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org> wrote:
> On Wed, Dec 24, 2014 at 03:08:45AM +0000, floaterions wrote:
>> When I try to submit an RDMA FETCH_AND_ADD or CMP_AND_SWAP ,
>> the ibv_post_send() function fails, with Errno set to "Invalid argument".
>> I have no such problems with RDMA READ/WRITE.
>>
>> I developed my entire code using RDMA CM (so no manual QP transitioning).
>> The queue pair is RC, and Atomic is enabled at the responder queue pair,
>> and the memory regions are registered with atomic access.
>>
>> I suspected that there might be the source of this problem,
>> so I wrote a small program using libibcm where I transition the QPs manually
>> and set the flags fro atomic operations:
>> qp_attr->qp_access_flags = IBV_ACCESS_REMOTE_ATOMIC;
>> qp_attr->max_rd_atomic = <something greater than zero>;
>> qp_attr->max_dest_rd_atomic = <something greater than zero>;
>>
>> But still, the same error (invalid argument).
>>
>
> Hi,
> the current code in upstream does not support atomic operations.
> Patches were sent already that will allow to use atomic operations
> over mlx5 supported devices.
>
> For now, if you query the HCA capabilites you should get ATOMIC_NONE
> at the atomic_cap field when you query the device capabilites.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-12-29  1:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-24  3:08 RDMA atomic operations fail floaterions
     [not found] ` <loom.20141224T040342-951-eS7Uydv5nfjZ+VzJOa5vwg@public.gmane.org>
2014-12-25  8:42   ` Sagi Grimberg
     [not found]     ` <CAJRcJr1QKB-7=xx6fD80RjfikR5ZJU+_6WTidXwCB-CocsPqzA@mail.gmail.com>
     [not found]       ` <CAJRcJr1QKB-7=xx6fD80RjfikR5ZJU+_6WTidXwCB-CocsPqzA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-12-28  9:59         ` Sagi Grimberg
2014-12-28 10:13   ` Eli Cohen
2014-12-29  1:26     ` Just Floaterions

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.