doc: add Meson coding style to contributors guide
[dpdk.git] / lib / librte_bpf / bpf_impl.h
index 5d7e65c..03ba0ae 100644 (file)
@@ -25,15 +25,28 @@ extern int bpf_validate(struct rte_bpf *bpf);
 
 extern int bpf_jit(struct rte_bpf *bpf);
 
-#ifdef RTE_ARCH_X86_64
 extern int bpf_jit_x86(struct rte_bpf *);
-#endif
+extern int bpf_jit_arm64(struct rte_bpf *);
 
 extern int rte_bpf_logtype;
 
 #define        RTE_BPF_LOG(lvl, fmt, args...) \
        rte_log(RTE_LOG_## lvl, rte_bpf_logtype, fmt, ##args)
 
+static inline size_t
+bpf_size(uint32_t bpf_op_sz)
+{
+       if (bpf_op_sz == BPF_B)
+               return sizeof(uint8_t);
+       else if (bpf_op_sz == BPF_H)
+               return sizeof(uint16_t);
+       else if (bpf_op_sz == BPF_W)
+               return sizeof(uint32_t);
+       else if (bpf_op_sz == EBPF_DW)
+               return sizeof(uint64_t);
+       return 0;
+}
+
 #ifdef __cplusplus
 }
 #endif