Re: [PATCH net] net: check the minimum value of gso size in virtio_net_hdr_to_skb()

2025-07-28 Thread Willem de Bruijn
On Sun, Jul 27, 2025 at 11:36 PM Wang Liang wrote: > > > 在 2025/7/28 1:15, Willem de Bruijn 写道: > > Willem de Bruijn wrote: > >> But so the real bug, an skb with 4B in the UDP layer happens before > >> that. > >> > >> An skb_dump in udp_queue_r

Re: [PATCH net] net: check the minimum value of gso size in virtio_net_hdr_to_skb()

2025-07-27 Thread Willem de Bruijn
On Sun, Jul 27, 2025 at 11:21 PM Jason Wang wrote: > > On Mon, Jul 28, 2025 at 1:16 AM Willem de Bruijn > wrote: > > > > Willem de Bruijn wrote: > > > Wang Liang wrote: > > > > > > > > 在 2025/7/24 21:29, Willem de Bruijn 写道: > > &

Re: [PATCH net] net: check the minimum value of gso size in virtio_net_hdr_to_skb()

2025-07-27 Thread Willem de Bruijn
Willem de Bruijn wrote: > Wang Liang wrote: > > > > 在 2025/7/24 21:29, Willem de Bruijn 写道: > > > Wang Liang wrote: > > >> When sending a packet with virtio_net_hdr to tun device, if the gso_type > > >> in virtio_net_hdr is SKB_GSO_UDP and the gso_s

Re: [PATCH net] net: check the minimum value of gso size in virtio_net_hdr_to_skb()

2025-07-27 Thread Willem de Bruijn
Wang Liang wrote: > > 在 2025/7/24 21:29, Willem de Bruijn 写道: > > Wang Liang wrote: > >> When sending a packet with virtio_net_hdr to tun device, if the gso_type > >> in virtio_net_hdr is SKB_GSO_UDP and the gso_size is less than udphdr > >> size, below cra

Re: [PATCH net-next] selftests: net: Skip test if IPv6 is not configured

2025-07-25 Thread Willem de Bruijn
Jakub Kicinski wrote: > On Fri, 25 Jul 2025 16:47:54 -0400 Willem de Bruijn wrote: > > Less opinionated: the tests implicitly depends on the config files > > in the test directory. Do we have to start making the robust against > > situations where CONFIGs in that file ar

Re: [PATCH net-next] selftests: net: Skip test if IPv6 is not configured

2025-07-25 Thread Willem de Bruijn
Breno Leitao wrote: > Hello Jakub, > > On Thu, Jul 24, 2025 at 06:24:27PM -0700, Jakub Kicinski wrote: > > On Wed, 23 Jul 2025 10:35:06 -0700 Breno Leitao wrote: > > > Extend the `check_for_dependencies()` function in `lib_netcons.sh` to > > > check > > > whether IPv6 is enabled by verifying the

Re: [PATCH net] net: check the minimum value of gso size in virtio_net_hdr_to_skb()

2025-07-24 Thread Willem de Bruijn
Wang Liang wrote: > When sending a packet with virtio_net_hdr to tun device, if the gso_type > in virtio_net_hdr is SKB_GSO_UDP and the gso_size is less than udphdr > size, below crash may happen. > > [ cut here ] > kernel BUG at net/core/skbuff.c:4572! The BUG_ON hit:

Re: [PATCH net-next v4 3/3] selftests: net: add netpoll basic functionality test

2025-07-07 Thread Willem de Bruijn
ev() is called when the normal TX path > is blocked. > > This addresses a gap in netpoll test coverage for a path that is > tricky for the network stack. > > Signed-off-by: Breno Leitao Reviewed-by: Willem de Bruijn > +def test_netpoll(cfg: NetDrvEpEnv) -> None: > +

Re: [PATCH net-next v3 3/3] selftests: net: add netpoll basic functionality test

2025-06-30 Thread Willem de Bruijn
Breno Leitao wrote: > Hello Willem, > > On Sat, Jun 28, 2025 at 10:57:20AM -0400, Willem de Bruijn wrote: > > Breno Leitao wrote: > > > +NETCONSOLE_CONFIGFS_PATH: str = "/sys/kernel/config/netconsole" > > > +NETCONS_REMOTE_PORT: int = > > >

Re: [PATCH net-next v3 3/3] selftests: net: add netpoll basic functionality test

2025-06-28 Thread Willem de Bruijn
Breno Leitao wrote: > Add a basic selftest for the netpoll polling mechanism, specifically > targeting the netpoll poll() side. > > The test creates a scenario where network transmission is running at > maximum speed, and netpoll needs to poll the NIC. This is achieved by: > > 1. Configuring a

Re: [PATCH net-next v2 4/4] selftests: net: add netpoll basic functionality test

2025-06-26 Thread Willem de Bruijn
Breno Leitao wrote: > Add a basic selftest for the netpoll polling mechanism, specifically > targeting the netpoll poll() side. > > The test creates a scenario where network transmission is running at > maximum speed, and netpoll needs to poll the NIC. This is achieved by: > > 1. Configuring a

Re: [PATCH net-next RFC] selftests: net: add netpoll basic functionality test

2025-06-13 Thread Willem de Bruijn
Breno Leitao wrote: > Hello Willem, > > On Thu, Jun 12, 2025 at 10:35:54PM -0400, Willem de Bruijn wrote: > > Breno Leitao wrote: > > > Add a basic selftest for the netpoll polling mechanism, specifically > > > targeting the netpoll poll() side. > > >

