aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenzo Bianconi <lorenzo@kernel.org>2022-01-21 11:09:54 +0100
committerQuentin Monnet <qmonnet+github@qoba.lt>2022-01-26 19:55:00 +0000
commit02ada0f1ddd58964f515c60e58f0541bf7bb80ce (patch)
treecbcedd5853d352cf611959f702a57f024c84abe5
parent16cc94df4c0669d2af13b93bc6483f7301520a89 (diff)
downloadbpftool-02ada0f1ddd58964f515c60e58f0541bf7bb80ce.tar.gz
bpf: introduce bpf_xdp_get_buff_len helper
Introduce bpf_xdp_get_buff_len helper in order to return the xdp buffer total size (linear and paged area) Acked-by: Toke Hoiland-Jorgensen <toke@redhat.com> Acked-by: John Fastabend <john.fastabend@gmail.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Link: https://lore.kernel.org/r/aac9ac3504c84026cf66a3c71b7c5ae89bc991be.1642758637.git.lorenzo@kernel.org Signed-off-by: Alexei Starovoitov <ast@kernel.org>
-rw-r--r--include/uapi/linux/bpf.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index 945649c..5a28772 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -5054,6 +5054,12 @@ union bpf_attr {
* This helper is currently supported by cgroup programs only.
* Return
* 0 on success, or a negative error in case of failure.
+ *
+ * u64 bpf_xdp_get_buff_len(struct xdp_buff *xdp_md)
+ * Description
+ * Get the total size of a given xdp buff (linear and paged area)
+ * Return
+ * The total size of a given xdp buffer.
*/
#define __BPF_FUNC_MAPPER(FN) \
FN(unspec), \
@@ -5244,6 +5250,7 @@ union bpf_attr {
FN(get_func_arg_cnt), \
FN(get_retval), \
FN(set_retval), \
+ FN(xdp_get_buff_len), \
/* */
/* integer value in 'imm' field of BPF_CALL instruction selects which helper