Skip to content

Commit

Permalink
test/bpf: skip dump if conversion fails
Browse files Browse the repository at this point in the history
[ upstream commit 78e7b29 ]

If conversion of cBPF to eBPF fails (in rte_bpf_convert)
then the test should not try and print the result.

Coverity issue: 373661
Fixes: 2eccf6a ("bpf: add function to convert classic BPF to DPDK BPF")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
  • Loading branch information
shemminger authored and kevintraynor committed Mar 8, 2022
1 parent 23237c3 commit e2b0823
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/test/test_bpf.c
Expand Up @@ -3259,8 +3259,10 @@ test_bpf_dump(struct bpf_program *cbf, const struct rte_bpf_prm *prm)
printf("cBPF program (%u insns)\n", cbf->bf_len);
bpf_dump(cbf, 1);

printf("\neBPF program (%u insns)\n", prm->nb_ins);
rte_bpf_dump(stdout, prm->ins, prm->nb_ins);
if (prm != NULL) {
printf("\neBPF program (%u insns)\n", prm->nb_ins);
rte_bpf_dump(stdout, prm->ins, prm->nb_ins);
}
}

static int
Expand Down

0 comments on commit e2b0823

Please sign in to comment.