aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
Diffstat (limited to 'include/net')
-rw-r--r--include/net/act_api.h23
-rw-r--r--include/net/af_rxrpc.h2
-rw-r--r--include/net/gre.h1
-rw-r--r--include/net/inet_ecn.h3
-rw-r--r--include/net/mac80211.h3
-rw-r--r--include/net/pkt_cls.h41
6 files changed, 47 insertions, 26 deletions
diff --git a/include/net/act_api.h b/include/net/act_api.h
index 41e6a24a44b9..82f3c912a5b1 100644
--- a/include/net/act_api.h
+++ b/include/net/act_api.h
@@ -176,8 +176,8 @@ int tcf_register_action(struct tc_action_ops *a, struct pernet_operations *ops);
176int tcf_unregister_action(struct tc_action_ops *a, 176int tcf_unregister_action(struct tc_action_ops *a,
177 struct pernet_operations *ops); 177 struct pernet_operations *ops);
178int tcf_action_destroy(struct list_head *actions, int bind); 178int tcf_action_destroy(struct list_head *actions, int bind);
179int tcf_action_exec(struct sk_buff *skb, const struct list_head *actions, 179int tcf_action_exec(struct sk_buff *skb, struct tc_action **actions,
180 struct tcf_result *res); 180 int nr_actions, struct tcf_result *res);
181int tcf_action_init(struct net *net, struct nlattr *nla, 181int tcf_action_init(struct net *net, struct nlattr *nla,
182 struct nlattr *est, char *n, int ovr, 182 struct nlattr *est, char *n, int ovr,
183 int bind, struct list_head *); 183 int bind, struct list_head *);
@@ -189,30 +189,17 @@ int tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int, int);
189int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int, int); 189int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int, int);
190int tcf_action_copy_stats(struct sk_buff *, struct tc_action *, int); 190int tcf_action_copy_stats(struct sk_buff *, struct tc_action *, int);
191 191
192#define tc_no_actions(_exts) \ 192#endif /* CONFIG_NET_CLS_ACT */
193 (list_empty(&(_exts)->actions))
194
195#define tc_for_each_action(_a, _exts) \
196 list_for_each_entry(a, &(_exts)->actions, list)
197
198#define tc_single_action(_exts) \
199 (list_is_singular(&(_exts)->actions))
200 193
201static inline void tcf_action_stats_update(struct tc_action *a, u64 bytes, 194static inline void tcf_action_stats_update(struct tc_action *a, u64 bytes,
202 u64 packets, u64 lastuse) 195 u64 packets, u64 lastuse)
203{ 196{
197#ifdef CONFIG_NET_CLS_ACT
204 if (!a->ops->stats_update) 198 if (!a->ops->stats_update)
205 return; 199 return;
206 200
207 a->ops->stats_update(a, bytes, packets, lastuse); 201 a->ops->stats_update(a, bytes, packets, lastuse);
202#endif
208} 203}
209 204
210#else /* CONFIG_NET_CLS_ACT */
211
212#define tc_no_actions(_exts) true
213#define tc_for_each_action(_a, _exts) while ((void)(_a), 0)
214#define tc_single_action(_exts) false
215#define tcf_action_stats_update(a, bytes, packets, lastuse)
216
217#endif /* CONFIG_NET_CLS_ACT */
218#endif 205#endif
diff --git a/include/net/af_rxrpc.h b/include/net/af_rxrpc.h
index ac1bc3c49fbd..7b0f88699b25 100644
--- a/include/net/af_rxrpc.h
+++ b/include/net/af_rxrpc.h
@@ -40,12 +40,12 @@ struct rxrpc_call *rxrpc_kernel_begin_call(struct socket *,
40 unsigned long, 40 unsigned long,
41 gfp_t); 41 gfp_t);
42int rxrpc_kernel_send_data(struct rxrpc_call *, struct msghdr *, size_t); 42int rxrpc_kernel_send_data(struct rxrpc_call *, struct msghdr *, size_t);
43void rxrpc_kernel_data_consumed(struct rxrpc_call *, struct sk_buff *);
43void rxrpc_kernel_abort_call(struct rxrpc_call *, u32); 44void rxrpc_kernel_abort_call(struct rxrpc_call *, u32);
44void rxrpc_kernel_end_call(struct rxrpc_call *); 45void rxrpc_kernel_end_call(struct rxrpc_call *);
45bool rxrpc_kernel_is_data_last(struct sk_buff *); 46bool rxrpc_kernel_is_data_last(struct sk_buff *);
46u32 rxrpc_kernel_get_abort_code(struct sk_buff *); 47u32 rxrpc_kernel_get_abort_code(struct sk_buff *);
47int rxrpc_kernel_get_error_number(struct sk_buff *); 48int rxrpc_kernel_get_error_number(struct sk_buff *);
48void rxrpc_kernel_data_delivered(struct sk_buff *);
49void rxrpc_kernel_free_skb(struct sk_buff *); 49void rxrpc_kernel_free_skb(struct sk_buff *);
50struct rxrpc_call *rxrpc_kernel_accept_call(struct socket *, unsigned long); 50struct rxrpc_call *rxrpc_kernel_accept_call(struct socket *, unsigned long);
51int rxrpc_kernel_reject_call(struct socket *); 51int rxrpc_kernel_reject_call(struct socket *);
diff --git a/include/net/gre.h b/include/net/gre.h
index 7a54a31d1d4c..73ea256eb7d7 100644
--- a/include/net/gre.h
+++ b/include/net/gre.h
@@ -104,6 +104,7 @@ static inline void gre_build_header(struct sk_buff *skb, int hdr_len,
104 104
105 skb_push(skb, hdr_len); 105 skb_push(skb, hdr_len);
106 106
107 skb_set_inner_protocol(skb, proto);
107 skb_reset_transport_header(skb); 108 skb_reset_transport_header(skb);
108 greh = (struct gre_base_hdr *)skb->data; 109 greh = (struct gre_base_hdr *)skb->data;
109 greh->flags = gre_tnl_flags_to_gre_flags(flags); 110 greh->flags = gre_tnl_flags_to_gre_flags(flags);
diff --git a/include/net/inet_ecn.h b/include/net/inet_ecn.h
index 0dc0a51da38f..dce2d586d9ce 100644
--- a/include/net/inet_ecn.h
+++ b/include/net/inet_ecn.h
@@ -128,7 +128,8 @@ static inline int IP6_ECN_set_ce(struct sk_buff *skb, struct ipv6hdr *iph)
128 to = from | htonl(INET_ECN_CE << 20); 128 to = from | htonl(INET_ECN_CE << 20);
129 *(__be32 *)iph = to; 129 *(__be32 *)iph = to;
130 if (skb->ip_summed == CHECKSUM_COMPLETE) 130 if (skb->ip_summed == CHECKSUM_COMPLETE)
131 skb->csum = csum_add(csum_sub(skb->csum, from), to); 131 skb->csum = csum_add(csum_sub(skb->csum, (__force __wsum)from),
132 (__force __wsum)to);
132 return 1; 133 return 1;
133} 134}
134 135
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index b4faadbb4e01..cca510a585c3 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -3620,7 +3620,8 @@ struct ieee80211_ops {
3620 3620
3621 int (*join_ibss)(struct ieee80211_hw *hw, struct ieee80211_vif *vif); 3621 int (*join_ibss)(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
3622 void (*leave_ibss)(struct ieee80211_hw *hw, struct ieee80211_vif *vif); 3622 void (*leave_ibss)(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
3623 u32 (*get_expected_throughput)(struct ieee80211_sta *sta); 3623 u32 (*get_expected_throughput)(struct ieee80211_hw *hw,
3624 struct ieee80211_sta *sta);
3624 int (*get_txpower)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 3625 int (*get_txpower)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
3625 int *dbm); 3626 int *dbm);
3626 3627
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index 6f8d65342d3a..c99508d426cc 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -59,7 +59,8 @@ tcf_unbind_filter(struct tcf_proto *tp, struct tcf_result *r)
59struct tcf_exts { 59struct tcf_exts {
60#ifdef CONFIG_NET_CLS_ACT 60#ifdef CONFIG_NET_CLS_ACT
61 __u32 type; /* for backward compat(TCA_OLD_COMPAT) */ 61 __u32 type; /* for backward compat(TCA_OLD_COMPAT) */
62 struct list_head actions; 62 int nr_actions;
63 struct tc_action **actions;
63#endif 64#endif
64 /* Map to export classifier specific extension TLV types to the 65 /* Map to export classifier specific extension TLV types to the
65 * generic extensions API. Unsupported extensions must be set to 0. 66 * generic extensions API. Unsupported extensions must be set to 0.
@@ -72,7 +73,10 @@ static inline void tcf_exts_init(struct tcf_exts *exts, int action, int police)
72{ 73{
73#ifdef CONFIG_NET_CLS_ACT 74#ifdef CONFIG_NET_CLS_ACT
74 exts->type = 0; 75 exts->type = 0;
75 INIT_LIST_HEAD(&exts->actions); 76 exts->nr_actions = 0;
77 exts->actions = kcalloc(TCA_ACT_MAX_PRIO, sizeof(struct tc_action *),
78 GFP_KERNEL);
79 WARN_ON(!exts->actions); /* TODO: propagate the error to callers */
76#endif 80#endif
77 exts->action = action; 81 exts->action = action;
78 exts->police = police; 82 exts->police = police;
@@ -89,7 +93,7 @@ static inline int
89tcf_exts_is_predicative(struct tcf_exts *exts) 93tcf_exts_is_predicative(struct tcf_exts *exts)
90{ 94{
91#ifdef CONFIG_NET_CLS_ACT 95#ifdef CONFIG_NET_CLS_ACT
92 return !list_empty(&exts->actions); 96 return exts->nr_actions;
93#else 97#else
94 return 0; 98 return 0;
95#endif 99#endif
@@ -108,6 +112,20 @@ tcf_exts_is_available(struct tcf_exts *exts)
108 return tcf_exts_is_predicative(exts); 112 return tcf_exts_is_predicative(exts);
109} 113}
110 114
115static inline void tcf_exts_to_list(const struct tcf_exts *exts,
116 struct list_head *actions)
117{
118#ifdef CONFIG_NET_CLS_ACT
119 int i;
120
121 for (i = 0; i < exts->nr_actions; i++) {
122 struct tc_action *a = exts->actions[i];
123
124 list_add(&a->list, actions);
125 }
126#endif
127}
128
111/** 129/**
112 * tcf_exts_exec - execute tc filter extensions 130 * tcf_exts_exec - execute tc filter extensions
113 * @skb: socket buffer 131 * @skb: socket buffer
@@ -124,12 +142,25 @@ tcf_exts_exec(struct sk_buff *skb, struct tcf_exts *exts,
124 struct tcf_result *res) 142 struct tcf_result *res)
125{ 143{
126#ifdef CONFIG_NET_CLS_ACT 144#ifdef CONFIG_NET_CLS_ACT
127 if (!list_empty(&exts->actions)) 145 if (exts->nr_actions)
128 return tcf_action_exec(skb, &exts->actions, res); 146 return tcf_action_exec(skb, exts->actions, exts->nr_actions,
147 res);
129#endif 148#endif
130 return 0; 149 return 0;
131} 150}
132 151
152#ifdef CONFIG_NET_CLS_ACT
153
154#define tc_no_actions(_exts) ((_exts)->nr_actions == 0)
155#define tc_single_action(_exts) ((_exts)->nr_actions == 1)
156
157#else /* CONFIG_NET_CLS_ACT */
158
159#define tc_no_actions(_exts) true
160#define tc_single_action(_exts) false
161
162#endif /* CONFIG_NET_CLS_ACT */
163
133int tcf_exts_validate(struct net *net, struct tcf_proto *tp, 164int tcf_exts_validate(struct net *net, struct tcf_proto *tp,
134 struct nlattr **tb, struct nlattr *rate_tlv, 165 struct nlattr **tb, struct nlattr *rate_tlv,
135 struct tcf_exts *exts, bool ovr); 166 struct tcf_exts *exts, bool ovr);