Skip to contentSkip to conversation

RDMA atomic operations fail

DISCUSSION floaterions 3 participants 5 messages Dec 24, 2014 – Dec 29, 2014 3 messages not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 15 lines · floaterions

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>;

Quoted 3 lines

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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): CAJRcJr1QKB-7=xx6fD80RjfikR5ZJU+_6WTidXwCB-CocsPqzA@mail.gmail.com

A message that is not in the archive (sent off-list or not yet received): CAJRcJr1QKB-7=xx6fD80RjfikR5ZJU+_6WTidXwCB-CocsPqzA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#5 lore raw
Quoted 20 lines · Just Floaterions

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;

Quoted 4 lines

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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#6 lore raw
In reply to a message not in the archive
Quoted 8 lines · floaterions

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.

Quoted 9 lines

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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#7 lore raw

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

Quoted 19 lines · Eli Cohen
Quoted 8 lines · floaterions

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.

Quoted 9 lines

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).

Quoted 7 lines

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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html