xdp_metadata.h 817 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #pragma once
  3. #ifndef ETH_P_IP
  4. #define ETH_P_IP 0x0800
  5. #endif
  6. #ifndef ETH_P_IPV6
  7. #define ETH_P_IPV6 0x86DD
  8. #endif
  9. #ifndef ETH_P_8021Q
  10. #define ETH_P_8021Q 0x8100
  11. #endif
  12. #ifndef ETH_P_8021AD
  13. #define ETH_P_8021AD 0x88A8
  14. #endif
  15. #ifndef BIT
  16. #define BIT(nr) (1 << (nr))
  17. #endif
  18. /* Non-existent checksum status */
  19. #define XDP_CHECKSUM_MAGIC BIT(2)
  20. enum xdp_meta_field {
  21. XDP_META_FIELD_TS = BIT(0),
  22. XDP_META_FIELD_RSS = BIT(1),
  23. XDP_META_FIELD_VLAN_TAG = BIT(2),
  24. };
  25. struct xdp_meta {
  26. union {
  27. __u64 rx_timestamp;
  28. __s32 rx_timestamp_err;
  29. };
  30. __u64 xdp_timestamp;
  31. __u32 rx_hash;
  32. union {
  33. __u32 rx_hash_type;
  34. __s32 rx_hash_err;
  35. };
  36. union {
  37. struct {
  38. __be16 rx_vlan_proto;
  39. __u16 rx_vlan_tci;
  40. };
  41. __s32 rx_vlan_tag_err;
  42. };
  43. enum xdp_meta_field hint_valid;
  44. };