netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Pavel Begunkov <asml.silence@gmail.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com,
	pabeni@redhat.com, andrew+netdev@lunn.ch, horms@kernel.org,
	ap420073@gmail.com, almasrymina@google.com, dw@davidwei.uk,
	sdf@fomichev.me
Subject: Re: [PATCH net 1/2] net: move mp dev config validation to __net_mp_open_rxq()
Date: Tue, 1 Apr 2025 08:00:36 -0700	[thread overview]
Message-ID: <20250401080036.5aad536b@kernel.org> (raw)
In-Reply-To: <32917bbb-c27a-4a65-8ba6-1df5c4729c12@gmail.com>

On Tue, 1 Apr 2025 12:37:34 +0100 Pavel Begunkov wrote:
> > -	err = xa_alloc(&binding->bound_rxqs, &xa_idx, rxq, xa_limit_32b,
> > -		       GFP_KERNEL);
> > +	err = __net_mp_open_rxq(dev, rxq_idx, &mp_params, extack);
> >   	if (err)
> >   		return err;  
> 
> Was reversing the order b/w open and xa_alloc intentional?
> It didn't need __net_mp_close_rxq() before, which is a good thing
> considering the error handling in __net_mp_close_rxq is a bit
> flaky (i.e. the WARN_ON at the end).

Should have mentioned.. yes, intentional, otherwise we'd either have to
insert a potentially invalid rxq pointer into the xarray or duplicate
the rxq bounds check. Inserting invalid pointer and deleting it immediately
should be okay, since readers take the instance lock, but felt a little
dirty. In practice xa_alloc() failures should be extremely rare here so
I went with the reorder.

  reply	other threads:[~2025-04-01 15:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-31 19:42 [PATCH net 0/2] net: make memory provider install / close paths more common Jakub Kicinski
2025-03-31 19:43 ` [PATCH net 1/2] net: move mp dev config validation to __net_mp_open_rxq() Jakub Kicinski
2025-03-31 20:39   ` Stanislav Fomichev
2025-04-01 11:37   ` Pavel Begunkov
2025-04-01 15:00     ` Jakub Kicinski [this message]
2025-04-02 12:22       ` Pavel Begunkov
2025-04-02 18:46       ` Mina Almasry
2025-03-31 19:43 ` [PATCH net 2/2] net: avoid false positive warnings in __net_mp_close_rxq() Jakub Kicinski
2025-03-31 20:41   ` Stanislav Fomichev
2025-04-02 18:52   ` Mina Almasry
2025-04-02 23:24     ` Jakub Kicinski
2025-04-03  1:27       ` Jakub Kicinski
2025-04-02 15:35 ` [PATCH net 0/2] net: make memory provider install / close paths more common Taehee Yoo

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=20250401080036.5aad536b@kernel.org \
    --to=kuba@kernel.org \
    --cc=almasrymina@google.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=ap420073@gmail.com \
    --cc=asml.silence@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dw@davidwei.uk \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sdf@fomichev.me \
    /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).