aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/pkt_cls.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/pkt_cls.h')
-rw-r--r--include/net/pkt_cls.h25
1 files changed, 14 insertions, 11 deletions
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index ef727f71336e..75a3f3fdb359 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -298,19 +298,13 @@ static inline void tcf_exts_put_net(struct tcf_exts *exts)
298#endif 298#endif
299} 299}
300 300
301static inline void tcf_exts_to_list(const struct tcf_exts *exts,
302 struct list_head *actions)
303{
304#ifdef CONFIG_NET_CLS_ACT 301#ifdef CONFIG_NET_CLS_ACT
305 int i; 302#define tcf_exts_for_each_action(i, a, exts) \
306 303 for (i = 0; i < TCA_ACT_MAX_PRIO && ((a) = (exts)->actions[i]); i++)
307 for (i = 0; i < exts->nr_actions; i++) { 304#else
308 struct tc_action *a = exts->actions[i]; 305#define tcf_exts_for_each_action(i, a, exts) \
309 306 for (; 0; (void)(i), (void)(a), (void)(exts))
310 list_add_tail(&a->list, actions);
311 }
312#endif 307#endif
313}
314 308
315static inline void 309static inline void
316tcf_exts_stats_update(const struct tcf_exts *exts, 310tcf_exts_stats_update(const struct tcf_exts *exts,
@@ -361,6 +355,15 @@ static inline bool tcf_exts_has_one_action(struct tcf_exts *exts)
361#endif 355#endif
362} 356}
363 357
358static inline struct tc_action *tcf_exts_first_action(struct tcf_exts *exts)
359{
360#ifdef CONFIG_NET_CLS_ACT
361 return exts->actions[0];
362#else
363 return NULL;
364#endif
365}
366
364/** 367/**
365 * tcf_exts_exec - execute tc filter extensions 368 * tcf_exts_exec - execute tc filter extensions
366 * @skb: socket buffer 369 * @skb: socket buffer