Re: [PATCH net-next RFC] selftests: net: add netpoll basic functionality test

2025-06-12 Thread Willem de Bruijn
Breno Leitao wrote: > Add a basic selftest for the netpoll polling mechanism, specifically > targeting the netpoll poll() side. > > The test creates a scenario where network transmission is running at > maximum sppend, and netpoll needs to poll the NIC. This is achieved by: minor type: sppend/spe

Re: [PATCH net-next] vhost/net: align variable names with XDP terminology

2025-05-08 Thread Willem de Bruijn
Jon Kohler wrote: > > > > On May 7, 2025, at 1:23 PM, Willem de Bruijn > > wrote: > > > > !---| > > CAUTION: External Email > > > > |-

Re: [PATCH net-next] vhost/net: align variable names with XDP terminology

2025-05-07 Thread Willem de Bruijn
Jon Kohler wrote: > Refactor variable names in vhost_net_build_xdp to align with XDP > terminology, enhancing code clarity and consistency. Additionally, > reorder variables to follow a reverse Christmas tree structure, > improving code organization and readability. > > This change introduces no f

Re: [RFC net-next v1 1/2] udp: Introduce UDP_STOP_RCV option for UDP

2025-05-01 Thread Willem de Bruijn
Kuniyuki Iwashima wrote: > From: "Jiayuan Chen" > Date: Thu, 01 May 2025 06:22:17 + > > 2025/5/1 12:42, "Kuniyuki Iwashima" wrote: > > > > > > > > From: Jiayuan Chen > > > > > > Date: Thu, 1 May 2025 11:51:08 +0800 > > > > > > > > > > > For some services we are using "established-over-u

Re: [PATCH bpf v2 1/2] bpf, xdp: clean head/meta when expanding it

2025-04-05 Thread Willem de Bruijn
Alexei Starovoitov wrote: > On Sun, Mar 30, 2025 at 8:27 PM Jiayuan Chen wrote: > > > > The device allocates an skb, it additionally allocates a prepad size > > (usually equal to NET_SKB_PAD or XDP_PACKET_HEADROOM) but leaves it > > uninitialized. > > > > The bpf_xdp_adjust_head function moves skb

Re: [REGRESSION] Massive virtio-net throughput drop in guest VM with Linux 6.8+

2025-04-04 Thread Willem de Bruijn
Markus Fohrer wrote: > Am Donnerstag, dem 03.04.2025 um 17:06 -0400 schrieb Michael S. > Tsirkin: > > On Thu, Apr 03, 2025 at 10:07:12PM +0200, Markus Fohrer wrote: > > > Am Donnerstag, dem 03.04.2025 um 10:03 -0400 schrieb Michael S. > > > Tsirkin: > > > > On Thu, Apr 03, 2025 at 03:51:01PM +0200,

Re: [REGRESSION] Massive virtio-net throughput drop in guest VM with Linux 6.8+

2025-04-04 Thread Willem de Bruijn
Markus Fohrer wrote: > Am Freitag, dem 04.04.2025 um 10:52 +0200 schrieb Markus Fohrer: > > Am Freitag, dem 04.04.2025 um 04:29 -0400 schrieb Michael S. Tsirkin: > > > On Fri, Apr 04, 2025 at 10:16:55AM +0200, Markus Fohrer wrote: > > > > Am Donnerstag, dem 03.04.2025 um 09:04 -0400 schrieb Michael

Re: [REGRESSION] Massive virtio-net throughput drop in guest VM with Linux 6.8+

2025-04-03 Thread Willem de Bruijn
Michael S. Tsirkin wrote: > On Thu, Apr 03, 2025 at 03:51:01PM +0200, Markus Fohrer wrote: > > Am Donnerstag, dem 03.04.2025 um 09:04 -0400 schrieb Michael S. > > Tsirkin: > > > On Wed, Apr 02, 2025 at 11:12:07PM +0200, Markus Fohrer wrote: > > > > Hi, > > > > > > > > I'm observing a significant p

Re: [PATCH net-next 4/4] tools/testing/selftests/cgroup: add test for SO_PEERCGROUPID

2025-03-10 Thread Willem de Bruijn
Alexander Mikhalitsyn wrote: > Cc: linux-kselft...@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > Cc: net...@vger.kernel.org > Cc: cgro...@vger.kernel.org > Cc: "David S. Miller" > Cc: Eric Dumazet > Cc: Jakub Kicinski > Cc: Paolo Abeni > Cc: Willem d

Re: [PATCH v2 1/3] selftests/net: have `gro.sh -t` return a correct exit code

2025-02-27 Thread Willem de Bruijn
Kevin Krakauer wrote: > On Thu, Feb 27, 2025 at 11:20:15AM -0500, Willem de Bruijn wrote: > > > --- > > > tools/testing/selftests/net/gro.sh | 3 ++- > > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > > > diff --git a/tools/testing/selft

Re: [PATCH v2 0/3] selftests/net: deflake GRO tests and fix return value and output

2025-02-27 Thread Willem de Bruijn
Kevin Krakauer wrote: > The GRO selftests can flake and have some confusing behavior. These > changes make the output and return value of GRO behave as expected, then > deflake the tests. > > v2: > - Split into multiple commits. > - Reduced napi_defer_hard_irqs to 1. > - Reduced gro_flush_timeout

Re: [PATCH v2 2/3] selftests/net: only print passing message in GRO tests when tests pass

2025-02-27 Thread Willem de Bruijn
Kevin Krakauer wrote: > gro.c:main no longer erroneously claims a test passes when running as a > sender. > > Tested: Ran `gro.sh -t large` to verify the sender no longer prints a > status. > > Signed-off-by: Kevin Krakauer Reviewed-by: Willem de Bruijn

