0

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,

Daniil
  • 143
  • 3
  • 9

2 Answers2

0

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

kliteyn
  • 1,917
  • 11
  • 24
0

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 (i.e. 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

Roland
  • 6,227
  • 23
  • 29