Re: [RFC 0/6] Add multiple address spaces support to VDUSE

2025-06-19 Thread Eugenio Perez Martin
On Mon, Jun 9, 2025 at 7:51 AM Christoph Hellwig wrote: > > Before you add new features to vduse, please remove the broken abuse of > the DMA API first. Without that no new feature work should go into > this code. > Hi Christoph, This code does not touch the DMA API at all. Actually, we could e

Re: [PATCH v2 0/2] vringh small unused functions

2025-06-17 Thread Eugenio Perez Martin
On Tue, Jun 17, 2025 at 2:18 AM wrote: > > From: "Dr. David Alan Gilbert" > > Hi, > The following pair of patches remove a bunch of small functions > that have been unused for a long time. > Acked-by: Eugenio Pérez Thanks!

Re: [PATCH V3 00/19] virtio_ring in order support

2025-06-17 Thread Eugenio Perez Martin
On Mon, Jun 16, 2025 at 10:25 AM Jason Wang wrote: > > Hello all: > > This sereis tries to implement the VIRTIO_F_IN_ORDER to > virtio_ring. This is done by introducing virtqueue ops so we can > implement separate helpers for different virtqueue layout/features > then the in-order were implemented

Re: [RFC 5/6] vduse: reset group asid in reset

2025-06-12 Thread Eugenio Perez Martin
On Thu, Jun 12, 2025 at 2:33 AM Jason Wang wrote: > > On Fri, Jun 6, 2025 at 7:50 PM Eugenio Pérez wrote: > > > > Is the expected behavior with vdpa_sim and mlx. > > > > Signed-off-by: Eugenio Pérez > > --- > > drivers/vdpa/vdpa_user/vduse_dev.c | 6 ++ > > 1 file changed, 6 insertions(+) >

Re: [RFC 3/6] vduse: add vq group asid support

2025-06-12 Thread Eugenio Perez Martin
On Thu, Jun 12, 2025 at 2:30 AM Jason Wang wrote: > > On Fri, Jun 6, 2025 at 7:50 PM Eugenio Pérez wrote: > > > > Make one IOTLB domain per address space, and allow the driver to assign > > each ASID to a vq group. Each address space via an dedicated identifier > > (ASID). > > > > During vDPA de

Re: [RFC 1/6] vduse: add v1 API definition

2025-06-08 Thread Eugenio Perez Martin
On Mon, Jun 9, 2025 at 3:50 AM Jason Wang wrote: > > On Mon, Jun 9, 2025 at 9:41 AM Jason Wang wrote: > > > > On Fri, Jun 6, 2025 at 7:50 PM Eugenio Pérez wrote: > > > > > > This allows to define all functions checking the API version set by the > > > userland device. > > > > > > Signed-off-by:

Re: [RFC 2/6] vduse: add vq group support

2025-06-08 Thread Eugenio Perez Martin
On Mon, Jun 9, 2025 at 3:55 AM Jason Wang wrote: > > On Fri, Jun 6, 2025 at 7:50 PM Eugenio Pérez wrote: > > > > The virtqueue group is the minimal set of virtqueues that must share an > > address space. And the address space identifier could only be attached > > to a specific virtqueue group.

Re: [PATCH] virtio-vdpa: Remove virtqueue list

2025-05-30 Thread Eugenio Perez Martin
On Thu, May 29, 2025 at 9:30 AM Viresh Kumar wrote: > > The virtio vdpa implementation creates a list of virtqueues, while the > same is already available in the struct virtio_device. > > This list is never traversed though, and only the pointer to the struct > virtio_vdpa_vq_info is used in the c

Re: [PATCH V2 00/19] virtio_ring in order support

2025-05-28 Thread Eugenio Perez Martin
On Wed, May 28, 2025 at 8:42 AM Jason Wang wrote: > > Hello all: > > This sereis tries to implement the VIRTIO_F_IN_ORDER to > virtio_ring. This is done by introducing virtqueue ops so we can > implement separate helpers for different virtqueue layout/features > then the in-order were implemented

Re: [PATCH bpf-next/net v3 4/5] selftests/bpf: Add mptcp_subflow bpf_iter subtest

