Skip to content

Commit 95ea47e

Browse files
jrfastabkernel-patches-bot
authored andcommitted
bpf, selftests: Add three new sockmap tests for verdict only programs
Here we add three new tests for sockmap to test having a verdict program without setting the parser program. The first test covers the most simply case, sender proxy_recv proxy_send recv | | | | verdict -----+ | | | | | +----------------+ +------------+ We load the verdict program on the proxy_recv socket without a parser program. It then does a redirect into the send path of the proxy_send socket using sendpage_locked(). Next we test the drop case to ensure if we kfree_skb as a result of the verdict program everything behaves as expected. Next we test the same configuration above, but with ktls and a redirect into socket ingress queue. Shown here tls tls sender proxy_recv proxy_send recv | | | | verdict ------------------+ | | redirect_ingress +----------------+ Also to set up ping/pong test Signed-off-by: John Fastabend <[email protected]>
1 parent c3c41c3 commit 95ea47e

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

tools/testing/selftests/bpf/test_sockmap.c

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1472,12 +1472,29 @@ static void test_txmsg_skb(int cgrp, struct sockmap_options *opt)
14721472
txmsg_ktls_skb_drop = 0;
14731473
txmsg_ktls_skb_redir = 1;
14741474
test_exec(cgrp, opt);
1475+
txmsg_ktls_skb_redir = 0;
1476+
1477+
/* Tests that omit skb_parser */
1478+
txmsg_omit_skb_parser = 1;
1479+
ktls = 0;
1480+
txmsg_ktls_skb = 0;
1481+
test_exec(cgrp, opt);
1482+
1483+
txmsg_ktls_skb_drop = 1;
1484+
test_exec(cgrp, opt);
1485+
txmsg_ktls_skb_drop = 0;
1486+
1487+
txmsg_ktls_skb_redir = 1;
1488+
test_exec(cgrp, opt);
1489+
1490+
ktls = 1;
1491+
test_exec(cgrp, opt);
1492+
txmsg_omit_skb_parser = 0;
14751493

14761494
opt->data_test = data;
14771495
ktls = k;
14781496
}
14791497

1480-
14811498
/* Test cork with hung data. This tests poor usage patterns where
14821499
* cork can leave data on the ring if user program is buggy and
14831500
* doesn't flush them somehow. They do take some time however

0 commit comments

Comments
 (0)