Linux Audio

Check our new training course

Loading...
v5.14.15
 1/* SPDX-License-Identifier: GPL-2.0 */
 2#ifndef __NET_TC_CSUM_H
 3#define __NET_TC_CSUM_H
 4
 5#include <linux/types.h>
 6#include <net/act_api.h>
 7#include <linux/tc_act/tc_csum.h>
 8
 9struct tcf_csum_params {
 
10	u32 update_flags;
11	struct rcu_head rcu;
12};
13
14struct tcf_csum {
15	struct tc_action common;
16
17	struct tcf_csum_params __rcu *params;
18};
19#define to_tcf_csum(a) ((struct tcf_csum *)a)
20
21static inline bool is_tcf_csum(const struct tc_action *a)
22{
23#ifdef CONFIG_NET_CLS_ACT
24	if (a->ops && a->ops->id == TCA_ID_CSUM)
25		return true;
26#endif
27	return false;
28}
29
30static inline u32 tcf_csum_update_flags(const struct tc_action *a)
31{
32	u32 update_flags;
33
34	rcu_read_lock();
35	update_flags = rcu_dereference(to_tcf_csum(a)->params)->update_flags;
36	rcu_read_unlock();
37
38	return update_flags;
39}
40
41#endif /* __NET_TC_CSUM_H */
v4.17
 1/* SPDX-License-Identifier: GPL-2.0 */
 2#ifndef __NET_TC_CSUM_H
 3#define __NET_TC_CSUM_H
 4
 5#include <linux/types.h>
 6#include <net/act_api.h>
 7#include <linux/tc_act/tc_csum.h>
 8
 9struct tcf_csum_params {
10	int action;
11	u32 update_flags;
12	struct rcu_head rcu;
13};
14
15struct tcf_csum {
16	struct tc_action common;
17
18	struct tcf_csum_params __rcu *params;
19};
20#define to_tcf_csum(a) ((struct tcf_csum *)a)
21
22static inline bool is_tcf_csum(const struct tc_action *a)
23{
24#ifdef CONFIG_NET_CLS_ACT
25	if (a->ops && a->ops->type == TCA_ACT_CSUM)
26		return true;
27#endif
28	return false;
29}
30
31static inline u32 tcf_csum_update_flags(const struct tc_action *a)
32{
33	u32 update_flags;
34
35	rcu_read_lock();
36	update_flags = rcu_dereference(to_tcf_csum(a)->params)->update_flags;
37	rcu_read_unlock();
38
39	return update_flags;
40}
41
42#endif /* __NET_TC_CSUM_H */