drop.h 955 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * OpenvSwitch drop reason list.
  4. */
  5. #ifndef OPENVSWITCH_DROP_H
  6. #define OPENVSWITCH_DROP_H
  7. #include <linux/skbuff.h>
  8. #include <net/dropreason.h>
  9. #define OVS_DROP_REASONS(R) \
  10. R(OVS_DROP_LAST_ACTION) \
  11. R(OVS_DROP_ACTION_ERROR) \
  12. R(OVS_DROP_EXPLICIT) \
  13. R(OVS_DROP_EXPLICIT_WITH_ERROR) \
  14. R(OVS_DROP_METER) \
  15. R(OVS_DROP_RECURSION_LIMIT) \
  16. R(OVS_DROP_DEFERRED_LIMIT) \
  17. R(OVS_DROP_FRAG_L2_TOO_LONG) \
  18. R(OVS_DROP_FRAG_INVALID_PROTO) \
  19. R(OVS_DROP_CONNTRACK) \
  20. R(OVS_DROP_IP_TTL) \
  21. /* deliberate comment for trailing \ */
  22. enum ovs_drop_reason {
  23. __OVS_DROP_REASON = SKB_DROP_REASON_SUBSYS_OPENVSWITCH <<
  24. SKB_DROP_REASON_SUBSYS_SHIFT,
  25. #define ENUM(x) x,
  26. OVS_DROP_REASONS(ENUM)
  27. #undef ENUM
  28. OVS_DROP_MAX,
  29. };
  30. static inline void
  31. ovs_kfree_skb_reason(struct sk_buff *skb, enum ovs_drop_reason reason)
  32. {
  33. kfree_skb_reason(skb, (u32)reason);
  34. }
  35. #endif /* OPENVSWITCH_DROP_H */