Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests, bpf: Fix test_txmsg_ingress_parser error

After "skmsg: lose offset info in sk_psock_skb_ingress", the test case
with ktls failed. This because ktls parser(tls_read_size) return value
is 285 not 256.

The case like this:

tls_sk1 --> redir_sk --> tls_sk2

tls_sk1 sent out 512 bytes data, after tls related processing redir_sk
recved 570 btyes data, and redirect 512 (skb_use_parser) bytes data to
tls_sk2; but tls_sk2 needs 285 * 2 bytes data, receive timeout occurred.

Signed-off-by: Liu Jian <liujian56@huawei.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/20211029141216.211899-2-liujian56@huawei.com

authored by

Liu Jian and committed by
Daniel Borkmann
b556c3fd 7303524e

+2
+2
tools/testing/selftests/bpf/test_sockmap.c
··· 1680 1680 { 1681 1681 txmsg_pass = 1; 1682 1682 skb_use_parser = 512; 1683 + if (ktls == 1) 1684 + skb_use_parser = 570; 1683 1685 opt->iov_length = 256; 1684 1686 opt->iov_count = 1; 1685 1687 opt->rate = 2;