Skip to content

Commit

Permalink
Squash to "selftests/bpf: Add bpf_first scheduler & test"
Browse files Browse the repository at this point in the history
Use new netns helpers.

Signed-off-by: Geliang Tang <[email protected]>
Message-Id: <3155c5faa74d04130eb8d257f11de50603b1f5ac.1730260715.git.tanggeliang@kylinos.cn>
  • Loading branch information
Geliang Tang authored and Patchew Applier committed Oct 30, 2024
1 parent 1e5cf59 commit 639f675
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tools/testing/selftests/bpf/prog_tests/mptcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ static void test_bpf_sched(struct bpf_object *obj, char *sched,
bool addr1, bool addr2)
{
char bpf_sched[MPTCP_SCHED_NAME_MAX] = "bpf_";
struct nstoken *nstoken;
struct netns_obj *netns;
struct bpf_link *link;
struct bpf_map *map;

Expand All @@ -664,14 +664,14 @@ static void test_bpf_sched(struct bpf_object *obj, char *sched,
if (CHECK(!link, sched, "attach_struct_ops: %d\n", errno))
return;

nstoken = sched_init("subflow", strcat(bpf_sched, sched));
if (!nstoken)
netns = sched_init("subflow", strcat(bpf_sched, sched));
if (!netns)
goto fail;

send_data_and_verify(sched, addr1, addr2);

fail:
cleanup_netns(nstoken);
netns_free(netns);
bpf_link__destroy(link);
}

Expand Down

0 comments on commit 639f675

Please sign in to comment.