2025-05-20 Thread Martin KaFai Lau
On 5/19/25 3:04 AM, Matthieu Baerts wrote: +SEC("cgroup/getsockopt") +int iters_subflow(struct bpf_sockopt *ctx) +{ +    struct mptcp_subflow_context *subflow; +    struct bpf_sock *sk = ctx->sk; +    struct sock *ssk = NULL; +    struct mptcp_sock *msk; +    int local_ids = 0; + +    if (ctx->le

Re: [PATCH bpf-next/net v3 4/5] selftests/bpf: Add mptcp_subflow bpf_iter subtest

2025-05-16 Thread Martin KaFai Lau
() can now return NULL. - v3: - Use bpf_core_cast to get the msk instead of bpf_skc_to_mptcp_sock. - Drop bpf_mptcp_sock_acquire and bpf_mptcp_sock_release (Martin). - Adapt the commit message accordingly. - Remove no longer needed export to the mptcp_bpf.h file and adapt bpf_iter_mpt

Re: [PATCH bpf-next/net v3 2/5] bpf: Add mptcp_subflow bpf_iter

2025-05-16 Thread Martin KaFai Lau
this: mptcp_for_each_subflow(msk, subflow) kfunc(subflow); But in the MPTCP BPF program, this has not yet been implemented. As Martin suggested recently, this conn_list walking + modify-by-kfunc usage fits the bpf_iter use case. So this patch adds a new bpf_iter type named "mptcp_subflow&q

Re: [PATCH] vhost/net: remove zerocopy support

2025-05-15 Thread Eugenio Perez Martin
On Mon, May 12, 2025 at 5:21 PM Jon Kohler wrote: > > > > > On Apr 30, 2025, at 9:21 PM, Jon Kohler wrote: > > > > > > > >> On Apr 16, 2025, at 6:15 AM, Eugenio Perez Martin > >> wrote: > >> > >> !

Re: [PATCH bpf-next v1 1/2] bpf: Create cgroup storage if needed when updating link

2025-04-23 Thread Martin KaFai Lau
On 4/22/25 7:21 PM, Jiayuan Chen wrote: April 23, 2025 at 08:13, "Martin KaFai Lau" wrote: On 4/16/25 9:40 PM, Jiayuan Chen wrote: when we attach a prog without cgroup_storage map being used, cgroup_storage in struct bpf_prog_array_item is empty. Then, if we use BPF_LINK

Re: [PATCH bpf-next v1 1/2] bpf: Create cgroup storage if needed when updating link

2025-04-22 Thread Martin KaFai Lau
On 4/16/25 9:40 PM, Jiayuan Chen wrote: when we attach a prog without cgroup_storage map being used, cgroup_storage in struct bpf_prog_array_item is empty. Then, if we use BPF_LINK_UPDATE to replace old prog with a new one that uses the cgroup_storage map, we miss cgroup_storage being initiated.

Re: [PATCH] selftests/bpf: Fix null pointer check in skb_pkt_end.c

2025-04-22 Thread Martin KaFai Lau
On 4/22/25 11:23 AM, Prabhav Kumar Vaish wrote: Ensure that 'tcp' is checked for NULL before dereferencing. This resolves a potential null pointer dereference warning reported by static analysis. Signed-off-by: Prabhav Kumar Vaish --- tools/testing/selftests/bpf/progs/skb_pkt_end.c | 4 ++--

Re: [PATCH] vhost/net: remove zerocopy support

2025-04-16 Thread Eugenio Perez Martin
On Tue, Apr 8, 2025 at 8:28 AM Jason Wang wrote: > > On Tue, Apr 8, 2025 at 9:18 AM Jon Kohler wrote: > > > > > > > > > On Apr 6, 2025, at 7:14 PM, Jason Wang wrote: > > > > > > !---| > > > CAUTION: External Email > > > > > > |

Re: [PATCH 15/19] virtio_ring: factor out core logic of buffer detaching

2025-03-26 Thread Eugenio Perez Martin
On Mon, Mar 24, 2025 at 7:01 AM Jason Wang wrote: > > Factor out core logic of buffer detaching and leave the id population > to the caller so in order can just call the core logic. > Acked-by: Eugenio Pérez > Signed-off-by: Jason Wang > --- > drivers/virtio/virtio_ring.c | 17 +--

Re: [PATCH 13/19] virtio_ring: introduce virtqueue ops

2025-03-26 Thread Eugenio Perez Martin
On Mon, Mar 24, 2025 at 7:01 AM Jason Wang wrote: > > This patch introduces virtqueue ops which is a set of the callbacks > that will be called for different queue layout or features. This would > help to avoid branches for split/packed and will ease the future > implementation like in order. > A

Re: [PATCH 18/19] virtio_ring: factor out split indirect detaching logic

2025-03-26 Thread Eugenio Perez Martin
On Mon, Mar 24, 2025 at 7:02 AM Jason Wang wrote: > > Factor out the split indirect descriptor detaching logic in order to > make it be reused by the in order support. > Acked-by: Eugenio Pérez > Signed-off-by: Jason Wang > --- > drivers/virtio/virtio_ring.c | 63 -

Re: [PATCH 17/19] virtio_ring: move next_avail_idx to vring_virtqueue

2025-03-26 Thread Eugenio Perez Martin
On Mon, Mar 24, 2025 at 7:01 AM Jason Wang wrote: > > This variable is used by packed virtqueue now, moving it to > vring_virtqueue to make it possible to be reused by split virtqueue > in-order implementation. > Acked-by: Eugenio Pérez > Signed-off-by: Jason Wang > --- > drivers/virtio/virti

Re: [PATCH 16/19] virtio_ring: factor out core logic for updating last_used_idx

2025-03-26 Thread Eugenio Perez Martin
On Mon, Mar 24, 2025 at 7:01 AM Jason Wang wrote: > > Factor out the core logic for updating last_used_idx to be reused by > the packed in order implementation. > Acked-by: Eugenio Pérez > Signed-off-by: Jason Wang > --- > drivers/virtio/virtio_ring.c | 43 +---

Re: [PATCH 14/19] virtio_ring: determine descriptor flags at one time

2025-03-26 Thread Eugenio Perez Martin
On Mon, Mar 24, 2025 at 7:01 AM Jason Wang wrote: > > Let's determine the last descriptor by counting the number of sg. This > would be consistent with packed virtqueue implementation and ease the > future in-order implementation. > Acked-by: Eugenio Pérez > Signed-off-by: Jason Wang > --- >

Re: [PATCH 08/19] virtio_ring: switch to use vring_virtqueue for enable_cb_prepare variants

2025-03-26 Thread Eugenio Perez Martin
On Mon, Mar 24, 2025 at 6:44 AM Jason Wang wrote: > > Those variants are used internally so let's switch to use > vring_virtqueue as parameter to be consistent with other internal > virtqueue helpers. > Acked-by: Eugenio Pérez > Signed-off-by: Jason Wang > --- > drivers/virtio/virtio_ring.c |

Re: [PATCH 12/19] virtio_ring: use u16 for last_used_idx in virtqueue_poll_split()

2025-03-26 Thread Eugenio Perez Martin
On Mon, Mar 24, 2025 at 6:44 AM Jason Wang wrote: > > Use u16 for last_used_idx in virtqueue_poll_split() to align with the > spec. > > Signed-off-by: Jason Wang > --- > drivers/virtio/virtio_ring.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/virtio/virtio_ri

Re: [PATCH 11/19] virtio_ring: switch to use vring_virtqueue for detach_unused_buf variants

2025-03-26 Thread Eugenio Perez Martin
On Mon, Mar 24, 2025 at 6:44 AM Jason Wang wrote: > > Those variants are used internally so let's switch to use > vring_virtqueue as parameter to be consistent with other internal > virtqueue helpers. > Acked-by: Eugenio Pérez > Signed-off-by: Jason Wang > --- > drivers/virtio/virtio_ring.c |

Re: [PATCH 09/19] virtio_ring: use vring_virtqueue for enable_cb_delayed variants

2025-03-26 Thread Eugenio Perez Martin
On Mon, Mar 24, 2025 at 6:44 AM Jason Wang wrote: > > Those variants are used internally so let's switch to use > vring_virtqueue as parameter to be consistent with other internal > virtqueue helpers. > Acked-by: Eugenio Pérez > Signed-off-by: Jason Wang > --- > drivers/virtio/virtio_ring.c |

Re: [PATCH 06/19] virtio_ring: switch to use vring_virtqueue for virtqueue_add variants

2025-03-26 Thread Eugenio Perez Martin
On Mon, Mar 24, 2025 at 6:44 AM Jason Wang wrote: > > Those variants are used internally so let's switch to use > vring_virtqueue as parameter to be consistent with other internal > virtqueue helpers. > > Signed-off-by: Jason Wang Acked-by: Eugenio Pérez > --- > drivers/virtio/virtio_ring.c |

Re: [PATCH 10/19] virtio_ring: switch to use vring_virtqueue for disable_cb variants

2025-03-26 Thread Eugenio Perez Martin
On Mon, Mar 24, 2025 at 6:44 AM Jason Wang wrote: > > Those variants are used internally so let's switch to use > vring_virtqueue as parameter to be consistent with other internal > virtqueue helpers. > Acked-by: Eugenio Pérez > Signed-off-by: Jason Wang > --- > drivers/virtio/virtio_ring.c |

Re: [PATCH 07/19] virtio: switch to use vring_virtqueue for virtqueue_add variants

2025-03-26 Thread Eugenio Perez Martin
On Mon, Mar 24, 2025 at 6:44 AM Jason Wang wrote: > > Those variants are used internally so let's switch to use > vring_virtqueue as parameter to be consistent with other internal > virtqueue helpers. > > Signed-off-by: Jason Wang Acked-by: Eugenio Pérez > --- > drivers/virtio/virtio_ring.c |

Re: [PATCH 05/19] virtio_ring: switch to use vring_virtqueue for virtqueue_kick_prepare variants

2025-03-26 Thread Eugenio Perez Martin
On Mon, Mar 24, 2025 at 6:44 AM Jason Wang wrote: > > Those variants are used internally so let's switch to use > vring_virtqueue as parameter to be consistent with other internal > virtqueue helpers. > > Signed-off-by: Jason Wang Acked-by: Eugenio Pérez > --- > drivers/virtio/virtio_ring.c |

Re: [PATCH 04/19] virtio_ring: switch to use vring_virtqueue for virtqueue resize variants

2025-03-26 Thread Eugenio Perez Martin
On Mon, Mar 24, 2025 at 6:44 AM Jason Wang wrote: > > Those variants are used internally so let's switch to use > vring_virtqueue as parameter to be consistent with other internal > virtqueue helpers. > > Signed-off-by: Jason Wang Acked-by: Eugenio Pérez > --- > drivers/virtio/virtio_ring.c |

Re: [PATCH 02/19] virtio_ring: switch to use vring_virtqueue in virtqueue_poll variants

2025-03-26 Thread Eugenio Perez Martin
On Mon, Mar 24, 2025 at 6:43 AM Jason Wang wrote: > > Those variants are used internally so let's switch to use > vring_virtqueue as parameter to be consistent with other internal > virtqueue helpers. > > Signed-off-by: Jason Wang Acked-by: Eugenio Pérez > --- > drivers/virtio/virtio_ring.c |

Re: [PATCH 01/19] virtio_ring: rename virtqueue_reinit_xxx to virtqueue_reset_xxx()

2025-03-26 Thread Eugenio Perez Martin
On Mon, Mar 24, 2025 at 6:43 AM Jason Wang wrote: > > To be consistent with virtqueue_reset(). > > Signed-off-by: Jason Wang Acked-by: Eugenio Pérez > --- > drivers/virtio/virtio_ring.c | 12 ++-- > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/drivers/virtio/virtio

Re: [PATCH 00/19] virtio_ring in order support

2025-03-25 Thread Eugenio Perez Martin
On Mon, Mar 24, 2025 at 3:44 PM Lei Yang wrote: > > QE tested this series of patches with virtio-net regression tests, > everything works fine. > Hi Lei, Is it possible to test this series also with virtio-net-pci,...,in_order=on? Thanks! > Tested-by: Lei Yang > > On Mon, Mar 24, 2025 at 1:45

Re: [PATCH bpf-next 0/2] selftests/bpf: Migrate test_xdp_vlan.sh into test_progs

2025-03-19 Thread Martin KaFai Lau
On 3/18/25 3:25 AM, Bastien Curutchet wrote: Hi all, On 2/24/25 5:10 PM, Stanislav Fomichev wrote: On 02/21, Bastien Curutchet (eBPF Foundation) wrote: Hi all, This patch series continues the work to migrate the script tests into prog_tests. test_xdp_vlan.sh tests the ability of an XDP progr

Re: [PATCH] selftests/bpf: Move test_lwt_ip_encap to test_progs

2025-03-11 Thread Martin KaFai Lau
On 3/4/25 1:24 AM, Bastien Curutchet (eBPF Foundation) wrote: +int remove_routes_to_gredev(const char *ns1, const char *ns2, const char *vrf) +{ + SYS(fail, "ip -n %s route del %s dev veth5 %s", ns1, IP4_ADDR_GRE, vrf); + SYS(fail, "ip -n %s route del %s dev veth7 %s", ns2, IP4_ADDR_G

Re: [PATCH bpf-next v4 2/6] net: tun: enable transfer of XDP metadata to skb

2025-03-03 Thread Martin KaFai Lau
On 3/3/25 8:13 AM, Marcus Wichelmann wrote: Am 28.02.25 um 20:49 schrieb Martin KaFai Lau: On 2/27/25 6:23 AM, Marcus Wichelmann wrote: When the XDP metadata area was used, it is expected that the same metadata can also be accessed from TC, as can be read in the description of the

Re: [PATCH] vhost: fix VHOST_*_OWNER documentation

2025-03-03 Thread Eugenio Perez Martin
On Mon, Mar 3, 2025 at 9:52 AM Stefano Garzarella wrote: > > VHOST_OWNER_SET and VHOST_OWNER_RESET are used in the documentation > instead of VHOST_SET_OWNER and VHOST_RESET_OWNER respectively. > > To avoid confusion, let's use the right names in the documentation. > No change to the API, only the

Re: [PATCH bpf-next v4 2/6] net: tun: enable transfer of XDP metadata to skb

2025-02-28 Thread Martin KaFai Lau
On 2/27/25 6:23 AM, Marcus Wichelmann wrote: When the XDP metadata area was used, it is expected that the same metadata can also be accessed from TC, as can be read in the description of the bpf_xdp_adjust_meta helper function. In the tun driver, this was not yet implemented. To make this work,

Re: [PATCH bpf-next v1 1/3] bpf, sockmap: avoid using sk_socket after free

2025-02-27 Thread Martin KaFai Lau
On 2/26/25 5:22 AM, Jiayuan Chen wrote: Use RCU lock to protect sk_socket, preventing concurrent close and release by another thread. Because TCP/UDP are already within a relatively large critical section: ''' ip_local_deliver_finish rcu_read_lock ip_protocol_deliver_rcu tcp_rcv/udp

Re: [PATCH] vduse: add virtio_fs to allowed dev id

2025-02-25 Thread Eugenio Perez Martin
On Mon, Feb 24, 2025 at 10:51 PM Michael S. Tsirkin wrote: > > On Tue, Jan 21, 2025 at 11:33:46AM +0100, Eugenio Pérez wrote: > > A VDUSE device that implements virtiofs device works fine just by > > adding the device id to the whitelist. > > > > Signed-off-by: Eugenio Pérez > > > OK, but the com

Re: [RFC v2 5/5] virtiofs: Disable notifications more aggresively

2025-02-23 Thread Eugenio Perez Martin
On Mon, Feb 24, 2025 at 7:44 AM Eugenio Perez Martin wrote: > > On Mon, Feb 24, 2025 at 3:01 AM Jason Wang wrote: > > > > On Sat, Feb 22, 2025 at 1:07 AM Eugenio Pérez wrote: > > > > > > Disable notifications right before scheduling, instead of wai

Re: [RFC v2 5/5] virtiofs: Disable notifications more aggresively

2025-02-23 Thread Eugenio Perez Martin
On Mon, Feb 24, 2025 at 3:01 AM Jason Wang wrote: > > On Sat, Feb 22, 2025 at 1:07 AM Eugenio Pérez wrote: > > > > Disable notifications right before scheduling, instead of waiting until > > the work is running. > > > > After applying this patch, fio read test goes from 1191MiB/s to > > 1263.14Mi

Re: [RFC v2 1/5] vduse: add virtio_fs to allowed dev id

2025-02-23 Thread Eugenio Perez Martin
On Mon, Feb 24, 2025 at 2:57 AM Jason Wang wrote: > > On Sat, Feb 22, 2025 at 1:06 AM Eugenio Pérez wrote: > > > > A VDUSE device that implements virtiofs device works fine just by > > adding the device id to the whitelist. > > > > Signed-off-by: Eugenio Pérez > > Acked-by: Jason Wang > > --- >

Re: [PATCH vhost] vdpa/mlx5: Fix oversized null mkey longer than 32bit

2025-02-18 Thread Eugenio Perez Martin
On Mon, Feb 17, 2025 at 8:45 PM Dragos Tatulea wrote: > > From: Si-Wei Liu > > create_user_mr() has correct code to count the number of null keys > used to fill in a hole for the memory map. However, fill_indir() > does not follow the same to cap the range up to the 1GB limit > correspondinly. s

Re: [PATCH] virtio_snd.h: clarify that `controls` depends on VIRTIO_SND_F_CTLS

2025-02-14 Thread Eugenio Perez Martin
On Thu, Feb 13, 2025 at 5:18 PM Stefano Garzarella wrote: > > As defined in the specification, the `controls` field in the configuration > space is only valid/present if VIRTIO_SND_F_CTLS is negotiated. > > From https://docs.oasis-open.org/virtio/virtio/v1.3/virtio-v1.3.html: > > 5.14.4 Device

Re: Re: Re: Re: [PATCH 2/2] libbpf: BPF programs dynamic loading and attaching

2025-02-12 Thread Martin Kelly
On Mon, 2025-02-10 at 16:06 -0800, Andrii Nakryiko wrote: > > Tracking associated maps for a program is not necessary. As long as > > the last BPF program using the BPF map is unloaded, the kernel will > > automatically free not-anymore-referenced BPF map. Note that > > bpf_object itself will keep

Re: Re: Re: [PATCH 2/2] libbpf: BPF programs dynamic loading and attaching

2025-02-07 Thread Martin Kelly
On Wed, 2025-02-05 at 14:33 -0800, Andrii Nakryiko wrote: > > > > > > > > I see two ways forward for you. Either you can break apart your > > > > BPF > > > > object of ~100 BPF programs into more independent BPF objects > > > > > > (seeing > > > > that programs can be independently loaded/unloaded

Re: [PATCH bpf-next v4 12/14] selftests/bpf: test_xdp_veth: Add XDP broadcast redirection tests

2025-01-31 Thread Martin KaFai Lau
On 1/30/25 11:21 PM, Bastien Curutchet (eBPF Foundation) wrote: +#define BROADCAST_REDIRECT_SKEL_NB 2 +static void xdp_veth_broadcast_redirect(u32 attach_flags, u64 redirect_flags) +{ + struct prog_configuration prog_cfg[VETH_PAIRS_COUNT] = { + { + .l

Re: Re: [PATCH 2/2] libbpf: BPF programs dynamic loading and attaching

2025-01-28 Thread Martin Kelly
On Fri, 2025-01-24 at 10:31 -0800, Andrii Nakryiko wrote: > > On Wed, Jan 22, 2025 at 1:53 PM Slava Imameev > > wrote: > > > > > > > > BPF programs designated as dynamically loaded can be loaded and > > > > attached independently after the initial bpf_object loading and > > > > attaching. > > > >

Re: [PATCH bpf-next v3 12/14] selftests/bpf: test_xdp_veth: Add XDP broadcast redirection tests

2025-01-28 Thread Martin KaFai Lau
On 1/28/25 1:57 AM, Bastien Curutchet (eBPF Foundation) wrote: Set the tests to run serially to avoid conflicts with test_xdp_veth_redirect I think this has been fixed in v3? Others lgtm also. Thanks for working on this. +void test_xdp_veth_broadcast_redirect(void) +{ + if (test__start

Re: [PATCH bpf-next v3 09/14] selftests/bpf: test_xdp_veth: Use unique names

2025-01-28 Thread Martin KaFai Lau
On 1/28/25 1:57 AM, Bastien Curutchet (eBPF Foundation) wrote: +#define NO_IP "NO_IP" #define PROG_NAME_MAX_LEN 128 +#define NS_NAME_MAX_LEN32 struct veth_configuration { char local_veth[VETH_NAME_MAX_LEN]; /* Interface in main namespac

Re: [PATCH bpf-next v3 01/14] selftests/bpf: helpers: Add append_tid()

2025-01-28 Thread Martin KaFai Lau
On 1/28/25 1:57 AM, Bastien Curutchet (eBPF Foundation) wrote: Some tests can't be run in parallel because they use same namespace names or veth names. Create an helper that appends the thread ID to a given string. 8 characters are used for it (7 digits + '\0') Signed-off-by: Bastien Curutchet

Re: [PATCH bpf-next/net v2 7/7] selftests/bpf: Add mptcp_subflow bpf_iter subtest

2025-01-23 Thread Martin KaFai Lau
On 12/19/24 7:46 AM, Matthieu Baerts (NGI0) wrote: +SEC("cgroup/getsockopt") +int iters_subflow(struct bpf_sockopt *ctx) +{ + struct mptcp_subflow_context *subflow; + struct bpf_sock *sk = ctx->sk; + struct sock *ssk = NULL; + struct mptcp_sock *msk; + int local_ids

Re: [PATCH bpf-next/net v2 5/7] bpf: Acquire and release mptcp socket

2025-01-23 Thread Martin KaFai Lau
On 12/19/24 7:46 AM, Matthieu Baerts (NGI0) wrote: From: Geliang Tang The KF_TRUSTED_ARGS flag is used for bpf_iter_mptcp_subflow_new, it indicates that the all pointer arguments are valid. It's necessary to add a KF_ACQUIRE helper to get valid "msk". This feels wrong. It forces an unnecessar

Re: [PATCH bpf-next/net v2 4/7] bpf: Add mptcp_subflow bpf_iter

2025-01-23 Thread Martin KaFai Lau
this: mptcp_for_each_subflow(msk, subflow) kfunc(subflow); But in the MPTCP BPF program, this has not yet been implemented. As Martin suggested recently, this conn_list walking + modify-by-kfunc usage fits the bpf_iter use case. So this patch adds a new bpf_iter type named "mptcp_subflow&q

Re: [RFC 3/5] virtiofs: Move stack sg to fuse_req

2025-01-22 Thread Eugenio Perez Martin
On Thu, Jan 23, 2025 at 2:54 AM Jason Wang wrote: > > On Thu, Jan 23, 2025 at 12:32 AM Eugenio Pérez wrote: > > > > We need to move the map and unmap out of virtiofs queue lock. We need to > > store the unmap sgs to call virtqueue_unmap_sgs, so use the request > > itself. > > > > TODO: We need t

Re: [RFC 2/5] virtio_ring: introduce virtqueue_map/unmap_sgs()

2025-01-22 Thread Eugenio Perez Martin
On Thu, Jan 23, 2025 at 2:51 AM Jason Wang wrote: > > On Thu, Jan 23, 2025 at 12:32 AM Eugenio Pérez wrote: > > > > From: Jason Wang > > > > Introduce new virtqueue DMA operations which allows the drivers that > > want to make use of the premapping API but operate at the sg level. > > > > Note t

Re: [PATCH] vduse: add virtio_fs to allowed dev id

2025-01-22 Thread Eugenio Perez Martin
On Thu, Jan 23, 2025 at 2:50 AM Jason Wang wrote: > > On Wed, Jan 22, 2025 at 11:49 PM Stefan Hajnoczi wrote: > > > > On Tue, Jan 21, 2025 at 11:33:46AM +0100, Eugenio Pérez wrote: > > > A VDUSE device that implements virtiofs device works fine just by > > > adding the device id to the whitelist.

Re: [PATCH bpf-next/net v2 0/7] bpf: Add mptcp_subflow bpf_iter support

2025-01-16 Thread Martin KaFai Lau
. - Patch 3: remove two kfunc, more restrictions. (Martin) - Patch 4: add BUILD_BUG_ON(), more restrictions. (Martin) - Patch 7: adaptations due to modifications in patches 1-4. - Link to v1: https://lore.kernel.org/r/20241108-bpf-next-net-mptcp-bpf_iter-subflows-v1-0-cf1695303...@kernel.org The v2

Re: [PATCH bpf-next v2 2/3] selftests/bpf: Migrate test_xdp_redirect.sh to xdp_do_redirect.c

2025-01-10 Thread Martin KaFai Lau
On 1/10/25 1:21 AM, Bastien Curutchet (eBPF Foundation) wrote: +static void ping_test(struct test_data *data) +{ + struct test_xdp_redirect *skel = NULL; + struct xdp_dummy *skel_dummy = NULL; + struct nstoken *nstoken = NULL; + int i, ret; + + skel_dummy = xdp_dummy

Re: [PATCH 2/3] selftests/bpf: Migrate test_xdp_redirect.sh to xdp_do_redirect.c

2025-01-07 Thread Martin KaFai Lau
On 1/3/25 2:10 AM, Bastien Curutchet (eBPF Foundation) wrote: +static int ping_setup(struct test_data *data) +{ + struct nstoken *nstoken = NULL; + int i; + + data->ns[0] = netns_new(NS0, false); + if (!ASSERT_OK_PTR(data->ns[0], "create ns")) + return -1; +

Re: [PATCH bpf-next 2/2] selftests/bpf: Migrate test_xdp_meta.sh into xdp_context_test_run.c

2024-12-06 Thread Martin KaFai Lau
On 12/6/24 12:12 AM, Bastien Curutchet wrote: +void test_xdp_context_functional(void) +{ + LIBBPF_OPTS(bpf_tc_hook, tc_hook, .attach_point = BPF_TC_INGRESS); + LIBBPF_OPTS(bpf_tc_opts, tc_opts, .handle = 1, .priority = 1); + struct bpf_program *tc_prog, *xdp_prog; + struct

Re: [PATCH bpf v4 0/2] bpf: fix recursive lock and add test

2024-11-18 Thread Martin KaFai Lau
ecause the issue of deadlock is inevitable. Acked-by: Martin KaFai Lau Jakub, please help to land it to the net tree. Thanks!

Re: [PATCH bpf-next/net 2/5] bpf: Add mptcp_subflow bpf_iter

2024-11-11 Thread Martin KaFai Lau
this: mptcp_for_each_subflow(msk, subflow) kfunc(subflow); But in the MPTCP BPF program, this has not yet been implemented. As Martin suggested recently, this conn_list walking + modify-by-kfunc usage fits the bpf_iter use case. So this patch adds a new bpf_iter type named "mptcp_subflow&q

Re: [PATCH bpf-next/net 1/5] bpf: Register mptcp common kfunc set

2024-11-11 Thread Martin KaFai Lau
On 11/8/24 7:52 AM, Matthieu Baerts (NGI0) wrote: From: Geliang Tang MPTCP helper mptcp_sk() is used to convert struct sock to mptcp_sock. Helpers mptcp_subflow_ctx() and mptcp_subflow_tcp_sock() are used to convert between struct mptcp_subflow_context and sock. They all will be used in MPTCP B

Re: [PATCH][next] virtio_vdpa: remove redundant check on desc

2024-11-07 Thread Eugenio Perez Martin
On Thu, Nov 7, 2024 at 2:21 PM Colin Ian King wrote: > > The boolean variable has_affinity is true when desc is non-null and > ops->set_vq_affinity is non-null. Hence the call to create_affinity_masks > does not need to check for desc being non-null is redundant when > has_affinity is true, so it

Re: [PATCH] vdpa/mlx5: Fix error path during device add

2024-11-06 Thread Eugenio Perez Martin
On Tue, Nov 5, 2024 at 7:52 PM Dragos Tatulea wrote: > > In the error recovery path of mlx5_vdpa_dev_add(), the cleanup is > executed and at the end put_device() is called which ends up calling > mlx5_vdpa_free(). This function will execute the same cleanup all over > again. Most resources support

Re: [PATCH bpf-next] selftests/bpf: Fix compile error when MPTCP not support

2024-10-30 Thread Martin KaFai Lau
On 10/30/24 9:31 AM, Matthieu Baerts wrote: Hi Tao, BPF maintainers, On 30/10/2024 12:12, Tao Chen wrote: 在 2024/10/30 18:49, Matthieu Baerts 写道: Hi Tao Chen, Thank you for having shared this patch. On 30/10/2024 11:01, Tao Chen wrote: Fix compile error when MPTCP feature not support, thoug

Re: [PATCH bpf-next 6/6] selftests/bpf: remove test_tcp_check_syncookie

2024-10-18 Thread Martin KaFai Lau
On 10/16/24 11:35 AM, Alexis Lothoré (eBPF Foundation) wrote: .../bpf/progs/test_tcp_check_syncookie_kern.c | 167 .../selftests/bpf/test_tcp_check_syncookie.sh | 85 .../selftests/bpf/test_tcp_check_syncookie_user.c | 213 - Nice. Le

Re: [PATCH bpf-next 4/6] selftests/bpf: add ipv4 and dual ipv4/ipv6 support in btf_skc_cls_ingress

2024-10-18 Thread Martin KaFai Lau
On 10/16/24 11:35 AM, Alexis Lothoré (eBPF Foundation) wrote: btf_skc_cls_ingress test currently checks that syncookie and bpf_sk_assign/release helpers behave correctly in multiple scenarios, but only with ipv4 socket. Increase those helpers coverage by adding testing support for IPv6-only sock

Re: [PATCH bpf-next 2/6] selftests/bpf: add missing ns cleanups in btf_skc_cls_ingress

2024-10-18 Thread Martin KaFai Lau
On 10/16/24 11:35 AM, Alexis Lothoré (eBPF Foundation) wrote: btf_skc_cls_ingress.c currently runs two subtests, and create a dedicated network namespace for each, but never cleans up the created namespace once the test has ended. Add missing namespace cleanup after each namespace to avoid accum

Re: [PATCH bpf-next v3 2/3] selftests/bpf: make xdp_cpumap_attach keep redirect prog attached

2024-10-10 Thread Martin KaFai Lau
On 10/9/24 3:12 AM, Alexis Lothoré (eBPF Foundation) wrote: Current test only checks attach/detach on cpu map type program, and so does not check that it can be properly executed, neither that it redirects correctly. Update the existing test to extend its coverage: - keep the redirected program

Re: [PATCH bpf-next v2] selftests/bpf: convert test_xdp_features.sh to test_progs

2024-10-03 Thread Martin KaFai Lau
On 9/24/24 6:37 PM, Martin KaFai Lau wrote: There are other .sh tests that could better use the test_progs migration. In particular the ones without existing test coverage. For non XDP related, test_tcp_check_syncookie.sh, test_flow_dissector.sh, and test_tc_edt.sh should be the good ones. I

Re: [PATCH net v4 2/2] bpf: selftests: send packet to devmap redirect XDP

2024-10-02 Thread Martin KaFai Lau
On 9/11/24 1:41 AM, Florian Kauer wrote: @@ -25,14 +28,11 @@ static void test_xdp_with_devmap_helpers(void) if (!ASSERT_OK_PTR(skel, "test_xdp_with_devmap_helpers__open_and_load")) return; - dm_fd = bpf_program__fd(skel->progs.xdp_redir_prog); - err = bpf_xdp_att

Re: [PATCH bpf-next v3 2/2] selftests/bpf: Setget_sockopt add a test for tcp over ipv4 via ipv6

2024-09-30 Thread Martin KaFai Lau
On 9/14/24 3:32 AM, Feng zhou wrote: From: Feng Zhou This patch adds a test for TCP over IPv4 via INET6 API. Signed-off-by: Feng Zhou --- .../selftests/bpf/prog_tests/setget_sockopt.c | 33 +++ .../selftests/bpf/progs/setget_sockopt.c | 13 ++-- 2 files changed, 4

Re: [PATCH bpf-next v3 1/2] bpf: Fix bpf_get/setsockopt to tos not take effect when TCP over IPv4 via INET6 API

2024-09-30 Thread Martin KaFai Lau
On 9/14/24 3:32 AM, Feng zhou wrote: From: Feng Zhou when TCP over IPv4 via INET6 API, bpf_get/setsockopt with ipv4 will I think you meant bpf_get/setsockopt with SOL_IP will fail. so s/ipv4/SOL_IP/? fail, because sk->sk_family is AF_INET6. With ipv6 will success, not take effect, because i

Re: [PATCH bpf-next v2 2/2] bpf, selftests: Add test case for cgroup skb to get net_cls classid helpers

2024-09-30 Thread Martin KaFai Lau
On 9/18/24 12:45 AM, Feng zhou wrote: From: Feng Zhou This patch adds a test for cgroup skb to get classid. Signed-off-by: Feng Zhou --- .../bpf/prog_tests/cg_skb_get_classid.c | 87 +++ .../selftests/bpf/progs/cg_skb_get_classid.c | 19 2 files changed, 106 in

Re: [PATCH bpf-next v2] selftests/bpf: convert test_xdp_features.sh to test_progs

2024-09-25 Thread Martin KaFai Lau
On 9/25/24 3:37 AM, Martin KaFai Lau wrote: I am not sure which case in xdp_features.c does not have existing coverage in test_progs. From a quick look, it seems only BPF_MAP_TYPE_CPUMAP is missing (please check)? Re: CPUMAP, I noticed there is a xdp_(cpu)map_attach.c test but it only does

Re: [PATCH net v4 0/2] bpf: devmap: provide rxq after redirect

2024-09-25 Thread Martin KaFai Lau
On 9/19/24 11:12 AM, Paolo Abeni wrote: On 9/11/24 10:41, Florian Kauer wrote: rxq contains a pointer to the device from where the redirect happened. Currently, the BPF program that was executed after a redirect via BPF_MAP_TYPE_DEVMAP* does not have it set. Add bugfix and related selftest. Si

Re: [PATCH bpf-next v2] selftests/bpf: convert test_xdp_features.sh to test_progs

2024-09-24 Thread Martin KaFai Lau
On 9/22/24 12:04 PM, Alexis Lothoré wrote: Hello all, sorry for the slow feedback, I have been off last week. On 9/14/24 15:38, Jakub Kicinski wrote: On Sat, 14 Sep 2024 11:25:47 +0200 Lorenzo Bianconi wrote: On Sep 13, Martin KaFai Lau wrote: test a physical network device that supports a

Re: [RFC PATCH 2/3] ipv6: Run a reverse sk_lookup on sendmsg.

2024-09-24 Thread Martin KaFai Lau
On 9/17/24 6:15 PM, Tiago Lam wrote: On Fri, Sep 13, 2024 at 11:24:09AM -0700, Martin KaFai Lau wrote: On 9/13/24 2:39 AM, Tiago Lam wrote: This follows the same rationale provided for the ipv4 counterpart, where it now runs a reverse socket lookup when source addresses and/or ports are

Re: [PATCH bpf-next v1] selftests/bpf:Enhance bpf ability to detect ksym read error by libcap

2024-09-24 Thread Martin KaFai Lau
On 9/14/24 11:24 AM, Lin Yikai wrote: diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index 04716a5e43f1..369c5ad8fc4a 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -183,7 +183,7 @@ NON_CHECK_FEAT_TARGETS

Re: [PATCH bpf-next/net v6 3/3] selftests/bpf: Add mptcp subflow subtest

2024-09-13 Thread Martin KaFai Lau
On 9/11/24 8:16 AM, Matthieu Baerts (NGI0) wrote: +static void test_subflow(void) +{ + int cgroup_fd, prog_fd, err; + struct mptcp_subflow *skel; + struct nstoken *nstoken; + struct bpf_link *link; + + cgroup_fd = test__join_cgroup("/mptcp_subflow"); + if (!ASS

Re: [PATCH bpf-next/net v6 2/3] selftests/bpf: Add getsockopt to inspect mptcp subflow

2024-09-13 Thread Martin KaFai Lau
On 9/11/24 8:16 AM, Matthieu Baerts (NGI0) wrote: diff --git a/tools/testing/selftests/bpf/progs/mptcp_bpf.h b/tools/testing/selftests/bpf/progs/mptcp_bpf.h new file mode 100644 index ..179b74c1205f --- /dev/null +++ b/tools/testing/selftests/bpf/progs/mptcp_bpf.h @@ -0,0 +1,42 @@ +/

Re: [PATCH bpf-next v2] selftests/bpf: convert test_xdp_features.sh to test_progs

2024-09-13 Thread Martin KaFai Lau
On 9/10/24 11:10 AM, Alexis Lothoré (eBPF Foundation) wrote: test_xdp_features.sh is a shell script allowing to test that xdp features advertised by an interface are indeed delivered. The test works by starting two instance of the same program, both attaching specific xdp programs to each side of

Re: [RFC PATCH 2/3] ipv6: Run a reverse sk_lookup on sendmsg.

2024-09-13 Thread Martin KaFai Lau
On 9/13/24 2:39 AM, Tiago Lam wrote: This follows the same rationale provided for the ipv4 counterpart, where it now runs a reverse socket lookup when source addresses and/or ports are changed, on sendmsg, to check whether egress traffic should be allowed to go through or not. As with ipv4, the

Re: [PATCH vhost v2 0/7] vdpa/mlx5: Optimze MKEY operations

2024-09-11 Thread Eugenio Perez Martin
On Mon, Sep 9, 2024 at 11:30 AM Dragos Tatulea wrote: > > > > On 30.08.24 12:58, Dragos Tatulea wrote: > > This series improves the time of .set_map() operations by parallelizing > > the MKEY creation and deletion for direct MKEYs. Looking at the top > > level MKEY creation/deletion functions, the

Re: [PATCH mlx5-vhost v2 01/10] net/mlx5: Support throttled commands from async API

2024-09-11 Thread Eugenio Perez Martin
On Mon, Sep 9, 2024 at 11:33 AM Dragos Tatulea wrote: > > > > On 16.08.24 11:01, Dragos Tatulea wrote: > > Currently, commands that qualify as throttled can't be used via the > > async API. That's due to the fact that the throttle semaphore can sleep > > but the async API can't. > > > > This patch

Re: [PATCH vhost v2 00/10] vdpa/mlx5: Parallelize device suspend/resume

2024-09-03 Thread Eugenio Perez Martin
On Tue, Sep 3, 2024 at 9:48 AM Dragos Tatulea wrote: > > > > On 03.09.24 09:40, Lei Yang wrote: > > On Mon, Sep 2, 2024 at 7:05 PM Dragos Tatulea wrote: > >> > >> Hi Lei, > >> > >> On 02.09.24 12:03, Lei Yang wrote: > >>> Hi Dragos > >>> > >>> QE tested this series with mellanox nic, it failed wi

Re: [PATCH vhost 7/7] vdpa/mlx5: Postpone MR deletion

2024-08-29 Thread Eugenio Perez Martin
On Thu, Aug 29, 2024 at 5:23 PM Dragos Tatulea wrote: > > > > On 29.08.24 17:07, Eugenio Perez Martin wrote: > > On Wed, Aug 21, 2024 at 1:42 PM Dragos Tatulea wrote: > >> > >> Currently, when a new MR is set up, the old MR is deleted. MR deletion > >>

Re: [PATCH vhost 1/7] vdpa/mlx5: Create direct MKEYs in parallel

2024-08-29 Thread Eugenio Perez Martin
On Thu, Aug 29, 2024 at 3:54 PM Dragos Tatulea wrote: > > > > On 29.08.24 15:10, Eugenio Perez Martin wrote: > > On Wed, Aug 21, 2024 at 1:41 PM Dragos Tatulea wrote: > >> > >> Use the async interface to issue MTT MKEY creation. > >> Extra care is

Re: [PATCH vhost 7/7] vdpa/mlx5: Postpone MR deletion

2024-08-29 Thread Eugenio Perez Martin
On Wed, Aug 21, 2024 at 1:42 PM Dragos Tatulea wrote: > > Currently, when a new MR is set up, the old MR is deleted. MR deletion > is about 30-40% the time of MR creation. As deleting the old MR is not > important for the process of setting up the new MR, this operation > can be postponed. > > Thi

Re: [PATCH vhost 6/7] vdpa/mlx5: Introduce init/destroy for MR resources

2024-08-29 Thread Eugenio Perez Martin
On Wed, Aug 21, 2024 at 1:42 PM Dragos Tatulea wrote: > > There's currently not a lot of action happening during > the init/destroy of MR resources. But more will be added > in the upcoming patches. If the series doesn't receive new patches, it is just the next patch :). > > Signed-off-by: Drago

Re: [PATCH vhost 5/7] vdpa/mlx5: Rename mr_mtx -> lock

2024-08-29 Thread Eugenio Perez Martin
On Wed, Aug 21, 2024 at 1:42 PM Dragos Tatulea wrote: > > Now that the mr resources have their own namespace in the > struct, give the lock a clearer name. > > Signed-off-by: Dragos Tatulea > Reviewed-by: Cosmin Ratiu Acked-by: Eugenio Pérez > --- > drivers/vdpa/mlx5/core/mlx5_vdpa.h | 2 +-

Re: [PATCH vhost 4/7] vdpa/mlx5: Extract mr members in own resource struct

2024-08-29 Thread Eugenio Perez Martin
On Wed, Aug 21, 2024 at 1:42 PM Dragos Tatulea wrote: > > Group all mapping related resources into their own structure. > > Upcoming patches will add more members in this new structure. > > Signed-off-by: Dragos Tatulea > Reviewed-by: Cosmin Ratiu Acked-by: Eugenio Pérez > --- > drivers/vdpa

Re: [PATCH vhost 2/7] vdpa/mlx5: Delete direct MKEYs in parallel

2024-08-29 Thread Eugenio Perez Martin
On Wed, Aug 21, 2024 at 1:42 PM Dragos Tatulea wrote: > > Use the async interface to issue MTT MKEY deletion. > > This makes destroy_user_mr() on average 8x times faster. > This number is also dependent on the size of the MR being > deleted. > > Signed-off-by: Dragos Tatulea > Reviewed-by: Cosmin

Re: [PATCH vhost 1/7] vdpa/mlx5: Create direct MKEYs in parallel

2024-08-29 Thread Eugenio Perez Martin
On Wed, Aug 21, 2024 at 1:41 PM Dragos Tatulea wrote: > > Use the async interface to issue MTT MKEY creation. > Extra care is taken at the allocation of FW input commands > due to the MTT tables having variable sizes depending on > MR. > > The indirect MKEY is still created synchronously at the >

Re: [PATCH vhost v2 10/10] vdpa/mlx5: Parallelize VQ suspend/resume for CVQ MQ command

2024-08-28 Thread Eugenio Perez Martin
On Fri, Aug 16, 2024 at 11:03 AM Dragos Tatulea wrote: > > change_num_qps() is still suspending/resuming VQs one by one. > This change switches to parallel suspend/resume. > > When increasing the number of queues the flow has changed a bit for > simplicity: the setup_vq() function will always be c

  1   2   3   4   5   6   7   8   9   10   >