[dpdk-dev] [PATCH] bpf: rename bpf_validate() to rte_bpf_validate() to avoid collisions

David Christensen drc at linux.vnet.ibm.com
Wed Apr 10 21:23:31 CEST 2019


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.

Cc: stable at dpdk.org

Signed-off-by: David Christensen <drc at linux.vnet.ibm.com>
Tested-by: Radhika Chirra <radhika.chirra at ibm.com>
---
 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(-)

diff --git a/lib/librte_bpf/bpf_impl.h b/lib/librte_bpf/bpf_impl.h
index b577e2c..f1d6f9a 100644
--- a/lib/librte_bpf/bpf_impl.h
+++ b/lib/librte_bpf/bpf_impl.h
@@ -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);
 
diff --git a/lib/librte_bpf/bpf_load.c b/lib/librte_bpf/bpf_load.c
index d9d163b..bd9eebf 100644
--- a/lib/librte_bpf/bpf_load.c
+++ b/lib/librte_bpf/bpf_load.c
@@ -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)
diff --git a/lib/librte_bpf/bpf_validate.c b/lib/librte_bpf/bpf_validate.c
index 83983ef..12c34f0 100644
--- a/lib/librte_bpf/bpf_validate.c
+++ b/lib/librte_bpf/bpf_validate.c
@@ -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



More information about the dev mailing list