Re: [PATCH v2 3/3] selftests/net: deflake GRO tests

2025-02-27 Thread Willem de Bruijn
t; Signed-off-by: Kevin Krakauer Nice! Thanks Reviewed-by: Willem de Bruijn > --- > tools/testing/selftests/net/gro.sh| 4 ++-- > tools/testing/selftests/net/setup_veth.sh | 3 ++- > 2 files changed, 4 insertions(+), 3 deletions(-) > > diff --git a/tools/testing/sel

Re: [PATCH v2 1/3] selftests/net: have `gro.sh -t` return a correct exit code

2025-02-27 Thread Willem de Bruijn
Kevin Krakauer wrote: > Modify gro.sh to return a useful exit code when the -t flag is used. It > formerly returned 0 no matter what. > > Tested: Ran `gro.sh -t large` and verified that test failures return 1. > Signed-off-by: Kevin Krakauer Reviewed-by: Willem de Bruijn

Re: [PATCH bpf-next v4 4/6] selftests/bpf: refactor xdp_context_functional test and bpf program

2025-02-27 Thread Willem de Bruijn
upported by both drivers. Additional > packet headers are not necessary for the test and were therefore skipped > to keep the testing code short. > > This new testing methodology no longer requires the veth interfaces to > have IP addresses assigned, therefore these were removed. > > Signed-off-by: Marcus Wichelmann Reviewed-by: Willem de Bruijn

Re: [PATCH bpf-next v3 4/6] selftests/bpf: refactor xdp_context_functional test and bpf program

2025-02-25 Thread Willem de Bruijn
Marcus Wichelmann wrote: > The existing XDP metadata test works by creating a veth pair and > attaching XDP & TC programs that drop the packet when the condition of > the test isn't fulfilled. The test then pings through the veth pair and > succeeds when the ping comes through. > > While this test

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

2025-02-25 Thread Willem de Bruijn
f has no metadata support (xdp->data_meta == xdp->data + 1). > > More information about this feature can be found in the commit message > of commit de8f3a83b0a0 ("bpf: add meta pointer for direct access"). > > Signed-off-by: Marcus Wichelmann Reviewed-by: Willem de Bruijn

Re: [PATCH bpf-next v3 6/6] selftests/bpf: fix file descriptor assertion in open_tuntap helper

2025-02-25 Thread Willem de Bruijn
not > an issue, but the BPF kernel-patches CI failed because of this: > > open_tuntap:FAIL:open(/dev/net/tun) unexpected open(/dev/net/tun): > actual 0 <= expected 0 > > Signed-off-by: Marcus Wichelmann Reviewed-by: Willem de Bruijn

Re: [PATCH bpf-next v3 3/6] selftests/bpf: move open_tuntap to network helpers

2025-02-25 Thread Willem de Bruijn
. > > Signed-off-by: Marcus Wichelmann Reviewed-by: Willem de Bruijn

Re: [PATCH bpf-next v3 4/6] selftests/bpf: refactor xdp_context_functional test and bpf program

