From: Leon Romanovsky <leon@kernel.org>
To: "Håkon Bugge" <haakon.bugge@oracle.com>
Cc: Doug Ledford <dledford@redhat.com>,
Jason Gunthorpe <jgg@mellanox.com>,
linux-rdma@vger.kernel.org,
Mark Haywood <mark.haywood@oracle.com>
Subject: Re: [PATCH RDMA/netlink v2] RDMA/netlink: Adhere to returning zero on success
Date: Mon, 16 Dec 2019 19:20:02 +0200 [thread overview]
Message-ID: <20191216172002.GB66555@unreal> (raw)
In-Reply-To: <20191216120436.3204814-1-haakon.bugge@oracle.com>
On Mon, Dec 16, 2019 at 01:04:36PM +0100, Håkon Bugge wrote:
> In rdma_nl_rcv_skb(), the local variable err is assigned the return
> value of the supplied callback function, which could be one of
> ib_nl_handle_resolve_resp(), ib_nl_handle_set_timeout(), or
> ib_nl_handle_ip_res_resp(). These three functions all return skb->len
> on success.
>
> rdma_nl_rcv_skb() is merely a copy of netlink_rcv_skb(). The callback
> functions used by the latter have the convention: "Returns 0 on
> success or a negative error code".
>
> In particular, the statement (equal for both functions):
>
> if (nlh->nlmsg_flags & NLM_F_ACK || err)
>
> implies that rdma_nl_rcv_skb() always will ack a message, independent
> of the NLM_F_ACK being set in nlmsg_flags or not.
>
> The fix could be to change the above statement, but it is better to
> keep the two *_rcv_skb() functions equal in this respect and instead
> change the callback functions in the rdma subsystem to the correct
> convention.
>
> Suggested-by: Mark Haywood <mark.haywood@oracle.com>
> Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>
> Tested-by: Mark Haywood <mark.haywood@oracle.com>
> Fixes: 2ca546b92a02 ("IB/sa: Route SA pathrecord query through netlink")
> Fixes: ae43f8286730 ("IB/core: Add IP to GID netlink offload")
>
> ---
> v1 -> v2:
> * Realized sk_buff::len is unsigned, hence simply returning
> zero in the good case
> ---
> drivers/infiniband/core/addr.c | 2 +-
> drivers/infiniband/core/sa_query.c | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
Better to put Fixes above *-by tags.
Thanks,
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
next prev parent reply other threads:[~2019-12-16 17:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-16 12:04 [PATCH RDMA/netlink v2] RDMA/netlink: Adhere to returning zero on success Håkon Bugge
2019-12-16 17:20 ` Leon Romanovsky [this message]
2020-01-03 20:10 ` Jason Gunthorpe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191216172002.GB66555@unreal \
--to=leon@kernel.org \
--cc=dledford@redhat.com \
--cc=haakon.bugge@oracle.com \
--cc=jgg@mellanox.com \
--cc=linux-rdma@vger.kernel.org \
--cc=mark.haywood@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox