selftests/bpf: Add ingress tests for txmsg with apply_bytes
authorPengcheng Yang <yangpc@wangsu.com>
Tue, 29 Nov 2022 10:40:41 +0000 (18:40 +0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 1 Dec 2022 00:07:41 +0000 (01:07 +0100)
Currently, the ingress redirect is not covered in "txmsg test apply".

Signed-off-by: Pengcheng Yang <yangpc@wangsu.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Jakub Sitnicki <jakub@cloudflare.com>
Link: https://lore.kernel.org/bpf/1669718441-2654-5-git-send-email-yangpc@wangsu.com
tools/testing/selftests/bpf/test_sockmap.c

index e768181a1bd75a15cf72f82fe293a47b0cb24d35..024a0faafb3be7ab97faaeba4e8f65ca6eedc0e4 100644 (file)
@@ -1690,24 +1690,42 @@ static void test_txmsg_apply(int cgrp, struct sockmap_options *opt)
 {
        txmsg_pass = 1;
        txmsg_redir = 0;
+       txmsg_ingress = 0;
        txmsg_apply = 1;
        txmsg_cork = 0;
        test_send_one(opt, cgrp);
 
        txmsg_pass = 0;
        txmsg_redir = 1;
+       txmsg_ingress = 0;
+       txmsg_apply = 1;
+       txmsg_cork = 0;
+       test_send_one(opt, cgrp);
+
+       txmsg_pass = 0;
+       txmsg_redir = 1;
+       txmsg_ingress = 1;
        txmsg_apply = 1;
        txmsg_cork = 0;
        test_send_one(opt, cgrp);
 
        txmsg_pass = 1;
        txmsg_redir = 0;
+       txmsg_ingress = 0;
+       txmsg_apply = 1024;
+       txmsg_cork = 0;
+       test_send_large(opt, cgrp);
+
+       txmsg_pass = 0;
+       txmsg_redir = 1;
+       txmsg_ingress = 0;
        txmsg_apply = 1024;
        txmsg_cork = 0;
        test_send_large(opt, cgrp);
 
        txmsg_pass = 0;
        txmsg_redir = 1;
+       txmsg_ingress = 1;
        txmsg_apply = 1024;
        txmsg_cork = 0;
        test_send_large(opt, cgrp);