summaryrefslogtreecommitdiff
path: root/src/xdp/common/xdp_stats_kern.h
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-03-14 20:12:34 +0100
committerChristian Poessinger <christian@poessinger.com>2021-03-14 20:12:34 +0100
commit85ff856a32ccb5bc20604bacfb4fa5cb66375487 (patch)
tree9fa6fa4ef84c39dae14accc018187fce57fd91e2 /src/xdp/common/xdp_stats_kern.h
parent59ad580cdea2e66e24470ee3d84f29a8619b7bf9 (diff)
downloadvyos-1x-85ff856a32ccb5bc20604bacfb4fa5cb66375487.tar.gz
vyos-1x-85ff856a32ccb5bc20604bacfb4fa5cb66375487.zip
xdp: T2666: remove entire XDP code for 1.3 LTS image
This is an extension to commit 801c5235 ("xdp: T2666: disable this highly experimental feature in 1.3 LTS") by dropping all XDP references in the equuleus codebase.
Diffstat (limited to 'src/xdp/common/xdp_stats_kern.h')
-rw-r--r--src/xdp/common/xdp_stats_kern.h44
1 files changed, 0 insertions, 44 deletions
diff --git a/src/xdp/common/xdp_stats_kern.h b/src/xdp/common/xdp_stats_kern.h
deleted file mode 100644
index 4e08551a0..000000000
--- a/src/xdp/common/xdp_stats_kern.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-
-/* Used *ONLY* by BPF-prog running kernel side. */
-#ifndef __XDP_STATS_KERN_H
-#define __XDP_STATS_KERN_H
-
-/* Data record type 'struct datarec' is defined in common/xdp_stats_kern_user.h,
- * programs using this header must first include that file.
- */
-#ifndef __XDP_STATS_KERN_USER_H
-#warning "You forgot to #include <../common/xdp_stats_kern_user.h>"
-#include <../common/xdp_stats_kern_user.h>
-#endif
-
-/* Keeps stats per (enum) xdp_action */
-struct bpf_map_def SEC("maps") xdp_stats_map = {
- .type = BPF_MAP_TYPE_PERCPU_ARRAY,
- .key_size = sizeof(__u32),
- .value_size = sizeof(struct datarec),
- .max_entries = XDP_ACTION_MAX,
-};
-
-static __always_inline
-__u32 xdp_stats_record_action(struct xdp_md *ctx, __u32 action)
-{
- if (action >= XDP_ACTION_MAX)
- return XDP_ABORTED;
-
- /* Lookup in kernel BPF-side return pointer to actual data record */
- struct datarec *rec = bpf_map_lookup_elem(&xdp_stats_map, &action);
- if (!rec)
- return XDP_ABORTED;
-
- /* BPF_MAP_TYPE_PERCPU_ARRAY returns a data record specific to current
- * CPU and XDP hooks runs under Softirq, which makes it safe to update
- * without atomic operations.
- */
- rec->rx_packets++;
- rec->rx_bytes += (ctx->data_end - ctx->data);
-
- return action;
-}
-
-#endif /* __XDP_STATS_KERN_H */