Following create_pair() changes, remove unused function argument in
create_socket_pairs() and adapt its callers, i.e. drop the open-coded
loopback socket creation.
Suggested-by: Jakub Sitnicki
Signed-off-by: Michal Luczaj
---
.../selftests/bpf/prog_tests/sockmap_basic.c | 9
Constants got switched reducing the test's coverage. Replace SOCK_DGRAM
with SOCK_STREAM in one of unix_inet_skb_redir_to_connected() tests.
Fixes: 51354f700d40 ("bpf, sockmap: Add af_unix test with both sockets in map")
Suggested-by: Jakub Sitnicki
Signed-off-by: Michal Luc
Replace implementation with a call to a generic function.
Signed-off-by: Michal Luczaj
---
.../selftests/bpf/prog_tests/sockmap_listen.c | 83 +-
1 file changed, 2 insertions(+), 81 deletions(-)
diff --git a/tools/testing/selftests/bpf/prog_tests/sockmap_listen.c
b
Rewrite function to have (unneeded) socket descriptors automatically
close()d when leaving the scope. Make sure the "ownership" of fds is
correctly passed via take_fd(); i.e. descriptor returned to caller will
remain valid.
Suggested-by: Jakub Sitnicki
Signed-off-by: Mic
Do actually test the sotype as specified by the caller.
This picks up after commit 75e0e27db6cf ("selftest/bpf: Change udp to inet
in some function names").
Suggested-by: Jakub Sitnicki
Signed-off-by: Michal Luczaj
---
tools/testing/selftests/bpf/prog_tests/sockmap_listen.c | 6 +++-
Extend the function to allow creating socket pairs of SOCK_STREAM,
SOCK_DGRAM and SOCK_SEQPACKET.
Adapt direct callers and leave further cleanups for the following patch.
Suggested-by: Jakub Sitnicki
Signed-off-by: Michal Luczaj
---
.../selftests/bpf/prog_tests/sockmap_basic.c | 19
...@rbox.co/
- No declarations in function body (Jakub)
- Don't touch output arguments until function succeeds (Jakub)
Signed-off-by: Michal Luczaj
---
Michal Luczaj (6):
selftest/bpf: Support more socket types in create_pair()
selftest/bpf: Socket pair creation, cleanups
sel
On 7/24/24 13:32, Michal Luczaj wrote:
> Replace implementation with a call to a generic function.
>
> Signed-off-by: Michal Luczaj
Patch subject is incorrect, it should be: "... and
vsock_socketpair_connectible()". Sorry for confusion.
Michal
On 7/26/24 19:23, Jakub Sitnicki wrote:
> I was going to suggest that a single return path for success is better
> than two (diff below), but I see that this is what you ended up with
> after patch 6.
>
> So I think we can leave it as is.
> [...]
And speaking of which, would you rather have patch
On 7/26/24 19:27, Jakub Sitnicki wrote:
> On Wed, Jul 24, 2024 at 01:32 PM +02, Michal Luczaj wrote:
>> +#define take_fd(fd)
>>\
>> +({ \
>&g
On 7/26/24 19:36, Jakub Sitnicki wrote:
> On Wed, Jul 24, 2024 at 01:32 PM +02, Michal Luczaj wrote:
>> Series takes care of few bugs and missing features with the aim to improve
>> the test coverage of sockmap/sockhash.
>>
>> Last patch is a create_pair() rewrite mak
Constants got switched reducing the test's coverage. Replace SOCK_DGRAM
with SOCK_STREAM in one of unix_inet_skb_redir_to_connected() tests.
Fixes: 51354f700d40 ("bpf, sockmap: Add af_unix test with both sockets in map")
Suggested-by: Jakub Sitnicki
Signed-off-by: Michal Luc
Series takes care of few bugs and missing features with the aim to improve
the test coverage of sockmap/sockhash.
Last patch is a create_pair() rewrite making use of
__attribute__((cleanup)) to handle socket fd lifetime.
Signed-off-by: Michal Luczaj
---
Changes in v2:
- Rebase on bpf-next
Following create_pair() changes, remove unused function argument in
create_socket_pairs() and adapt its callers, i.e. drop the open-coded
loopback socket creation.
Suggested-by: Jakub Sitnicki
Signed-off-by: Michal Luczaj
---
.../selftests/bpf/prog_tests/sockmap_basic.c | 9
Do actually test the sotype as specified by the caller.
This picks up after commit 75e0e27db6cf ("selftest/bpf: Change udp to inet
in some function names").
Suggested-by: Jakub Sitnicki
Signed-off-by: Michal Luczaj
---
tools/testing/selftests/bpf/prog_tests/sockmap_listen.c | 6 +++-
Replace implementation with a call to a generic function.
Signed-off-by: Michal Luczaj
---
.../selftests/bpf/prog_tests/sockmap_listen.c | 83 +-
1 file changed, 2 insertions(+), 81 deletions(-)
diff --git a/tools/testing/selftests/bpf/prog_tests/sockmap_listen.c
b
Rewrite function to have (unneeded) socket descriptors automatically
close()d when leaving the scope. Make sure the "ownership" of fds is
correctly passed via take_fd(); i.e. descriptor returned to caller will
remain valid.
Suggested-by: Jakub Sitnicki
Signed-off-by: Mic
Extend the function to allow creating socket pairs of SOCK_STREAM,
SOCK_DGRAM and SOCK_SEQPACKET.
Adapt direct callers and leave further cleanups for the following patch.
Suggested-by: Jakub Sitnicki
Signed-off-by: Michal Luczaj
---
.../selftests/bpf/prog_tests/sockmap_basic.c | 19
On 7/30/24 19:13, Jakub Sitnicki wrote:
> On Fri, Jul 26, 2024 at 10:29 PM +02, Michal Luczaj wrote:
>> On 7/26/24 19:23, Jakub Sitnicki wrote:
>>> I was going to suggest that a single return path for success is better
>>> than two (diff below), but I see that thi
On 8/5/24 17:22, Jakub Sitnicki wrote:
> On Wed, Jul 31, 2024 at 12:01 PM +02, Michal Luczaj wrote:
>> Series takes care of few bugs and missing features with the aim to improve
>> the test coverage of sockmap/sockhash.
>>
>> Last patch is a create_pair() rewrite mak
On 8/6/24 14:01, Jakub Sitnicki wrote:
> On Wed, Jul 31, 2024 at 12:01 PM +02, Michal Luczaj wrote:
>> Series takes care of few bugs and missing features with the aim to improve
>> the test coverage of sockmap/sockhash.
>>
>> Last patch is a create_pair() rewrite mak
Handle AF_UNIX in init_addr_loopback(). For pair creation, bind() the peer
socket to make SOCK_DGRAM connect() happy.
Signed-off-by: Michal Luczaj
---
.../bpf/prog_tests/sockmap_helpers.h | 29 +++
1 file changed, 24 insertions(+), 5 deletions(-)
diff --git a/tools
Let a selftest set BPF_F_INGRESS for map/hash redirect.
In run_tests(), explicitly reset skel->bss->test_ingress to false. Earlier
tests might have left it flipped.
Signed-off-by: Michal Luczaj
---
tools/testing/selftests/bpf/prog_tests/sockmap_listen.c | 2 ++
tools/testing/selftes
, SOCK_STREAM
AF_VSOCK, SOCK_SEQPACKET
Suggested-by: Jakub Sitnicki
Signed-off-by: Michal Luczaj
---
.../bpf/prog_tests/sockmap_helpers.h | 58
.../selftests/bpf/prog_tests/sockmap_redir.c | 315 ++
2 files changed, 373 insertions(+)
create mode 100644 tools/testing
On 8/6/24 19:45, Jakub Sitnicki wrote:
> On Tue, Aug 06, 2024 at 07:18 PM +02, Michal Luczaj wrote:
>> Great, thanks for the review. With this completed, I guess we can unwind
>> the (mail) stack to [1]. Is that ingress-to-local et al. something you
>> wanted to take care of y
When a verdict program simply passes a packet without redirection, sk_msg
is enqueued on sk_psock::ingress_msg. Add a missing check to poll().
Fixes: 634f1a7110b4 ("vsock: support sockmap")
Signed-off-by: Michal Luczaj
---
net/vmw_vsock/af_vsock.c | 3 +++
1 file changed, 3 insertion
: changes in __vsock_release() look messy, but it's only due to indent
level reduction and variables xmas tree reorder.
Fixes: 634f1a7110b4 ("vsock: support sockmap")
Signed-off-by: Michal Luczaj
---
net/vmw_vsock/af_vsock.c | 67 +---
1 f
Two small fixes for vsock: poll() missing a queue check, and close() not
invoking sockmap cleanup.
Signed-off-by: Michal Luczaj
---
Michal Luczaj (4):
bpf, vsock: Fix poll() missing a queue
selftest/bpf: Add test for af_vsock poll()
bpf, vsock: Invoke proto::close on close
Make sure the proto::close callback gets invoked on vsock release.
Signed-off-by: Michal Luczaj
---
.../selftests/bpf/prog_tests/sockmap_basic.c | 31 ++
1 file changed, 31 insertions(+)
diff --git a/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c
b/tools
Verify that vsock's poll() notices when sk_psock::ingress_msg isn't empty.
Signed-off-by: Michal Luczaj
---
.../selftests/bpf/prog_tests/sockmap_basic.c | 46 ++
1 file changed, 46 insertions(+)
diff --git a/tools/testing/selftests/bpf/prog_tests/sockmap_
gger the cleanup, i.e. a
closed socket will not be automatically removed from the sockmap.
Stop tearing the links when a matching link_raw is found.
Signed-off-by: Michal Luczaj
---
net/core/sock_map.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/core/sock_map.c b/net/core/sock_map
Verify that the sockmap link was not severed, and socket's entry is indeed
removed from the map when the corresponding descriptor gets closed.
Signed-off-by: Michal Luczaj
---
tools/testing/selftests/bpf/prog_tests/sockmap_basic.c | 8 +---
1 file changed, 5 insertions(+), 3 dele
detail of the
current __sock_map_delete() implementation. I'd be grateful for comments,
thanks.
Signed-off-by: Michal Luczaj
---
Michal Luczaj (3):
bpf, sockmap: Fix update element with same
selftest/bpf: Extend test for sockmap update with same
bpf, sockmap: Fix race
: []
asm_sysvec_apic_timer_interrupt+0x16/0x20
hardirqs last disabled at (10740): []
handle_softirqs+0x60d/0x770
softirqs last enabled at (10506): []
__irq_exit_rcu+0x109/0x210
softirqs last disabled at (10301): []
__irq_exit_rcu+0x109/0x210
Fixes: 604326b41a6f ("bpf, sockmap: convert to gen
On 12/9/24 06:47, John Fastabend wrote:
> Michal Luczaj wrote:
>> Consider a sockmap entry being updated with the same socket:
>>
>> osk = stab->sks[idx];
>> sock_map_add_link(psock, link, map, &stab->sks[idx]);
>> stab->sks[idx] = sk;
&
On 11/21/24 10:22, Stefano Garzarella wrote:
> On Mon, Nov 18, 2024 at 10:03:43PM +0100, Michal Luczaj wrote:
>> vsock defines a BPF callback to be invoked when close() is called. However,
>> this callback is never actually executed. As a result, a closed vsock
>> socket
36 matches
Mail list logo