简体   繁体   中英

ibv_post_recv() return -1 instead of errno

function ibv_post_recv() return -1, but according to documentation it should return errno.

How to know the fail reason in this case?

Best Regards,

It returns -1 and sets errno. Check the errno value when the function returns.

What low-level hardware driver are you using? What version? I'm guessing it's libmlx4 (Mellanox ConnectX/ConnectX-2/ConnectX-3).

If so, versions >= libmlx4 1.0.2 actually have this fixed -- ibv_post_send() will return an error code rather than -1.

In any case (and this is actually not very dependent of low-level driver -- I think libmthca, libcxgb4, etc. are petty much the same), the reasons that ibv_post_send() might return an immediate error are:

  • send queue is full (ie number of sends posted with uncollected completions is >= size of send queue).

  • opcode in send WR is invalid

  • number of gather entries is invalid (either <= 0 or > max gs entries specified when send queue was created)

  • inline data is bigger than maximum inline data for send queue

EDIT: I see I read the question too fast and confused ibv_post_recv() and ibv_post_send() . The answer for ibv_post_recv() is pretty much the same, just a little simpler. Basically the only reasons why ibv_post_recv() might return an error are:

  • receive queue is full

  • number of scatter entries in a receive work request is invalid

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM