Article View: linux.kernel.netdev
Article #9375Re: [PATCH net v5 3/4] netdevsim: support devmem RX and TX bindings
From: netdev-bot+sashiko
Date: Sun, 01 Nov 2026 23:01
Date: Sun, 01 Nov 2026 23:01
82 lines
11253 bytes
11253 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] Not a bug (baseline: false positive).
--
netdevsim: support devmem RX and TX bindings
This patch sets a 64-bit DMA mask on the netdevsim bus device and turns on
NETMEM_TX_DMA on the netdevsim net_device. It also sets up the page pools
so they can be backed by unreadable netmem, which lets the devmem bind-rx
and bind-tx netlink operations be tested against netdevsim. pp_hold is
refused on memory-provider backed pools, and unreadable or net_iov skbs
are dropped in nsim_start_xmit().
> diff --git a/drivers/net/netdevsim/netdev.c b/drivers/net/netdevsim/netdev.c
> index eebc02ccc4a92..0372a9bd63bbb 100644
> --- a/drivers/net/netdevsim/netdev.c
> +++ b/drivers/net/netdevsim/netdev.c
> @@ -133,6 +133,10 @@ static netdev_tx_t nsim_start_xmit(struct sk_buff *skb, struct net_device *dev)
> int dr;
>
> rcu_read_lock();
> + if (!skb_frags_readable(skb) ||
> + (skb_shinfo(skb)->nr_frags &&
> + skb_frag_is_net_iov(&skb_shinfo(skb)->frags[0])))
> + goto out_drop_any;
> if (!nsim_ipsec_tx(ns, skb))
> goto out_drop_any;
>
[ ... ]
> @@ -1059,6 +1078,8 @@ static int nsim_init_netdevsim(struct netdevsim *ns)
> ns->netdev->netdev_ops = &nsim_netdev_ops;
> ns->netdev->stat_ops = &nsim_stat_ops;
> ns->netdev->queue_mgmt_ops = &nsim_queue_mgmt_ops;
> + if (ns->nsim_bus_dev->dev.dma_mask)
> + ns->netdev->netmem_tx = NETMEM_TX_DMA;
[Severity: Low]
This isn't a bug, but the docs and the driver don't quite match here.
Documentation/networking/netmem.rst describes the mode as:
NETMEM_TX_DMA: for physical devices that perform DMA.
nsim_init_netdevsim() sets NETMEM_TX_DMA, but nsim_start_xmit() above
drops every unreadable or net_iov skb.
As I understand it, NETMEM_TX_NO_DMA would not work for this test. That
is because netdev_find_netmem_tx_dev() only resolves a NO_DMA device by
following leased RX queues to a physical NETMEM_TX_DMA device:
net/core/netdev-genl.c:netdev_find_netmem_tx_dev() {
...
if (dev->netmem_tx == NETMEM_TX_DMA)
return dev;
if (dev->netmem_tx != NETMEM_TX_NO_DMA)
return NULL;
...
}
Traffic also behaves the same as before. Under NETMEM_TX_NONE,
validate_xmit_unreadable_skb() already freed these skbs. Now the driver
drops them and counts them through dev_dstats_tx_dropped().
Would it help to add a short comment next to this assignment? It could
say that netdevsim advertises NETMEM_TX_DMA only so the bind-tx control
path works, and that devmem TX data is dropped in nsim_start_xmit().
> netdev_lockdep_set_classes(ns->netdev);
>
> err = nsim_udp_tunnels_info_create(ns->nsim_dev, ns->netdev);
--
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261030083539.777877-1-almasrymina%40google.com
Technical Details
Message-ID:
<179357408589.3131.13149073708335764140@kernel.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-354360-linux-kernel-netdev=dewy.ruReferences:
<20261030083539.777877-4-almasrymina@google.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-354360-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net v5 3/4] netdevsim: support devmem RX and TX bindings Date: Sun, 01 Nov 2026 23:01:25 +0000 Organization: Usenet Network Message-ID: <179357408589.3131.13149073708335764140@kernel.org> References: <20261030083539.777877-4-almasrymina@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2792576"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:Zb5M2c32o/pHS5blF0oB8DltxDs= sha256:w+HGjX5L89fZSvHyWba8y0CWKQjQ4ApCMPgeuy2Jm6U= sha1:MpKGvlTIiuaolWiol7XKv5tlBHM= sha256:uEfzkZUTiqICkVo1iuXGAz5xyRcj49mlw+dyyYRpFRs= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 250331123AB; Mon, 2 Nov 2026 02:08:23 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -2.3 X-Spam-Status: No, score=-2.3 tagged_above=-9999 required=6.31 tests=[DCC_CHECK=1.1, DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8a91zdu_1GQM; Mon, 2 Nov 2026 02:08:19 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-354360-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 5EF65112003; Mon, 2 Nov 2026 02:08:14 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 4C59728E30; Sun, 1 Nov 2026 23:01:29 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1793574089; b=fITHZKz3lFwT2RnbHfqpaZ7HvjfwtkEdWX9KPecojTF4LCIUSHCLyCZCYKc5O86eOcQV NDjEqav+02m8PhIdNDaFDuDkHqDqaE2arUO3JDMMYfG0rCjfR18SlMDGb1lp5zR8k+KS3 VYq0WxpJxFaX4gkwJSYoQIf7cxcYW5ok7m7AkhZqTm3qC+t1hpMo91FyzY70346Yj0WJJ Z7m1SIs1Xr3UMgLBFo9qNS9Y5h3Myz7c2V99JAgf1XWUgPlUyeGheTsJwf13rHCNzEl4g wXmE81LjoktHnS68WrktX5kYMu3xebYMQIfuI7/tPqwFmAuzTFct0DMJft58BLnh6nQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793574089; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=t2MxZtB2T9Bz2tg5DIt4j1dXYuKYbfcmPZ03Fr/VSko=; b=bnRsRqy+5EQaNSoo7UZyk7flcBd2UMVyCGp6CuNpvq5VlFuhDIeqGRekQol+A/0Y6TZl /iBO+acIBiZ8QfGJDmMXMErUHWlID8zfvddww5OG5u31E6ySiKJrKg43qfnhI15AXnaZr 28cFqYU7xrRH8+JIS3PnjK+wG2xUK5zhFOatu0yVeockghtsF3CQpx+rjF72WBNqNqPlQ Qmwb+egqfTm/Q0G2tT/OTJVWsZmCgKyGcykpBJafIgbpBfB4OkS8ksowDBQ62IDQ3jhFt kzX8GpRrn+reCebOzGSPRZbIioHbR36g0FUiI6NyFwQasldrjsitxEKMFVsXlsWpRXw== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=avxvdOrw; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1ED0D606A337; Sun, 1 Nov 2026 23:01:29 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=avxvdOrw X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793574088; b=AtcKz9Nw/nWmMtB4U9ETzOkVqxCMpjDyxSFv7a1Q2H80/E+AsiTuLGbxMwBrk/RCcA+1 dx95Bv2zoZLTRO9JvdxtB/ublKm0k25NDK3TMI+80W68wDY6GaFePG7wVgzJ3WNL5eXpl Mx2d8KRkmrMz612+4lgJ4oKcJXUmzH7FM9OO2AlqyVLO34vGu+IdM22WtLmOVH0tM/eu8 tiYLyP6UvVRxVbtRCDAQYkng4bZt6LhQ6qm97zkCzfIsWNnMdpjIiKNW9YQ1yfiJIzBbA 29pWwNRxXZe9453tBPcKtiBhxIHjJdu4wEmnF4R8yxlHxxmmGCGQz7QTenb8PQdW5DA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793574088; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=t2MxZtB2T9Bz2tg5DIt4j1dXYuKYbfcmPZ03Fr/VSko=; b=y74rHxLKMNJ0vpsWxNuLB0xAzi1oYxBdipekDFTqUtSfZ9hHguexhXziQKjlVYVzGoyf Qkesbs6GpPQzpRyqQWZvbFgaLacuyH5zqH0f4MswlAL/7SatHYSS4LqKcKXPjBWCN58Au /C5wyyyyV2cuhZi0MHXBzPJr5MYuD5XxbY4u1prnkfsqIldDeR6PUiwC9hdcsW2467Wsj 1kr+96PvhCELjR8llq+D2mz+Q90E8j/98zCTfcuc2X7IF/Fu6Sk/GfFFIB2b4301vjCQj UzCZiUprOLv/5MEujEFygk/AOMziZ2mwolem2eDmXE/sTlvaWEQxSCTBkXBkwlbGEFA== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=avxvdOrw; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EBE2A606A329; Sun, 1 Nov 2026 23:01:27 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D3071F000C1; Sun, 1 Nov 2026 23:01:26 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1793574087; bh=t2MxZtB2T9Bz2tg5DIt4j1dXYuKYbfcmPZ03Fr/VSko=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=avxvdOrwTRHGrZq0iN80QYgJ56/4BguQdjjbV8AQlXIj9kslbw7j1K/EgI2SnSy1Z OrLwaVBYKoOBqB6oYBUuiNTW1ysAC2jWgZVIteuXetmmSGnp+DwaN4zOYE4CwhcMSn Ipu9cicjz3lSLSmITRtZ1ojXclq2ZEI3gyrGbc26x8yBkjQqz370PStx0m2Ys1Gf+F Nw/MrUWeasTOBcDeQFr0dXUqOLiaXicOSR6LF475ZOy395qWm2wtP6FvRj/qXbz7iR RaT9FHpjc8bVHIvt2oP3XnoLozkgZOL2f5DWUv3vPlihT1ackXnhwXsVP2pe6JmxJf /46WCm8kf8HPg== X-Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, pabeni@redhat.com, sdf@fomichev.me, kaiyuanz@google.com, kuba@kernel.org, bobbyeshleman@meta.com, asml.silence@gmail.com, dw@davidwei.uk, ap420073@gmail.com, davem@davemloft.net, edumazet@kernel.org, horms@kernel.org, shuah@kernel.org, sumit.semwal@linaro.org, christian.koenig@amd.com, phasta@kernel.org, andrew+netdev@lunn.ch, sdf.kernel@gmail.com, hawk@kernel.org, ilias.apalodimas@linaro.org, daniel@iogearbox.net, razor@blackwall.org, tariqt@nvidia.com, kaifengw@google.com, dtatulea@nvidia.com X-In-Reply-To: <20261030083539.777877-4-almasrymina@google.com> X-sashiko-severity: Low X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list