summaryrefslogtreecommitdiffstats
path: root/libbpf_android/include/bpf/BpfUtils.h
diff options
context:
space:
mode:
Diffstat (limited to 'libbpf_android/include/bpf/BpfUtils.h')
-rw-r--r--libbpf_android/include/bpf/BpfUtils.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/libbpf_android/include/bpf/BpfUtils.h b/libbpf_android/include/bpf/BpfUtils.h
index bb097bf..e67f664 100644
--- a/libbpf_android/include/bpf/BpfUtils.h
+++ b/libbpf_android/include/bpf/BpfUtils.h
@@ -57,6 +57,15 @@ static inline bool isAtLeastKernelVersion(unsigned major, unsigned minor, unsign
} \
} while (0)
+#define SKIP_IF_XDP_NOT_SUPPORTED \
+ do { \
+ if (!android::bpf::isAtLeastKernelVersion(5, 9, 0)) { \
+ GTEST_LOG_(INFO) << "This test is skipped since xdp" \
+ << "not supported\n"; \
+ return; \
+ } \
+ } while (0)
+
} // namespace bpf
} // namespace android