*/
struct rte_bpf_arg {
enum rte_bpf_arg_type type;
- size_t size; /**< for pointer types, size of data it points to */
+ /**
+ * for ptr type - max size of data buffer it points to
+ * for raw type - the size (in bytes) of the value
+ */
+ size_t size;
size_t buf_size;
/**< for mbuf ptr type, max size of rte_mbuf data buffer */
};
const char *name; /**< name */
enum rte_bpf_xtype type; /**< type */
union {
- uint64_t (*func)(uint64_t, uint64_t, uint64_t,
+ struct {
+ uint64_t (*val)(uint64_t, uint64_t, uint64_t,
uint64_t, uint64_t);
- void *var;
- }; /**< value */
+ uint32_t nb_args;
+ struct rte_bpf_arg args[EBPF_FUNC_MAX_ARGS];
+ /**< Function arguments descriptions. */
+ struct rte_bpf_arg ret; /**< function return value. */
+ } func;
+ struct {
+ void *val; /**< actual memory location */
+ struct rte_bpf_arg desc; /**< type, size, etc. */
+ } var; /**< external variable */
+ };
};
/**
* Create a new eBPF execution context and load given BPF code into it.
*
* @param prm
- * Parameters used to create and initialise the BPF exeution context.
+ * Parameters used to create and initialise the BPF execution context.
* @return
* BPF handle that is used in future BPF operations,
* or NULL on error, with error code set in rte_errno.
/**
* Create a new eBPF execution context and load BPF code from given ELF
* file into it.
+ * Note that if the function will encounter EBPF_PSEUDO_CALL instruction
+ * that references external symbol, it will treat is as standard BPF_CALL
+ * to the external helper function.
*
* @param prm
- * Parameters used to create and initialise the BPF exeution context.
+ * Parameters used to create and initialise the BPF execution context.
* @param fname
* Pathname for a ELF file.
* @param sname
uint32_t num);
/**
- * Provide information about natively compield code for given BPF handle.
+ * Provide information about natively compiled code for given BPF handle.
*
* @param bpf
* handle for the BPF code.