add SKIP_IF_XDP_NOT_SUPPORTED macro am: a36bed395f

Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1555041

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I6031e2218630aea6143b5eb2d922d7f6e92a2dd7
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 @@
         }                                                                         \
     } 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