diff options
author | Alexei Starovoitov <ast@plumgrid.com> | 2014-11-13 20:36:50 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-11-18 13:44:00 -0500 |
commit | 7943c0f329d33f531607d66f5781f2210e1e278c (patch) | |
tree | c5694485117f718c42b0363d2c09c4c746bfe376 /samples | |
parent | d0003ec01c667b731c139e23de3306a8b328ccf5 (diff) |
bpf: remove test map scaffolding and user proper types
proper types and function helpers are ready. Use them in verifier testsuite.
Remove temporary stubs
Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'samples')
-rw-r--r-- | samples/bpf/test_verifier.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/samples/bpf/test_verifier.c b/samples/bpf/test_verifier.c index 63402742345e..b96175e90363 100644 --- a/samples/bpf/test_verifier.c +++ b/samples/bpf/test_verifier.c | |||
@@ -261,7 +261,7 @@ static struct bpf_test tests[] = { | |||
261 | BPF_MOV64_REG(BPF_REG_2, BPF_REG_10), | 261 | BPF_MOV64_REG(BPF_REG_2, BPF_REG_10), |
262 | BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8), | 262 | BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8), |
263 | BPF_LD_MAP_FD(BPF_REG_1, 0), | 263 | BPF_LD_MAP_FD(BPF_REG_1, 0), |
264 | BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0, BPF_FUNC_unspec), | 264 | BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0, BPF_FUNC_map_lookup_elem), |
265 | BPF_EXIT_INSN(), | 265 | BPF_EXIT_INSN(), |
266 | }, | 266 | }, |
267 | .fixup = {2}, | 267 | .fixup = {2}, |
@@ -417,7 +417,7 @@ static struct bpf_test tests[] = { | |||
417 | BPF_ALU64_REG(BPF_MOV, BPF_REG_2, BPF_REG_10), | 417 | BPF_ALU64_REG(BPF_MOV, BPF_REG_2, BPF_REG_10), |
418 | BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8), | 418 | BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8), |
419 | BPF_LD_MAP_FD(BPF_REG_1, 0), | 419 | BPF_LD_MAP_FD(BPF_REG_1, 0), |
420 | BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0, BPF_FUNC_unspec), | 420 | BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0, BPF_FUNC_map_delete_elem), |
421 | BPF_EXIT_INSN(), | 421 | BPF_EXIT_INSN(), |
422 | }, | 422 | }, |
423 | .errstr = "fd 0 is not pointing to valid bpf_map", | 423 | .errstr = "fd 0 is not pointing to valid bpf_map", |
@@ -430,7 +430,7 @@ static struct bpf_test tests[] = { | |||
430 | BPF_MOV64_REG(BPF_REG_2, BPF_REG_10), | 430 | BPF_MOV64_REG(BPF_REG_2, BPF_REG_10), |
431 | BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8), | 431 | BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8), |
432 | BPF_LD_MAP_FD(BPF_REG_1, 0), | 432 | BPF_LD_MAP_FD(BPF_REG_1, 0), |
433 | BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0, BPF_FUNC_unspec), | 433 | BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0, BPF_FUNC_map_lookup_elem), |
434 | BPF_ST_MEM(BPF_DW, BPF_REG_0, 0, 0), | 434 | BPF_ST_MEM(BPF_DW, BPF_REG_0, 0, 0), |
435 | BPF_EXIT_INSN(), | 435 | BPF_EXIT_INSN(), |
436 | }, | 436 | }, |
@@ -445,7 +445,7 @@ static struct bpf_test tests[] = { | |||
445 | BPF_MOV64_REG(BPF_REG_2, BPF_REG_10), | 445 | BPF_MOV64_REG(BPF_REG_2, BPF_REG_10), |
446 | BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8), | 446 | BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8), |
447 | BPF_LD_MAP_FD(BPF_REG_1, 0), | 447 | BPF_LD_MAP_FD(BPF_REG_1, 0), |
448 | BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0, BPF_FUNC_unspec), | 448 | BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0, BPF_FUNC_map_lookup_elem), |
449 | BPF_JMP_IMM(BPF_JEQ, BPF_REG_0, 0, 1), | 449 | BPF_JMP_IMM(BPF_JEQ, BPF_REG_0, 0, 1), |
450 | BPF_ST_MEM(BPF_DW, BPF_REG_0, 4, 0), | 450 | BPF_ST_MEM(BPF_DW, BPF_REG_0, 4, 0), |
451 | BPF_EXIT_INSN(), | 451 | BPF_EXIT_INSN(), |
@@ -461,7 +461,7 @@ static struct bpf_test tests[] = { | |||
461 | BPF_MOV64_REG(BPF_REG_2, BPF_REG_10), | 461 | BPF_MOV64_REG(BPF_REG_2, BPF_REG_10), |
462 | BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8), | 462 | BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8), |
463 | BPF_LD_MAP_FD(BPF_REG_1, 0), | 463 | BPF_LD_MAP_FD(BPF_REG_1, 0), |
464 | BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0, BPF_FUNC_unspec), | 464 | BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0, BPF_FUNC_map_lookup_elem), |
465 | BPF_JMP_IMM(BPF_JEQ, BPF_REG_0, 0, 2), | 465 | BPF_JMP_IMM(BPF_JEQ, BPF_REG_0, 0, 2), |
466 | BPF_ST_MEM(BPF_DW, BPF_REG_0, 0, 0), | 466 | BPF_ST_MEM(BPF_DW, BPF_REG_0, 0, 0), |
467 | BPF_EXIT_INSN(), | 467 | BPF_EXIT_INSN(), |
@@ -548,7 +548,7 @@ static struct bpf_test tests[] = { | |||
548 | BPF_ST_MEM(BPF_DW, BPF_REG_2, -56, 0), | 548 | BPF_ST_MEM(BPF_DW, BPF_REG_2, -56, 0), |
549 | BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -56), | 549 | BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -56), |
550 | BPF_LD_MAP_FD(BPF_REG_1, 0), | 550 | BPF_LD_MAP_FD(BPF_REG_1, 0), |
551 | BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0, BPF_FUNC_unspec), | 551 | BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0, BPF_FUNC_map_delete_elem), |
552 | BPF_EXIT_INSN(), | 552 | BPF_EXIT_INSN(), |
553 | }, | 553 | }, |
554 | .fixup = {24}, | 554 | .fixup = {24}, |
@@ -659,7 +659,7 @@ static int create_map(void) | |||
659 | long long key, value = 0; | 659 | long long key, value = 0; |
660 | int map_fd; | 660 | int map_fd; |
661 | 661 | ||
662 | map_fd = bpf_create_map(BPF_MAP_TYPE_UNSPEC, sizeof(key), sizeof(value), 1024); | 662 | map_fd = bpf_create_map(BPF_MAP_TYPE_HASH, sizeof(key), sizeof(value), 1024); |
663 | if (map_fd < 0) { | 663 | if (map_fd < 0) { |
664 | printf("failed to create map '%s'\n", strerror(errno)); | 664 | printf("failed to create map '%s'\n", strerror(errno)); |
665 | } | 665 | } |