tc_csum.h 643 B

123456789101112131415161718192021222324252627282930313233
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __NET_TC_CSUM_H
  3. #define __NET_TC_CSUM_H
  4. #include <linux/types.h>
  5. #include <net/act_api.h>
  6. #include <linux/tc_act/tc_csum.h>
  7. struct tcf_csum_params {
  8. u32 update_flags;
  9. int action;
  10. struct rcu_head rcu;
  11. };
  12. struct tcf_csum {
  13. struct tc_action common;
  14. struct tcf_csum_params __rcu *params;
  15. };
  16. #define to_tcf_csum(a) ((struct tcf_csum *)a)
  17. static inline u32 tcf_csum_update_flags(const struct tc_action *a)
  18. {
  19. u32 update_flags;
  20. rcu_read_lock();
  21. update_flags = rcu_dereference(to_tcf_csum(a)->params)->update_flags;
  22. rcu_read_unlock();
  23. return update_flags;
  24. }
  25. #endif /* __NET_TC_CSUM_H */