netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: "Toke Høiland-Jørgensen" <toke@redhat.com>
Cc: Hangbin Liu <liuhangbin@gmail.com>,
	netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Jesper Dangaard Brouer <hawk@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	Jiri Pirko <jiri@resnulli.us>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Lorenzo Bianconi <lorenzo@kernel.org>,
	Andrii Nakryiko <andriin@fb.com>, Jussi Maki <joamaki@gmail.com>,
	Jay Vosburgh <jv@jvosburgh.net>,
	Andy Gospodarek <andy@greyhouse.net>,
	Jonathan Corbet <corbet@lwn.net>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	bpf@vger.kernel.org, Nikolay Aleksandrov <razor@blackwall.org>
Subject: Re: [PATCHv2 net-next 2/3] bonding: use correct return value
Date: Fri, 18 Oct 2024 15:21:04 +0100	[thread overview]
Message-ID: <20241018142104.GP1697@kernel.org> (raw)
In-Reply-To: <87o73hy7hh.fsf@toke.dk>

On Fri, Oct 18, 2024 at 01:29:30PM +0200, Toke Høiland-Jørgensen wrote:
> Simon Horman <horms@kernel.org> writes:
> 
> > On Fri, Oct 18, 2024 at 12:46:18AM +0000, Hangbin Liu wrote:
> >> On Thu, Oct 17, 2024 at 04:47:19PM +0200, Toke Høiland-Jørgensen wrote:
> >> > > diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> >> > > index f0f76b6ac8be..6887a867fe8b 100644
> >> > > --- a/drivers/net/bonding/bond_main.c
> >> > > +++ b/drivers/net/bonding/bond_main.c
> >> > > @@ -5699,7 +5699,7 @@ static int bond_xdp_set(struct net_device *dev, struct bpf_prog *prog,
> >> > >  		if (dev_xdp_prog_count(slave_dev) > 0) {
> >> > >  			SLAVE_NL_ERR(dev, slave_dev, extack,
> >> > >  				     "Slave has XDP program loaded, please unload before enslaving");
> >> > > -			err = -EOPNOTSUPP;
> >> > > +			err = -EEXIST;
> >> > 
> >> > Hmm, this has been UAPI since kernel 5.15, so can we really change it
> >> > now? What's the purpose of changing it, anyway?
> >> 
> >> I just think it should return EXIST when the error is "Slave has XDP program
> >> loaded". No special reason. If all others think we should not change it, I
> >> can drop this patch.
> >
> > Hi Toke,
> >
> > Could you add some colour to what extent user's might rely on this error code?
> >
> > Basically I think that if they do then we shouldn't change this.
> 
> Well, that's the trouble with UAPI, we don't really know. In libxdp and
> xdp-tools we look at the return code to provide a nicer error message,
> like:
> 
> https://github.com/xdp-project/xdp-tools/blob/master/lib/libxdp/libxdp.c#L615
> 
> and as a signal to fall back to loading the programme without a dispatcher:
> 
> https://github.com/xdp-project/xdp-tools/blob/master/lib/libxdp/libxdp.c#L1824
> 
> Both of these cases would be unaffected (or even improved) by this
> patch, so in that sense I don't have a concrete objection, just a
> general "userspace may react to this". In other words, my concern is
> more of a general "we don't know, so this seems risky". If any of you
> have more information about how bonding XDP is generally used, that may
> help get a better idea of this?

Yes, that is the trouble with the UAPI. I was hoping you might be able to
provide the clarity you ask for above. But alas, things are as clear as
mud.

In lieu of more information I suggest caution and dropping this change for
now.

-- 
pw-bot: cr

  reply	other threads:[~2024-10-18 14:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-17  2:06 [PATCHv2 net-next 0/3] Bonding: returns detailed error about XDP failures Hangbin Liu
2024-10-17  2:06 ` [PATCHv2 net-next 1/3] bonding: return detailed error when loading native XDP fails Hangbin Liu
2024-10-17 14:45   ` Toke Høiland-Jørgensen
2024-10-17  2:06 ` [PATCHv2 net-next 2/3] bonding: use correct return value Hangbin Liu
2024-10-17 14:47   ` Toke Høiland-Jørgensen
2024-10-18  0:46     ` Hangbin Liu
2024-10-18  9:41       ` Simon Horman
2024-10-18 11:29         ` Toke Høiland-Jørgensen
2024-10-18 14:21           ` Simon Horman [this message]
2024-10-19  0:51             ` Hangbin Liu
2024-10-19  9:19               ` Simon Horman
2024-10-17  2:06 ` [PATCHv2 net-next 3/3] Documentation: bonding: add XDP support explanation Hangbin Liu
2024-10-17  8:42   ` Nikolay Aleksandrov
2024-10-17  8:40 ` [PATCHv2 net-next 0/3] Bonding: returns detailed error about XDP failures Nikolay Aleksandrov
2024-10-17  9:26   ` Hangbin Liu

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=20241018142104.GP1697@kernel.org \
    --to=horms@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=andriin@fb.com \
    --cc=andy@greyhouse.net \
    --cc=ast@kernel.org \
    --cc=bigeasy@linutronix.de \
    --cc=bpf@vger.kernel.org \
    --cc=corbet@lwn.net \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hawk@kernel.org \
    --cc=jiri@resnulli.us \
    --cc=joamaki@gmail.com \
    --cc=john.fastabend@gmail.com \
    --cc=jv@jvosburgh.net \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuhangbin@gmail.com \
    --cc=lorenzo@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=razor@blackwall.org \
    --cc=toke@redhat.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).