[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 16/53] migration/rdma: Fix or document problematic uses of
|
From: |
Juan Quintela |
|
Subject: |
Re: [PATCH v2 16/53] migration/rdma: Fix or document problematic uses of errno |
|
Date: |
Thu, 05 Oct 2023 08:46:07 +0200 |
|
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) |
Markus Armbruster <armbru@redhat.com> wrote:
> We use errno after calling Libibverbs functions that are not
> documented to set errno (manual page does not mention errno), or where
> the documentation is unclear ("returns [...] the value of errno on
> failure"). While this could be read as "sets errno and returns it",
> a glance at the source code[*] kills that hope:
>
> static inline int ibv_post_send(struct ibv_qp *qp, struct ibv_send_wr *wr,
> struct ibv_send_wr **bad_wr)
> {
> return qp->context->ops.post_send(qp, wr, bad_wr);
> }
>
> The callback can be
>
> static int mana_post_send(struct ibv_qp *ibqp, struct ibv_send_wr *wr,
> struct ibv_send_wr **bad)
> {
> /* This version of driver supports RAW QP only.
> * Posting WR is done directly in the application.
> */
> return EOPNOTSUPP;
> }
>
> Neither of them touches errno.
>
> One of these errno uses is easy to fix, so do that now. Several more
> will go away later in the series; add temporary FIXME commments.
> Three will remain; add TODO comments. TODO, not FIXME, because the
> bug might be in Libibverbs documentation.
>
> [*] https://github.com/linux-rdma/rdma-core.git
> commit 55fa316b4b18f258d8ac1ceb4aa5a7a35b094dcf
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
And here I am, re-merging from this patch O:-)