* Positive or negative error return codes in rdma-core?
@ 2020-03-02 14:43 Andrew Boyer
2020-03-02 18:47 ` Jason Gunthorpe
2020-03-02 19:32 ` Hefty, Sean
0 siblings, 2 replies; 3+ messages in thread
From: Andrew Boyer @ 2020-03-02 14:43 UTC (permalink / raw
To: linux-rdma
Should rdma-core providers return positive or negative errors?
The siw version of resize_cq returns -EOPNOTSUPP, but the dummy routine returns +EOPNOTSUPP.
Thanks,
Andrew
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Positive or negative error return codes in rdma-core?
2020-03-02 14:43 Positive or negative error return codes in rdma-core? Andrew Boyer
@ 2020-03-02 18:47 ` Jason Gunthorpe
2020-03-02 19:32 ` Hefty, Sean
1 sibling, 0 replies; 3+ messages in thread
From: Jason Gunthorpe @ 2020-03-02 18:47 UTC (permalink / raw
To: Andrew Boyer; +Cc: linux-rdma
On Mon, Mar 02, 2020 at 09:43:03AM -0500, Andrew Boyer wrote:
> Should rdma-core providers return positive or negative errors?
All providers must follow the manual pages.
If the manual pages are unclear they should be fixed.
> The siw version of resize_cq returns -EOPNOTSUPP, but the dummy routine returns +EOPNOTSUPP.
siw is wrong:
# NAME
ibv_resize_cq - resize a completion queue (CQ)
# RETURN VALUE
**ibv_resize_cq()** returns 0 on success, or the value of errno on failure
(which indicates the failure reason).
Jason
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: Positive or negative error return codes in rdma-core?
2020-03-02 14:43 Positive or negative error return codes in rdma-core? Andrew Boyer
2020-03-02 18:47 ` Jason Gunthorpe
@ 2020-03-02 19:32 ` Hefty, Sean
1 sibling, 0 replies; 3+ messages in thread
From: Hefty, Sean @ 2020-03-02 19:32 UTC (permalink / raw
To: Andrew Boyer, linux-rdma@vger.kernel.org
> Should rdma-core providers return positive or negative errors?
Yes
Seriously, this varies by provider and call. Libfabric handles return values from verbs by passing them through a call that does something like this:
if (!ret)
return 0;
else if (ret == -1)
return -errno;
else
return -abs(ret);
The exception is poll_cq.
- Sean
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-03-02 19:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-02 14:43 Positive or negative error return codes in rdma-core? Andrew Boyer
2020-03-02 18:47 ` Jason Gunthorpe
2020-03-02 19:32 ` Hefty, Sean
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.