Re: [PATCH RESEND v5] rust: str: Use `core::CStr`, remove the custom `CStr` implementation

2024-08-24 Thread Trevor Gross
On Mon, Aug 19, 2024 at 10:39 AM Michal Rostecki wrote: > > From: Michal Rostecki You don't need this since the email already shows it is already from you :) Aiui this is only needed when forwarding a patch for someone else, or if you use a different commit email for some reason. > `CStr` becam

Re: [PATCH RESEND v5] rust: str: Use `core::CStr`, remove the custom `CStr` implementation

2024-08-24 Thread Trevor Gross
On Mon, Aug 19, 2024 at 10:43 AM Michal Rostecki wrote: > > On 8/19/24 17:36, Michal Rostecki wrote: > > From: Michal Rostecki > > > > `CStr` became a part of `core` library in Rust 1.75. This change replaces > > the custom `CStr` implementation with the one from `core`. [ very long snip ] > >

Re: [PATCH 1/2] tcp: add SO_PEEK_OFF socket option tor TCPv6

2024-08-24 Thread Eric Dumazet
On Fri, Aug 23, 2024 at 11:19 PM wrote: > > From: Jon Maloy > > When we added the SO_PEEK_OFF socket option to TCP we forgot > to add it even for TCP on IPv6. > > We do that here. > > Fixes: 05ea491641d3 ("tcp: add support for SO_PEEK_OFF socket option") > Reviewed-by: David Gibson > Reviewed-by

Re: [PATCH bpf-next 1/2] selftests: bpf: use KHDR_INCLUDES for the UAPI headers

