From: Jakub Kicinski <kuba@kernel.org>
To: David Wei <dw@davidwei.uk>
Cc: Jiri Pirko <jiri@resnulli.us>,
Sabrina Dubroca <sd@queasysnail.net>,
maciek@machnikowski.net, horms@kernel.org,
netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>
Subject: Re: [PATCH net-next v13 1/4] netdevsim: allow two netdevsim ports to be connected
Date: Mon, 26 Feb 2024 07:05:18 -0800 [thread overview]
Message-ID: <20240226070518.74898fe7@kernel.org> (raw)
In-Reply-To: <c51765ec-b072-4c01-8dce-c2fa51f1941c@davidwei.uk>
On Sat, 24 Feb 2024 09:33:02 -0800 David Wei wrote:
> >> + err = 0;
> >
> > Why zero..
>
> Sorry left over from a previous iteration.
>
> >
> >> + nsim_a = netdev_priv(dev_a);
> >> + peer = rtnl_dereference(nsim_a->peer);
> >> + if (peer) {
> >> + pr_err("Netdevsim %d:%u is already linked\n", netnsfd_a, ifidx_a);
> >> + goto out_err;
> >
> > I'd think if we hit this we should return -EBUSY?
> > Unless peer == dev_b, but that may be splitting hair.
>
> What would returning -EBUSY do?
This is continuation of the previous comment, you set err to zero,
so when device already has a peer user will get 0 (success)
They should get -EBUSY.
next prev parent reply other threads:[~2024-02-26 15:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-22 5:08 [PATCH net-next v13 0/4] netdevsim: link and forward skbs between ports David Wei
2024-02-22 5:08 ` [PATCH net-next v13 1/4] netdevsim: allow two netdevsim ports to be connected David Wei
2024-02-24 0:44 ` Jakub Kicinski
2024-02-24 17:33 ` David Wei
2024-02-26 15:05 ` Jakub Kicinski [this message]
2024-02-22 5:08 ` [PATCH net-next v13 2/4] netdevsim: forward skbs from one connected port to another David Wei
2024-02-22 5:08 ` [PATCH net-next v13 3/4] netdevsim: add selftest for forwarding skb between connected ports David Wei
2024-02-22 5:08 ` [PATCH net-next v13 4/4] netdevsim: fix rtnetlink.sh selftest David Wei
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=20240226070518.74898fe7@kernel.org \
--to=kuba@kernel.org \
--cc=davem@davemloft.net \
--cc=dw@davidwei.uk \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jiri@resnulli.us \
--cc=maciek@machnikowski.net \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sd@queasysnail.net \
/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).