Skip to content

Commit

Permalink
selftests/bpf: Simplify test_exec in test_sockmap
Browse files Browse the repository at this point in the history
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
  • Loading branch information
Geliang Tang committed Jan 20, 2025
1 parent 986e6cc commit 911c00b
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions tools/testing/selftests/bpf/test_sockmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1375,19 +1375,10 @@ static int __test_exec(int cgrp, int test, struct sockmap_options *opt)
static void test_exec(int cgrp, struct sockmap_options *opt)
{
int type = strcmp(opt->map, BPF_SOCKMAP_FILENAME);
int err;

if (type == 0) {
test_start();
err = __test_exec(cgrp, SENDMSG, opt);
if (err)
test_fail();
} else {
test_start();
err = __test_exec(cgrp, SENDPAGE, opt);
if (err)
test_fail();
}
test_start();
if (__test_exec(cgrp, type ? SENDPAGE : SENDMSG, opt))
test_fail();
}

static void test_send_one(struct sockmap_options *opt, int cgrp)
Expand Down

0 comments on commit 911c00b

Please sign in to comment.