netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislav Fomichev <stfomichev@gmail.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com,
	pabeni@redhat.com, andrew+netdev@lunn.ch, horms@kernel.org,
	ap420073@gmail.com, asml.silence@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: Mon, 31 Mar 2025 13:39:59 -0700	[thread overview]
Message-ID: <Z-r9nxBna_WrOckQ@mini-arch> (raw)
In-Reply-To: <20250331194303.2026903-1-kuba@kernel.org>

On 03/31, Jakub Kicinski wrote:
> devmem code performs a number of safety checks to avoid having
> to reimplement all of them in the drivers. Move those to
> __net_mp_open_rxq() and reuse that function for binding to make
> sure that io_uring ZC also benefits from them.
> 
> While at it rename the queue ID variable to rxq_idx in
> __net_mp_open_rxq(), we touch most of the relevant lines.
> 
> Fixes: 6e18ed929d3b ("net: add helpers for setting a memory provider on an rx queue")
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> CC: ap420073@gmail.com
> CC: almasrymina@google.com
> CC: asml.silence@gmail.com
> CC: dw@davidwei.uk
> CC: sdf@fomichev.me
> ---
>  include/net/page_pool/memory_provider.h |  6 +++
>  net/core/devmem.c                       | 52 ++++++-------------------
>  net/core/netdev-genl.c                  |  6 ---
>  net/core/netdev_rx_queue.c              | 49 +++++++++++++++++------
>  4 files changed, 55 insertions(+), 58 deletions(-)
> 
> diff --git a/include/net/page_pool/memory_provider.h b/include/net/page_pool/memory_provider.h
> index b3e665897767..3724ac3c9fb2 100644
> --- a/include/net/page_pool/memory_provider.h
> +++ b/include/net/page_pool/memory_provider.h
> @@ -6,6 +6,7 @@
>  #include <net/page_pool/types.h>
>  
>  struct netdev_rx_queue;
> +struct netlink_ext_ack;
>  struct sk_buff;
>  
>  struct memory_provider_ops {
> @@ -24,8 +25,13 @@ void net_mp_niov_clear_page_pool(struct net_iov *niov);
>  
>  int net_mp_open_rxq(struct net_device *dev, unsigned ifq_idx,
>  		    struct pp_memory_provider_params *p);
> +int __net_mp_open_rxq(struct net_device *dev, unsigned int ifq_idx,
> +		      const struct pp_memory_provider_params *p,
> +		      struct netlink_ext_ack *extack);

Nit: you keep using ifq_idx here, but in the .c file you rename it to
rxq_idx. Not worth the respin..

Acked-by: Stanislav Fomichev <sdf@fomichev.me>

  reply	other threads:[~2025-03-31 20:40 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 [this message]
2025-04-01 11:37   ` Pavel Begunkov
2025-04-01 15:00     ` Jakub Kicinski
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=Z-r9nxBna_WrOckQ@mini-arch \
    --to=stfomichev@gmail.com \
    --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=kuba@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).