2025-02-25 Thread Willem de Bruijn
Marcus Wichelmann wrote: > Am 24.02.25 um 16:29 schrieb Marcus Wichelmann: > > [...] > > + /* By default, Linux sends IPv6 multicast listener reports which > > +* interfere with this test. Set the IFF_NOARP flag to ensure > > +* silence on the interface. > > +*/ > > + SYS(close, "ip

Re: [PATCH bpf-next v3 0/6] XDP metadata support for tun driver

2025-02-25 Thread Willem de Bruijn
Marcus Wichelmann wrote: > Am 25.02.25 um 15:55 schrieb Willem de Bruijn: > > Marcus Wichelmann wrote: > >> [...] > >> > >> Signed-off-by: Marcus Wichelmann > >> Acked-by: Jason Wang > >> Reviewed-by: Willem de Bruijn > > > >

Re: [PATCH bpf-next v3 0/6] XDP metadata support for tun driver

2025-02-25 Thread Willem de Bruijn
7544 > > Signed-off-by: Marcus Wichelmann > Acked-by: Jason Wang > Reviewed-by: Willem de Bruijn Please don't add tags, unless a person has explicitly added them. And they are only sticky when the code has not been changed since they added them. These are only in the cover let

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

2025-02-19 Thread Willem de Bruijn
Marcus Wichelmann wrote: > Am 18.02.25 um 02:47 schrieb Willem de Bruijn: > > Marcus Wichelmann wrote: > >> [...] > >> + metasize = max(xdp->data - xdp->data_meta, 0); > > > > Can xdp->data_meta ever be greater than xdp->data? > > When an

Re: [PATCH bpf-next v2 6/6] selftests/bpf: fix file descriptor assertion in open_tuntap helper

2025-02-17 Thread Willem de Bruijn
Marcus Wichelmann wrote: > The open_tuntap helper function uses open() to get a file descriptor for > /dev/net/tun. > > The open(2) manpage writes this about its return value: > > On success, open(), openat(), and creat() return the new file > descriptor (a nonnegative integer). On error, -1

Re: [PATCH bpf-next v2 3/6] selftests/bpf: move open_tuntap to network helpers

2025-02-17 Thread Willem de Bruijn
. > > Signed-off-by: Marcus Wichelmann Reviewed-by: Willem de Bruijn Both tests that include lwt_helpers.h also include network_helpers.h, so the linking with network_helpers.o is already addressed. This was not entirely obvious from just reading the code.

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

2025-02-17 Thread Willem de Bruijn
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, the skb th

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

2025-02-17 Thread Willem de Bruijn
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, the skb th

Re: [PATCH v3 net] udp: gso: do not drop small packets when PMTU reduces

2025-01-31 Thread Willem de Bruijn
> Ideally, do not check any GSO related constraints when payload size is > smaller than requested gso_size, and return EMSGSIZE instead of EINVAL > on MTU/PMTU check failure to be more specific on the error cause. > > Fixes: 4094871db1d6 ("udp: only do GSO if # of segs > 1") &g

Re: [PATCH v2 net] udp: gso: do not drop small packets when PMTU reduces

2025-01-30 Thread Willem de Bruijn
t; Signed-off-by: Yan Zhai > -- > v1->v2: add a missing MTU check when fall back to no GSO mode suggested > by Willem de Bruijn ; Fixed up commit > message to be more precise. > > v1: https://lore.kernel.org/all/Z5cgWh%2F6bRQm9vVU@debian.debian/ > --- > net/ipv4/udp.c

Re: [PATCH] udp: gso: fix MTU check for small packets

2025-01-29 Thread Willem de Bruijn
Yan Zhai wrote: > On Tue, Jan 28, 2025 at 8:45 AM Willem de Bruijn > wrote: > > > > Yan Zhai wrote: > > > Hi Willem, > > > > > > Thanks for getting back to me. > > > > > > On Mon, Jan 27, 2025 at 8:33 AM Willem de Bruijn > > &g

Re: [PATCH] udp: gso: fix MTU check for small packets

2025-01-28 Thread Willem de Bruijn
Yan Zhai wrote: > Hi Willem, > > Thanks for getting back to me. > > On Mon, Jan 27, 2025 at 8:33 AM Willem de Bruijn > wrote: > > > > Yan Zhai wrote: > > > Commit 4094871db1d6 ("udp: only do GSO if # of segs > 1") avoided GSO > > &

Re: [PATCH] udp: gso: fix MTU check for small packets

2025-01-27 Thread Willem de Bruijn
Yan Zhai wrote: > Commit 4094871db1d6 ("udp: only do GSO if # of segs > 1") avoided GSO > for small packets. But the kernel currently dismisses GSO requests only > after checking MTU on gso_size. This means any packets, regardless of > their payload sizes, would be dropped when MTU is smaller than

Re: [PATCH net-next v2] selftests/net: call sendmmsg via udpgso_bench.sh

2024-12-04 Thread Willem de Bruijn
; Signed-off-by: Kenjiro Nakayama Reviewed-by: Willem de Bruijn

Re: [PATCH] selftests/net: call sendmmsg via udpgso_bench.sh

2024-12-03 Thread Willem de Bruijn
Kenjiro Nakayama wrote: > Currently, sendmmsg is implemented in udpgso_bench_tx.c, > but it is not called by any test script. > > This patch adds a test for sendmmsg in udpgso_bench.sh. > This allows for basic API testing and benchmarking > comparisons with GSO. The change looks fine to me, but t

Re: [PATCH net-next] selftests: net/psock_lib: Handle EINTR and EAGAIN

2024-11-18 Thread Willem de Bruijn
Leo Stone wrote: > Make pair_udp_send_char handle EAGAIN, EINTR, and partial reads or > writes. > > Signed-off-by: Leo Stone Did you observe actual issues or is this based on the comment in the existing code ("Should really handle EINTR and EAGAIN"). AFAIK all the users of psock_lib use default

Re: [PATCH net-next v9 5/6] selftests: net: Add busy_poll_test

2024-11-09 Thread Willem de Bruijn
perhaps netdevsim can be extended to emulate device IRQs to more > thoroughly test all pre-existing kernel options (like defer_hard_irqs) > and suspend. > > Signed-off-by: Joe Damato > Co-developed-by: Martin Karsten > Signed-off-by: Martin Karsten > Acked-by: Stanislav Fo

Re: [PATCH net-next v8 5/6] selftests: net: Add busy_poll_test

2024-11-08 Thread Willem de Bruijn
Joe Damato wrote: > On Fri, Nov 08, 2024 at 09:57:48AM -0500, Willem de Bruijn wrote: > > Joe Damato wrote: > > > Add an epoll busy poll test using netdevsim. > > > > > > This test is comprised of: > > > - busy_poller (via busy_poller.c) > >

Re: [PATCH net-next v8 5/6] selftests: net: Add busy_poll_test

2024-11-08 Thread Willem de Bruijn
Joe Damato wrote: > Add an epoll busy poll test using netdevsim. > > This test is comprised of: > - busy_poller (via busy_poller.c) > - busy_poll_test.sh which loads netdevsim, sets up network namespaces, > and runs busy_poller to receive data and socat to send data. > > The selftest test

Re: [PATCH net-next v3 1/9] af_packet: avoid erroring out after sock_init_data() in packet_create()

2024-10-14 Thread Willem de Bruijn
e-after-free. > > Suggested-by: Eric Dumazet > Signed-off-by: Ignat Korchagin Reviewed-by: Willem de Bruijn

Re: [PATCH net-next v04 3/3] selftests: net/psock_fanout: unbound socket fanout

2024-10-14 Thread Willem de Bruijn
Gur Stavi wrote: > Add a test that validates that an unbound packet socket cannot create/join > a fanout group. > > Signed-off-by: Gur Stavi Reviewed-by: Willem de Bruijn

Re: [PATCH net-next v04 2/3] selftests: net/psock_fanout: socket joins fanout when link is down

2024-10-14 Thread Willem de Bruijn
Gur Stavi wrote: > Modify test_control_group to have toggle parameter. > When toggle is non-zero, loopback device will be set down for the > initialization of fd[1] which is still expected to successfully join > the fanout. > > Signed-off-by: Gur Stavi Reviewed-by: Willem de Bruijn

Re: [PATCH net-next v04 1/3] af_packet: allow fanout_add when socket is not RUNNING

2024-10-14 Thread Willem de Bruijn
; > Instead of the test for RUNNING, this patch adds a test that socket can > become RUNNING. > > Signed-off-by: Gur Stavi Reviewed-by: Willem de Bruijn

RE: [PATCH net-next v02 1/2] af_packet: allow fanout_add when socket is not RUNNING

2024-10-11 Thread Willem de Bruijn
Gur Stavi wrote: > > Gur Stavi wrote: > > > > > > > > If we don't care about opening up fanout groups to ETH_P_NONE, then > > > > patch v2 seems sufficient. If explicitly blocking this, the ENXIO > > > > return can be added, but ideally without touching the other lines. > > > > > > I don't think th

RE: [PATCH net-next v02 1/2] af_packet: allow fanout_add when socket is not RUNNING

2024-10-11 Thread Willem de Bruijn
Gur Stavi wrote: > > > > If we don't care about opening up fanout groups to ETH_P_NONE, then > > patch v2 seems sufficient. If explicitly blocking this, the ENXIO > > return can be added, but ideally without touching the other lines. > > I don't think that allowing ETH_P_NONE is relevant. > In my

RE: [PATCH net-next v02 1/2] af_packet: allow fanout_add when socket is not RUNNING

2024-10-11 Thread Willem de Bruijn
Gur Stavi wrote: > > Gur Stavi wrote: > > > > Gur Stavi wrote: > > > > > > Gur Stavi wrote: > > > > > > > > Gur Stavi wrote: > > > > > > > > > >> @@ -1846,21 +1846,21 @@ static int fanout_add(struct > > sock > > > > *sk, > > > > > > > > struct fanout_args *args) > > > > > > > > > >>err = -EINVA

RE: [PATCH net-next v02 1/2] af_packet: allow fanout_add when socket is not RUNNING

2024-10-10 Thread Willem de Bruijn
Gur Stavi wrote: > > Gur Stavi wrote: > > > > Gur Stavi wrote: > > > > > > Gur Stavi wrote: > > > > > > > >> @@ -1846,21 +1846,21 @@ static int fanout_add(struct sock > > *sk, > > > > > > struct fanout_args *args) > > > > > > > >>err = -EINVAL; > > > > > > > >> > > > > > > > >>spin_

RE: [PATCH net-next v02 1/2] af_packet: allow fanout_add when socket is not RUNNING

2024-10-10 Thread Willem de Bruijn
Gur Stavi wrote: > > Gur Stavi wrote: > > > > Gur Stavi wrote: > > > > > >> @@ -1846,21 +1846,21 @@ static int fanout_add(struct sock *sk, > > > > struct fanout_args *args) > > > > > >>err = -EINVAL; > > > > > >> > > > > > >>spin_lock(&po->bind_lock); > > > > > >> - if (packet_sock_flag(po

Re: [PATCH net-next v03 1/3] af_packet: allow fanout_add when socket is not RUNNING

2024-10-10 Thread Willem de Bruijn
Gur Stavi wrote: > PACKET socket can retain its fanout membership through link down and up > and leave a fanout while closed regardless of link state. > However, socket was forbidden from joining a fanout while it was not > RUNNING. > > This patch allows PACKET socket to join fanout while not RUNN

RE: [PATCH net-next v02 1/2] af_packet: allow fanout_add when socket is not RUNNING

2024-10-09 Thread Willem de Bruijn
Gur Stavi wrote: > > Gur Stavi wrote: > > > >> @@ -1846,21 +1846,21 @@ static int fanout_add(struct sock *sk, > > struct fanout_args *args) > > > >>err = -EINVAL; > > > >> > > > >>spin_lock(&po->bind_lock); > > > >> - if (packet_sock_flag(po, PACKET_SOCK_RUNNING) && > > > >> -

Re: [PATCH net-next v02 1/2] af_packet: allow fanout_add when socket is not RUNNING

2024-10-09 Thread Willem de Bruijn
Gur Stavi wrote: > >> @@ -1846,21 +1846,21 @@ static int fanout_add(struct sock *sk, struct > >> fanout_args *args) > >>err = -EINVAL; > >> > >>spin_lock(&po->bind_lock); > >> - if (packet_sock_flag(po, PACKET_SOCK_RUNNING) && > >> - match->type == type && > >> + if (match->type ==

Re: [PATCH net-next v02 1/2] af_packet: allow fanout_add when socket is not RUNNING

2024-10-08 Thread Willem de Bruijn
Gur Stavi wrote: > PACKET socket can retain its fanout membership through link down and up > and leave a fanout while closed regardless of link state. > However, socket was forbidden from joining a fanout while it was not > RUNNING. > > This patch allows PACKET socket to join fanout while not RUNN

Re: [PATCH net-next] selftests: net: csum: Clean up recv_verify_packet_ipv6

2024-09-30 Thread Willem de Bruijn
Sean Anderson wrote: > On 9/30/24 13:16, Willem de Bruijn wrote: > > Sean Anderson wrote: > >> Rename ip_len to payload_len since the length in this case refers only > >> to the payload, and not the entire IP packet like for IPv4. While we're > >> at it, ju

Re: [PATCH net-next] selftests: net: csum: Clean up recv_verify_packet_ipv6

2024-09-30 Thread Willem de Bruijn
Sean Anderson wrote: > Rename ip_len to payload_len since the length in this case refers only > to the payload, and not the entire IP packet like for IPv4. While we're > at it, just use the variable directly when calling > recv_verify_packet_udp/tcp. > > Signed-off-by: Sean Anderson Not sure suc

Re: [RFC PATCH v2 2/3] ipv6: Support setting src port in sendmsg().

2024-09-21 Thread Willem de Bruijn
Tiago Lam wrote: > This follows the same rationale provided for the ipv4 counterpart, where > the sendmsg() path is also extended here to support the IPV6_ORIGDSTADDR > ancillary message to be able to specify a source address/port. This > allows users to configure the source address and/or port egr

Re: [RFC PATCH v2 1/3] ipv4: Support setting src port in sendmsg().

2024-09-21 Thread Willem de Bruijn
Tiago Lam wrote: > sendmsg() doesn't currently allow users to set the src port from which > egress traffic should be sent from. This is possible if a user wants to > configure the src address from which egress traffic should be sent from > - with the IP_PKTINFO ancillary message, a user is currentl

Re: [RFC PATCH 1/3] ipv4: Run a reverse sk_lookup on sendmsg.

2024-09-18 Thread Willem de Bruijn
Tiago Lam wrote: > In order to check if egress traffic should be allowed through, we run a > reverse socket lookup (i.e. normal socket lookup with the src/dst > addresses and ports reversed) to check if the corresponding ingress > traffic is allowed in. The subject and this description makes it so

Re: [PATCH net-next v2 2/3] selftests: nic_basic_tests: Add selftest case for speed and duplex state checks

2024-09-18 Thread Willem de Bruijn
Mohan Prasad J wrote: > Add selftest case for testing the speed and duplex state of > local NIC driver and the partner based on the supported > link modes obtained from the ethtool. Speed and duplex states > are varied and verified using ethtool. > > Signed-off-by: Mohan Prasad J > --- > .../dri

Re: [PATCH] selftests: Makefile: add missing 'net/lib' to targets

2024-09-15 Thread Willem de Bruijn
On Sun, Sep 15, 2024 at 8:45 AM Anders Roxell wrote: > > On Thu, 12 Sept 2024 at 17:23, Jakub Kicinski wrote: > > > > On Thu, 12 Sep 2024 08:31:18 +0200 Anders Roxell wrote: > > > Fixes: 1d0dc857b5d8 ("selftests: drv-net: add checksum tests") > > > Signed-off-by: Anders Roxell > > > --- > > > t

Re: [PATCH] selftests: Makefile: add missing 'net/lib' to targets

2024-09-12 Thread Willem de Bruijn
On Thu, Sep 12, 2024 at 2:31 AM Anders Roxell wrote: > > Fixes: 1d0dc857b5d8 ("selftests: drv-net: add checksum tests") > Signed-off-by: Anders Roxell This target is automatically built for targets that depend on it. See the commit that introduced it, b86761ff6374. +++ b/tools/testing/selftest

Re: [PATCH net] selftests: net: csum: Fix checksums for packets with non-zero padding

2024-09-10 Thread Willem de Bruijn
Sean Anderson wrote: > On 9/10/24 13:42, Willem de Bruijn wrote: > > Sean Anderson wrote: > >> On 9/9/24 21:01, Willem de Bruijn wrote: > >> > Jakub Kicinski wrote: > >> >> On Mon, 09 Sep 2024 13:26:42 -0400 Willem de Bruijn wrote: >

Re: [PATCH net] selftests: net: csum: Fix checksums for packets with non-zero padding

2024-09-10 Thread Willem de Bruijn
Sean Anderson wrote: > On 9/9/24 21:01, Willem de Bruijn wrote: > > Jakub Kicinski wrote: > >> On Mon, 09 Sep 2024 13:26:42 -0400 Willem de Bruijn wrote: > >> > > This seems to be a bug in the driver. > >> > > > >> > > A call to sk

Re: [PATCH net] selftests: net: csum: Fix checksums for packets with non-zero padding

2024-09-09 Thread Willem de Bruijn
Jakub Kicinski wrote: > On Mon, 09 Sep 2024 13:26:42 -0400 Willem de Bruijn wrote: > > > This seems to be a bug in the driver. > > > > > > A call to skb_put_padto(skb, ETH_ZLEN) should be added. > > > > In which case this test detecting it may be nic

Re: [PATCH net] selftests: net: csum: Fix checksums for packets with non-zero padding

2024-09-09 Thread Willem de Bruijn
Eric Dumazet wrote: > On Mon, Sep 9, 2024 at 5:02 PM Sean Anderson wrote: > > > > On 9/6/24 22:05, Willem de Bruijn wrote: > > > Sean Anderson wrote: > > >> Padding is not included in UDP and TCP checksums. Therefore, reduce the > > >> length of

Re: [PATCH net] selftests: net: csum: Fix checksums for packets with non-zero padding

2024-09-09 Thread Willem de Bruijn
Sean Anderson wrote: > On 9/6/24 22:05, Willem de Bruijn wrote: > > Sean Anderson wrote: > >> Padding is not included in UDP and TCP checksums. Therefore, reduce the > >> length of the checksummed data to include only the data in the IP > >> payload. This fixes

Re: [PATCH net] selftests: net: csum: Fix checksums for packets with non-zero padding

2024-09-06 Thread Willem de Bruijn
Sean Anderson wrote: > Padding is not included in UDP and TCP checksums. Therefore, reduce the > length of the checksummed data to include only the data in the IP > payload. This fixes spurious reported checksum failures like > > rx: pkt: sport=33000 len=26 csum=0xc850 verify=0xf9fe > pkt: bad csu

Re: [PATCH net-next v2 3/3] tun: AF_XDP Tx zero-copy support

2024-03-01 Thread Willem de Bruijn
Maciej Fijalkowski wrote: > On Wed, Feb 28, 2024 at 07:05:56PM +0800, Yunjian Wang wrote: > > This patch set allows TUN to support the AF_XDP Tx zero-copy feature, > > which can significantly reduce CPU utilization for XDP programs. > > Why no Rx ZC support though? What will happen if I try rxdrop

Re: [PATCH net-next 2/2] tun: AF_XDP Rx zero-copy support

2024-01-24 Thread Willem de Bruijn
Yunjian Wang wrote: > Now the zero-copy feature of AF_XDP socket is supported by some > drivers, which can reduce CPU utilization on the xdp program. > This patch set allows tun to support AF_XDP Rx zero-copy feature. > > This patch tries to address this by: > - Use peek_len to consume a xsk->desc

Re: [PATCH net-next v3 3/3] net: add netmem_ref to skb_frag_t

2023-12-21 Thread Willem de Bruijn
Mina Almasry wrote: > Use netmem_ref instead of page in skb_frag_t. Currently netmem_ref > is always a struct page underneath, but the abstraction allows efforts > to add support for skb frags not backed by pages. > > There is unfortunately 1 instance where the skb_frag_t is assumed to be > a bio_

Re: [PATCH net-next v3 1/3] vsock/virtio: use skb_frag_*() helpers

2023-12-21 Thread Willem de Bruijn
Mina Almasry wrote: > Minor fix for virtio: code wanting to access the fields inside an skb > frag should use the skb_frag_*() helpers, instead of accessing the > fields directly. This allows for extensions where the underlying > memory is not a page. > > Signed-off-by: Mina Almasry > > --- > >

Re: [PATCH RFC 0/4] virtio-net: add tx-hash, rx-tstamp, tx-tstamp and tx-time

2023-12-19 Thread Willem de Bruijn
Jason Wang wrote: > On Tue, Dec 19, 2023 at 12:36 AM Willem de Bruijn > wrote: > > > > Steffen Trumtrar wrote: > > > This series tries to pick up the work on the virtio-net timestamping > > > feature from Willem de Bruijn. > > > > > > Origina

Re: [PATCH RFC 0/4] virtio-net: add tx-hash, rx-tstamp, tx-tstamp and tx-time

2023-12-18 Thread Willem de Bruijn
Steffen Trumtrar wrote: > This series tries to pick up the work on the virtio-net timestamping > feature from Willem de Bruijn. > > Original series > Message-Id: 20210208185558.995292-1-willemdebruijn.ker...@gmail.com > Subject: [PATCH RFC v2 0/4] virtio-net: add

Re: [PATCH RFC v2 1/4] virtio: fix up virtio_disable_cb

2021-04-13 Thread Willem de Bruijn
> > > > > > > > > but even yours is also fixed I think. > > > > > > The common point is that a single spurious interrupt is not a problem. > > > The problem only exists if there are tons of spurious interrupts with no > > > real ones. For this to trigger, we keep polling the ring and while we do >

Re: [PATCH RFC v2 1/4] virtio: fix up virtio_disable_cb

2021-04-13 Thread Willem de Bruijn
On Tue, Apr 13, 2021 at 3:54 PM Michael S. Tsirkin wrote: > > On Tue, Apr 13, 2021 at 10:01:11AM -0400, Willem de Bruijn wrote: > > On Tue, Apr 13, 2021 at 1:47 AM Michael S. Tsirkin wrote: > > > > > > virtio_disable_cb is currently a nop for split ring with event i

Re: [PATCH RFC v2 3/4] virtio_net: move tx vq operation under tx queue lock

2021-04-13 Thread Willem de Bruijn
On Tue, Apr 13, 2021 at 10:03 AM Michael S. Tsirkin wrote: > > On Tue, Apr 13, 2021 at 04:54:42PM +0800, Jason Wang wrote: > > > > 在 2021/4/13 下午1:47, Michael S. Tsirkin 写道: > > > It's unsafe to operate a vq from multiple threads. > > > Unfortunately this is exactly what we do when invoking > > >

Re: [PATCH RFC v2 2/4] virtio_net: disable cb aggressively

2021-04-13 Thread Willem de Bruijn
On Tue, Apr 13, 2021 at 4:53 AM Jason Wang wrote: > > > 在 2021/4/13 下午1:47, Michael S. Tsirkin 写道: > > There are currently two cases where we poll TX vq not in response to a > > callback: start xmit and rx napi. We currently do this with callbacks > > enabled which can cause extra interrupts from

Re: [PATCH RFC v2 1/4] virtio: fix up virtio_disable_cb

2021-04-13 Thread Willem de Bruijn
On Tue, Apr 13, 2021 at 1:47 AM Michael S. Tsirkin wrote: > > virtio_disable_cb is currently a nop for split ring with event index. > This is because it used to be always called from a callback when we know > device won't trigger more events until we update the index. However, > now that we run w

Re: BUG: unable to handle kernel paging request in __build_skb

2021-04-11 Thread Willem de Bruijn
On Sun, Apr 11, 2021 at 9:31 PM Hao Sun wrote: > > Hi > > When using Healer(https://github.com/SunHao-0/healer/tree/dev) to fuzz > the Linux kernel, I found the following bug report, but I'm not sure > about this. > Sorry, I do not have a reproducing program for this bug. > I hope that the stack t

Re: [RFC net] net: skbuff: fix stack variable out of bounds access

2021-03-23 Thread Willem de Bruijn
On Tue, Mar 23, 2021 at 12:30 PM Arnd Bergmann wrote: > > On Tue, Mar 23, 2021 at 3:42 PM Willem de Bruijn > wrote: > > > > On Tue, Mar 23, 2021 at 8:52 AM Arnd Bergmann wrote: > > >> > > A similar fix already landed in 5.12-rc3: commit b228c9b05876 (&quo

Re: [RFC net] net: skbuff: fix stack variable out of bounds access

2021-03-23 Thread Willem de Bruijn
On Tue, Mar 23, 2021 at 8:52 AM Arnd Bergmann wrote: > > From: Arnd Bergmann > > gcc-11 warns that the TS_SKB_CB(&state)) cast in skb_find_text() > leads to an out-of-bounds access in skb_prepare_seq_read() after > the addition of a new struct member made skb_seq_state longer > than ts_state: > >

Re: [PATCH net v3 1/2] net: check if protocol extracted by virtio_net_hdr_set_proto is correct

2021-03-09 Thread Willem de Bruijn
col set by virtio_net_hdr_set_proto. Note that since the protocol > is only checked if skb->dev implements header_ops->parse_protocol, > packets from devices without the implementation are not checked at this > stage. > > Fixes: 9274124f023b ("net: stricter validation of u

Re: [PATCH net v3 2/2] net: avoid infinite loop in mpls_gso_segment when mpls_hlen == 0

2021-03-09 Thread Willem de Bruijn
> again call mpls_gso_segment with the same packet leading to an infinite > loop. In addition, ensure that the header length is a multiple of four, > which should hold irrespective of the number of stacked labels. > > Signed-off-by: Balazs Nemeth Acked-by: Willem de Bruijn The compiler will

Re: [PATCH v2 1/2] net: check if protocol extracted by virtio_net_hdr_set_proto is correct

2021-03-09 Thread Willem de Bruijn
On Tue, Mar 9, 2021 at 6:26 AM Michael S. Tsirkin wrote: > > On Mon, Mar 08, 2021 at 11:31:25AM +0100, Balazs Nemeth wrote: > > For gso packets, virtio_net_hdr_set_proto sets the protocol (if it isn't > > set) based on the type in the virtio net hdr, but the skb could contain > > anything since it

Re: [PATCH v2 2/2] net: avoid infinite loop in mpls_gso_segment when mpls_hlen == 0

2021-03-08 Thread Willem de Bruijn
On Mon, Mar 8, 2021 at 11:43 AM David Ahern wrote: > > On 3/8/21 9:26 AM, Balazs Nemeth wrote: > > On Mon, 2021-03-08 at 09:17 -0700, David Ahern wrote: > >> On 3/8/21 9:07 AM, Willem de Bruijn wrote: > >>>> diff --git a/net/mpls/mpls_gso.c b/net/mpls/

Re: [PATCH v2 2/2] net: avoid infinite loop in mpls_gso_segment when mpls_hlen == 0

2021-03-08 Thread Willem de Bruijn
On Mon, Mar 8, 2021 at 5:32 AM Balazs Nemeth wrote: > > A packet with skb_inner_network_header(skb) == skb_network_header(skb) > and ETH_P_MPLS_UC will prevent mpls_gso_segment from pulling any headers > from the packet. Subsequently, the call to skb_mac_gso_segment will > again call mpls_gso_segm

Re: [PATCH v2 1/2] net: check if protocol extracted by virtio_net_hdr_set_proto is correct

2021-03-08 Thread Willem de Bruijn
On Mon, Mar 8, 2021 at 5:32 AM Balazs Nemeth wrote: > > For gso packets, virtio_net_hdr_set_proto sets the protocol (if it isn't > set) based on the type in the virtio net hdr, but the skb could contain > anything since it could come from packet_snd through a raw socket. If > there is a mismatch b

Re: [PATCH bpf-next] selftests_bpf: extend test_tc_tunnel test with vxlan

2021-03-05 Thread Willem de Bruijn
On Fri, Mar 5, 2021 at 11:10 AM Daniel Borkmann wrote: > > On 3/5/21 4:08 PM, Willem de Bruijn wrote: > > On Fri, Mar 5, 2021 at 7:34 AM Xuesen Huang wrote: > >> > >> From: Xuesen Huang > >> > >> Add BPF_F_ADJ_ROOM_ENCAP_L2_ETH flag to the existi

Re: [PATCH bpf-next] selftests_bpf: extend test_tc_tunnel test with vxlan

2021-03-05 Thread Willem de Bruijn
g > Signed-off-by: Li Wang > Signed-off-by: Willem de Bruijn Please don't add my signed off by without asking. That said, Acked-by: Willem de Bruijn

Re: [PATCH] selftests_bpf: extend test_tc_tunnel test with vxlan

2021-03-04 Thread Willem de Bruijn
g > Signed-off-by: Li Wang > Signed-off-by: Willem de Bruijn Please mark patch target: [PATCH bpf-next] > --- > tools/testing/selftests/bpf/progs/test_tc_tunnel.c | 113 > ++--- > tools/testing/selftests/bpf/test_tc_tunnel.sh | 15 ++- >

  1   2   3   4   5   6   >