linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Steve Wise <swise@opengridcomputing.com>
Cc: dsahern@gmail.com, stephen@networkplumber.org,
	netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
	BMT@zurich.ibm.com
Subject: Re: [PATCH RFC iproute2-next 1/2] rdma: add 'link add/delete' commands
Date: Wed, 28 Nov 2018 22:08:44 +0200	[thread overview]
Message-ID: <20181128200844.GQ4559@mtr-leonro.mtl.com> (raw)
In-Reply-To: <20181128200204.GO4559@mtr-leonro.mtl.com>

[-- Attachment #1: Type: text/plain, Size: 1644 bytes --]

On Wed, Nov 28, 2018 at 10:02:04PM +0200, Leon Romanovsky wrote:
> On Wed, Nov 28, 2018 at 01:34:14PM -0600, Steve Wise wrote:
> > ...
> >
> > >>> +	rd_prepare_msg(rd, RDMA_NLDEV_CMD_NEWLINK, &seq,
> > >>> +		       (NLM_F_REQUEST | NLM_F_ACK));
> > >>> +	mnl_attr_put_strz(rd->nlh, RDMA_NLDEV_ATTR_DEV_NAME, name);
> > >>> +	mnl_attr_put_strz(rd->nlh, RDMA_NLDEV_ATTR_LINK_TYPE, type);
> > >>> +	mnl_attr_put_strz(rd->nlh, RDMA_NLDEV_ATTR_NDEV_NAME, dev);
> > >>> +	ret = rd_send_msg(rd);
> > >>> +	if (ret)
> > >>> +		return ret;
> > >>> +
> > >>> +	ret = rd_recv_msg(rd, link_add_parse_cb, rd, seq);
> > >>> +	if (ret)
> > >>> +		perror(NULL);
> > >> Why do you need rd_recv_msg()? I think that it is not needed, at least
> > >> for rename, I didn't need it.
> > >> https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/tree/rdma/dev.c#n244
> > > To get the response of if it was successfully added.  It provides the
> > > errno value.
> > If I don't do the rd_recv_msg, then adding the same name twice fails
> > without any error notification.  Ditto for deleting a non-existent
> > link.  So the rd_recv_msg() allows getting the failure reason (and
> > detecting the failure). 
> >
>
> Shouldn't extack provide such information as part of NLM_F_ACK flag?
>
> just shooting into the air, will take more close look tomorrow.

OK, it was easier than I thought.

You are right, need both send and receive to get the reason.

Can you prepare general function and update rename part too?
Something like send_receive(...) with dummy callback for receive path.

Thanks

>
> Thanks
>
> >



[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

  reply	other threads:[~2018-11-28 20:08 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-28 16:25 [PATCH RFC iproute2-next 0/2] Dynamic rdma link creation Steve Wise
2018-09-13 17:19 ` [PATCH RFC iproute2-next 1/2] rdma: add 'link add/delete' commands Steve Wise
2018-11-28 18:26   ` Leon Romanovsky
2018-11-28 19:08     ` Steve Wise
2018-11-28 19:34       ` Steve Wise
2018-11-28 20:02         ` Leon Romanovsky
2018-11-28 20:08           ` Leon Romanovsky [this message]
2018-11-28 20:23             ` Steve Wise
2018-11-28 20:04       ` Leon Romanovsky
2018-11-28 20:07         ` Steve Wise
2018-11-28 20:13           ` Leon Romanovsky
2018-11-28 20:18             ` Steve Wise
2018-11-28 22:17               ` Jason Gunthorpe
2018-11-28 22:21                 ` Steve Wise
2018-11-28 22:25                   ` Jason Gunthorpe
2018-11-28 22:51                     ` Steve Wise
2018-11-28 15:16 ` [PATCH RFC iproute2-next 2/2] rdma: man page update for link add/delete Steve Wise

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=20181128200844.GQ4559@mtr-leonro.mtl.com \
    --to=leon@kernel.org \
    --cc=BMT@zurich.ibm.com \
    --cc=dsahern@gmail.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    --cc=swise@opengridcomputing.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;
as well as URLs for NNTP newsgroup(s).