2024-08-24 Thread Matthieu Baerts
Hi Alexei, Thank you for your reply! On 24/08/2024 00:28, Alexei Starovoitov wrote: > On Sat, Aug 17, 2024 at 7:51 AM Matthieu Baerts wrote: >> >> Hi Alexei, >> >> Thank you for the review. >> >> On 17/08/2024 09:22, Alexei Starovoitov wrote: >>> On Fri, Aug 16, 2024 at 7:56 PM Matthieu Baerts (

[PATCH 1/1 V2] Selftests: net: Set executable bit for shell script

2024-08-24 Thread David Hunter
Turn on the execution bit for the shell script file. The test is skipped when downloaded from the linux_mainline source files. Signed-off-by: David Hunter --- V1 --> V2 - Split the patch into two separate patches (one for each issue) - Included subject prefixes --- tools/testing

[PATCH net-next v22 00/13] Device Memory TCP

2024-08-24 Thread Mina Almasry
v22: https://patchwork.kernel.org/project/netdevbpf/list/?series=881158&state=* v22 aims to resolve the pending issue pointed to in v21, which is the interaction with xdp. In this series I rebase on top of the minor refactor which refactors propagating xdp configuration to slave devices: htt

[PATCH net-next v22 01/13] netdev: add netdev_rx_queue_restart()

2024-08-24 Thread Mina Almasry
Add netdev_rx_queue_restart(), which resets an rx queue using the queue API recently merged[1]. The queue API was merged to enable the core net stack to reset individual rx queues to actuate changes in the rx queue's configuration. In later patches in this series, we will use netdev_rx_queue_resta

[PATCH net-next v22 02/13] net: netdev netlink api to bind dma-buf to a net device

2024-08-24 Thread Mina Almasry
API takes the dma-buf fd as input, and binds it to the netdevice. The user can specify the rx queues to bind the dma-buf to. Suggested-by: Stanislav Fomichev Signed-off-by: Mina Almasry Reviewed-by: Donald Hunter Reviewed-by: Jakub Kicinski --- v16: - Use subset-of: queue queue-id instead of

[PATCH net-next v22 03/13] netdev: support binding dma-buf to netdevice

2024-08-24 Thread Mina Almasry
Add a netdev_dmabuf_binding struct which represents the dma-buf-to-netdevice binding. The netlink API will bind the dma-buf to rx queues on the netdevice. On the binding, the dma_buf_attach & dma_buf_map_attachment will occur. The entries in the sg_table from mapping will be inserted into a genpool

[PATCH net-next v22 04/13] netdev: netdevice devmem allocator

2024-08-24 Thread Mina Almasry
Implement netdev devmem allocator. The allocator takes a given struct netdev_dmabuf_binding as input and allocates net_iov from that binding. The allocation simply delegates to the binding's genpool for the allocation logic and wraps the returned memory region in a net_iov struct. Signed-off-by:

[PATCH net-next v22 05/13] page_pool: devmem support

2024-08-24 Thread Mina Almasry
Convert netmem to be a union of struct page and struct netmem. Overload the LSB of struct netmem* to indicate that it's a net_iov, otherwise it's a page. Currently these entries in struct page are rented by the page_pool and used exclusively by the net stack: struct { unsigned long pp_mag

[PATCH net-next v22 06/13] memory-provider: dmabuf devmem memory provider

2024-08-24 Thread Mina Almasry
Implement a memory provider that allocates dmabuf devmem in the form of net_iov. The provider receives a reference to the struct netdev_dmabuf_binding via the pool->mp_priv pointer. The driver needs to set this pointer for the provider in the net_iov. The provider obtains a reference on the netde

[PATCH net-next v22 07/13] net: support non paged skb frags

2024-08-24 Thread Mina Almasry
Make skb_frag_page() fail in the case where the frag is not backed by a page, and fix its relevant callers to handle this case. Signed-off-by: Mina Almasry Reviewed-by: Eric Dumazet --- v10: - Fixed newly generated kdoc warnings found by patchwork. While we're at it, fix the Return section

[PATCH net-next v22 11/13] net: add devmem TCP documentation

2024-08-24 Thread Mina Almasry
Add documentation outlining the usage and details of devmem TCP. Signed-off-by: Mina Almasry Reviewed-by: Bagas Sanjaya Reviewed-by: Donald Hunter --- v16: - Add documentation on unbinding the NIC from dmabuf (Donald). - Add note that any dmabuf should work (Donald). v9: https://lore.kernel

[PATCH net-next v22 10/13] net: add SO_DEVMEM_DONTNEED setsockopt to release RX frags

2024-08-24 Thread Mina Almasry
Add an interface for the user to notify the kernel that it is done reading the devmem dmabuf frags returned as cmsg. The kernel will drop the reference on the frags to make them available for reuse. Signed-off-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry Reviewe

[PATCH net-next v22 08/13] net: add support for skbs with unreadable frags

2024-08-24 Thread Mina Almasry
For device memory TCP, we expect the skb headers to be available in host memory for access, and we expect the skb frags to be in device memory and unaccessible to the host. We expect there to be no mixing and matching of device memory frags (unaccessible) with host memory frags (accessible) in the

[PATCH net-next v22 09/13] tcp: RX path for devmem TCP

2024-08-24 Thread Mina Almasry
In tcp_recvmsg_locked(), detect if the skb being received by the user is a devmem skb. In this case - if the user provided the MSG_SOCK_DEVMEM flag - pass it to tcp_recvmsg_devmem() for custom handling. tcp_recvmsg_devmem() copies any data in the skb header to the linear buffer, and returns a cmsg

[PATCH net-next v22 13/13] netdev: add dmabuf introspection

2024-08-24 Thread Mina Almasry
Add dmabuf information to page_pool stats: $ ./cli.py --spec ../netlink/specs/netdev.yaml --dump page-pool-get ... {'dmabuf': 10, 'id': 456, 'ifindex': 3, 'inflight': 1023, 'inflight-mem': 4190208}, {'dmabuf': 10, 'id': 455, 'ifindex': 3, 'inflight': 1023, 'inflight-mem': 4190208

[PATCH net-next v22 12/13] selftests: add ncdevmem, netcat for devmem TCP

2024-08-24 Thread Mina Almasry
ncdevmem is a devmem TCP netcat. It works similarly to netcat, but it sends and receives data using the devmem TCP APIs. It uses udmabuf as the dmabuf provider. It is compatible with a regular netcat running on a peer, or a ncdevmem running on a peer. In addition to normal netcat support, ncdevmem