Re: [PATCH v6 06/14] iommufd/viommu: Add iommufd_viommu_get_vdev_id helper

2025-02-19 Thread Nicolin Chen
On Tue, Feb 18, 2025 at 11:31:54AM -0400, Jason Gunthorpe wrote: > On Fri, Jan 24, 2025 at 04:30:35PM -0800, Nicolin Chen wrote: > > This is a reverse search v.s. iommufd_viommu_find_dev, as drivers may want > > to convert a struct device pointer (physical) to its virtual device ID for > > an event

Re: [PATCH net-next v3 5/6] net: devmem: Implement TX path

2025-02-19 Thread Pavel Begunkov
On 2/17/25 23:26, Mina Almasry wrote: On Thu, Feb 13, 2025 at 5:17 AM Pavel Begunkov wrote: ... It's asserting that sizeof(ubuf_info_msgzc) <= sizeof(skb->cb), and I'm guessing increasing skb->cb size is not really the way to go. What I may be able to do here is stash the binding somewhere in

Re: [PATCH v4 3/3] printf: implicate test line in failure messages

2025-02-19 Thread Tamir Duberstein
On Wed, Feb 19, 2025 at 3:41 PM Rasmus Villemoes wrote: > > On Fri, 14 Feb 2025 at 22:53, Tamir Duberstein wrote: > > > > This improves the failure output by pointing to the failing line at the > > top level of the test, e.g.: > > # test_number: EXPECTATION FAILED at lib/printf_kunit.c:103

[PATCH net-next v4 0/9] Device memory TCP TX

2025-02-19 Thread Mina Almasry
v4: https://lore.kernel.org/netdev/20250203223916.1064540-1-almasrym...@google.com/ === v4 mainly addresses the critical driver support issue surfaced in v3 by Paolo and Stan. Drivers aiming to support netmem_tx should make sure not to pass the netmem dma-addrs to the dma-mapping APIs, as these d

[PATCH net-next v4 1/9] net: add get_netmem/put_netmem support

2025-02-19 Thread Mina Almasry
Currently net_iovs support only pp ref counts, and do not support a page ref equivalent. This is fine for the RX path as net_iovs are used exclusively with the pp and only pp refcounting is needed there. The TX path however does not use pp ref counts, thus, support for get_page/put_page equivalent

[PATCH net-next v4 2/9] net: devmem: TCP tx netlink api

2025-02-19 Thread Mina Almasry
From: Stanislav Fomichev Add bind-tx netlink call to attach dmabuf for TX; queue is not required, only ifindex and dmabuf fd for attachment. Signed-off-by: Stanislav Fomichev Signed-off-by: Mina Almasry --- v3: - Fix ynl-regen.sh error (Simon). --- Documentation/netlink/specs/netdev.yaml |

[PATCH net-next v4 5/9] net: add devmem TCP TX documentation

2025-02-19 Thread Mina Almasry
Add documentation outlining the usage and details of the devmem TCP TX API. Signed-off-by: Mina Almasry --- v4: - Mention SO_BINDTODEVICE is recommended (me/Pavel). v2: - Update documentation for iov_base is the dmabuf offset (Stan) --- Documentation/networking/devmem.rst | 150 +

[PATCH net-next v4 3/9] net: devmem: Implement TX path

2025-02-19 Thread Mina Almasry
Augment dmabuf binding to be able to handle TX. Additional to all the RX binding, we also create tx_vec needed for the TX path. Provide API for sendmsg to be able to send dmabufs bound to this device: - Provide a new dmabuf_tx_cmsg which includes the dmabuf to send from. - MSG_ZEROCOPY with SCM_D

[PATCH net-next v4 4/9] net: devmem: make dmabuf unbinding scheduled work

2025-02-19 Thread Mina Almasry
The TX path may release the dmabuf in a context where we cannot wait. This happens when the user unbinds a TX dmabuf while there are still references to its netmems in the TX path. In that case, the netmems will be put_netmem'd from a context where we can't unmap the dmabuf, resulting in a BUG like

[PATCH net-next v4 6/9] net: enable driver support for netmem TX

2025-02-19 Thread Mina Almasry
Drivers need to make sure not to pass netmem dma-addrs to the dma-mapping API in order to support netmem TX. Add helpers and netmem_dma_*() helpers that enables special handling of netmem dma-addrs that drivers can use. Document in netmem.rst what drivers need to do to support netmem TX. Signed-

[PATCH net-next v4 8/9] net: check for driver support in netmem TX

2025-02-19 Thread Mina Almasry
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 --- v4: - New patch --

[PATCH net-next v4 9/9] selftests: ncdevmem: Implement devmem TCP TX

2025-02-19 Thread Mina Almasry
Add support for devmem TX in ncdevmem. This is a combination of the ncdevmem from the devmem TCP series RFCv1 which included the TX path, and work by Stan to include the netlink API and refactored on top of his generic memory_provider support. Signed-off-by: Mina Almasry Signed-off-by: Stanislav

[PATCH net-next v4 7/9] gve: add netmem TX support to GVE DQO-RDA mode

