bpf: rename bpf_validate() to rte_bpf_validate() to avoid collisions
PATCH 1/1 bpf: rename bpf_validate() to rte_bpf_validate() to avoid collisions
When using libpcap libraries the error "multiple definition of 'bpf_validate'" is observed. Rename the DPDK version to rte_bpf_validate to be more consistenet with other DPDK defined functions.
Signed-off-by David Christensen <[email protected]>
Tested-by Radhika Chirra <[email protected]>
--- lib/librte_bpf/bpf_impl.h | 2 +- lib/librte_bpf/bpf_load.c | 2 +- lib/librte_bpf/bpf_validate.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
lib/librte_bpf/bpf_impl.h +1 -1
@@ -21,7 +21,7 @@ struct rte_bpf {uint32_t stack_sz; }; -extern int bpf_validate (struct rte_bpf *bpf); +extern int rte_bpf_validate (struct rte_bpf *bpf);extern int bpf_jit (struct rte_bpf *bpf);
lib/librte_bpf/bpf_load.c +1 -1
@@ -115,7 +115,7 @@return NULL ; } - rc =bpf_validate (bpf); + rc =rte_bpf_validate (bpf);if (rc ==0 ) {bpf_jit (bpf);if (mprotect (bpf, bpf->sz,PROT_READ ) !=0 )
lib/librte_bpf/bpf_validate.c +1 -1
@@ -2209,7 +2209,7 @@ struct bpf_ins_check { }int -bpf_validate (struct rte_bpf *bpf) +rte_bpf_validate (struct rte_bpf *bpf) {int32_t rc;struct bpf_verifier bvf;
Signature · 1 line
1.8.3.1
Quoted 5 lines
When using libpcap libraries the error "multiple definition of '
bpf_validate'" is observed. Rename the DPDK version torte_bpf_validateto be more consistenet with other DPDK defined functions.
As I already ask Vivian, before we proceed any further with that patch could you provide some simple test-case to reproduce the problem? bpf_validate() function is not exposed as external API,
so no need for rte_ prefix in general.
Konstantin
Quoted 52 lines
Signed-off-by David Christensen <[email protected]>Tested-by Radhika Chirra <[email protected]>--- lib/librte_bpf/bpf_impl.h | 2 +- lib/librte_bpf/bpf_load.c | 2 +- lib/librte_bpf/bpf_validate.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)lib/librte_bpf/bpf_impl.h +1
-1@@ -21,7 +21,7 @@ struct rte_bpf {uint32_t stack_sz; }; -extern int bpf_validate (struct rte_bpf *bpf); +extern int rte_bpf_validate (struct rte_bpf *bpf);extern int bpf_jit (struct rte_bpf *bpf);lib/librte_bpf/bpf_load.c +1
-1@@ -115,7 +115,7 @@return NULL ; } - rc =bpf_validate (bpf); + rc =rte_bpf_validate (bpf);if (rc ==0 ) {bpf_jit (bpf);if (mprotect (bpf, bpf->sz,PROT_READ ) !=0 )lib/librte_bpf/bpf_validate.c +1
-2@@ -2209,7 +2209,7 @@ struct bpf_ins_check { }int -bpf_validate (struct rte_bpf *bpf) +rte_bpf_validate (struct rte_bpf *bpf) {int32_t rc;struct bpf_verifier bvf; --1.8.3.1