[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b62ea2ac-aff3-4a00-bc3a-960c28bc5522@redhat.com>
Date: Thu, 13 Mar 2025 11:58:54 +0100
From: Paolo Abeni <pabeni@...hat.com>
To: Mina Almasry <almasrymina@...gle.com>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org,
kvm@...r.kernel.org, virtualization@...ts.linux.dev,
linux-kselftest@...r.kernel.org
Cc: Donald Hunter <donald.hunter@...il.com>, Jakub Kicinski
<kuba@...nel.org>, "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Simon Horman <horms@...nel.org>,
Jonathan Corbet <corbet@....net>, Andrew Lunn <andrew+netdev@...n.ch>,
Jeroen de Borst <jeroendb@...gle.com>,
Harshitha Ramamurthy <hramamurthy@...gle.com>,
Kuniyuki Iwashima <kuniyu@...zon.com>, Willem de Bruijn
<willemb@...gle.com>, David Ahern <dsahern@...nel.org>,
Neal Cardwell <ncardwell@...gle.com>, Stefan Hajnoczi <stefanha@...hat.com>,
Stefano Garzarella <sgarzare@...hat.com>, "Michael S. Tsirkin"
<mst@...hat.com>, Jason Wang <jasowang@...hat.com>,
Xuan Zhuo <xuanzhuo@...ux.alibaba.com>, Eugenio Pérez
<eperezma@...hat.com>, Shuah Khan <shuah@...nel.org>, sdf@...ichev.me,
asml.silence@...il.com, dw@...idwei.uk, Jamal Hadi Salim <jhs@...atatu.com>,
Victor Nogueira <victor@...atatu.com>, Pedro Tammela
<pctammela@...atatu.com>, Samiullah Khawaja <skhawaja@...gle.com>
Subject: Re: [PATCH net-next v7 8/9] net: check for driver support in netmem
TX
On 3/8/25 10:40 PM, Mina Almasry wrote:
> We should not enable netmem TX for drivers that don't declare support.
>
> Check for driver netmem TX support during devmem TX binding and fail if
> the driver does not have the functionality.
>
> Check for driver support in validate_xmit_skb as well.
>
> Signed-off-by: Mina Almasry <almasrymina@...gle.com>
> Acked-by: Stanislav Fomichev <sdf@...ichev.me>
>
> ---
>
> v5: https://lore.kernel.org/netdev/20250227041209.2031104-8-almasrymina@google.com/
> - Check that the dmabuf mappings belongs to the specific device the TX
> is being sent from (Jakub)
>
> v4:
> - New patch
>
> ---
> net/core/dev.c | 33 +++++++++++++++++++++++++++++++++
> net/core/devmem.h | 6 ++++++
> net/core/netdev-genl.c | 7 +++++++
> 3 files changed, 46 insertions(+)
>
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 1cb134ff7327..5553947123a0 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -3868,10 +3868,43 @@ int skb_csum_hwoffload_help(struct sk_buff *skb,
> }
> EXPORT_SYMBOL(skb_csum_hwoffload_help);
>
> +static struct sk_buff *validate_xmit_unreadable_skb(struct sk_buff *skb,
> + struct net_device *dev)
> +{
> + struct skb_shared_info *shinfo;
> + struct net_iov *niov;
> +
> + if (likely(skb_frags_readable(skb)))
> + goto out;
> +
> + if (likely(!dev->netmem_tx))
Minor nit: I think the above is actually unlikely. The skb is
unreadable: is supposed to be transmitted on a device supporting
netmem_tx, otherwise we are in exceptional/error path.
No need to repost just for this.
Thanks,
Paolo
Powered by blists - more mailing lists