2025-02-19 Thread Mina Almasry
Use netmem_dma_*() helpers in gve_tx_dqo.c DQO-RDA paths to enable netmem TX support in that mode. Declare support for netmem TX in GVE DQO-RDA mode. Signed-off-by: Mina Almasry --- v4: - New patch --- drivers/net/ethernet/google/gve/gve_main.c | 4 drivers/net/ethernet/google/gve/gve_

Re: [PATCH v4 3/3] printf: implicate test line in failure messages

2025-02-19 Thread Rasmus Villemoes
On Fri, 14 Feb 2025 at 22:53, Tamir Duberstein wrote: > > This improves the failure output by pointing to the failing line at the > top level of the test, e.g.: > # test_number: EXPECTATION FAILED at lib/printf_kunit.c:103 > lib/printf_kunit.c:167: vsnprintf(buf, 256, "%#-12x", ...) wrote

Re: [PATCH net-next v3 5/6] net: devmem: Implement TX path

2025-02-19 Thread Mina Almasry
On Wed, Feb 19, 2025 at 2:40 PM Pavel Begunkov wrote: > > On 2/17/25 23:26, Mina Almasry wrote: > > On Thu, Feb 13, 2025 at 5:17 AM Pavel Begunkov > > wrote: > ... > > It's asserting that sizeof(ubuf_info_msgzc) <= sizeof(skb->cb), and > > I'm guessing increasing skb->cb size is not real

Re: [PATCH net-next v2] tun: Pad virtio headers

2025-02-19 Thread Paolo Abeni
Hi, On 2/15/25 7:04 AM, Akihiko Odaki wrote: > tun simply advances iov_iter when it needs to pad virtio header, > which leaves the garbage in the buffer as is. This will become > especially problematic when tun starts to allow enabling the hash > reporting feature; even if the feature is enabled,

Re: [PATCH v6 14/14] iommu/arm-smmu-v3: Set MEV bit in nested STE for DoS mitigations

2025-02-19 Thread Nicolin Chen
On Tue, Feb 18, 2025 at 02:52:29PM -0400, Jason Gunthorpe wrote: > On Tue, Feb 18, 2025 at 06:17:15PM +, Pranjal Shrivastava wrote: > > > > Is MEV available only in nested mode? Otherwise it perhaps makes > > > sense to turn it on in all configurations in IOMMUFD paths... > > > > I think the

Re: [PATCH v6 12/14] iommu/arm-smmu-v3: Introduce struct arm_smmu_vmaster

2025-02-19 Thread Nicolin Chen
On Tue, Feb 18, 2025 at 01:08:24PM -0400, Jason Gunthorpe wrote: > On Fri, Jan 24, 2025 at 04:30:41PM -0800, Nicolin Chen wrote: > > + int ret; > > struct arm_smmu_ste ste; > > struct arm_smmu_master *master = dev_iommu_priv_get(dev); > > + struct arm_smmu_attach_state state = { > > +

[PATCH 14/27] scripts/kernel-doc.py: move KernelDoc class to a separate file

2025-02-19 Thread Mauro Carvalho Chehab
In preparation for letting kerneldoc Sphinx extension to import Python libraries, move regex ancillary classes to a separate file. Signed-off-by: Mauro Carvalho Chehab --- scripts/kernel-doc.py | 1634 +- scripts/lib/kdoc/kdoc_parser.py | 1689 ++

[PATCH 00/27] Implement kernel-doc in Python

2025-02-19 Thread Mauro Carvalho Chehab
Hi Jon, This changeset contains the kernel-doc.py script to replace the verable kernel-doc originally written in Perl. As the previous versions, I tried to stay as close as possible of the original Perl implementation, as it helps to double check if each function was properly translated to Pytho

[PATCH 09/27] scripts/kernel-doc.py: add a Python parser

2025-02-19 Thread Mauro Carvalho Chehab
Maintaining kernel-doc has been a challenge, as there aren't many perl developers among maintainers. Also, the logic there is too complex. Having lots of global variables and using pure functions doesn't help. Rewrite the script in Python, placing most global variables inside classes. This should

Re: [PATCH net-next v3 04/14] net: ethernet: qualcomm: Initialize PPE buffer management for IPQ9574

2025-02-19 Thread Jie Luo
On 2/11/2025 9:14 PM, Andrew Lunn wrote: +/* Assign the share buffer number 1550 to group 0 by default. */ +static const int ipq9574_ppe_bm_group_config = 1550; To a large extent, the comment is useless. What should be in the comment is why, not what. Andrew OK, I will improve th

Re: [Patch v2] doc/RCU/listRCU: refine example code for eliminating stale data

2025-02-19 Thread Alan Huang
On Feb 18, 2025, at 08:50, Wei Yang wrote: > > This patch adjust the example code with following two purpose: > > * reduce the confusion on not releasing e->lock > * emphasize e is valid and not stale with e->lock held > > Signed-off-by: Wei Yang > CC: Boqun Feng > CC: Alan Huang > > ---

Re: [Patch v2] doc/RCU/listRCU: refine example code for eliminating stale data

2025-02-19 Thread Boqun Feng
On Tue, Feb 18, 2025 at 12:50:47AM +, Wei Yang wrote: > This patch adjust the example code with following two purpose: > > * reduce the confusion on not releasing e->lock > * emphasize e is valid and not stale with e->lock held > > Signed-off-by: Wei Yang > CC: Boqun Feng > CC: Alan Hua