diff options
| author | David S. Miller <davem@davemloft.net> | 2017-05-31 17:58:14 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2017-05-31 17:58:14 -0400 |
| commit | d2e0ef493ad953048bdf562b06cc4330b3fd9fb7 (patch) | |
| tree | b938a4f6c4eaaa6eaf9ee3088aaa4742a70489bc /include | |
| parent | c380e377a50e944a2b9a892133b5a37b3ec90fe3 (diff) | |
| parent | 47eaa23b4c27d735cb797be71c711a99f99e9ff6 (diff) | |
| download | cachepc-linux-d2e0ef493ad953048bdf562b06cc4330b3fd9fb7.tar.gz cachepc-linux-d2e0ef493ad953048bdf562b06cc4330b3fd9fb7.zip | |
Merge branch 'nfp-move-BPF-offload-code-into-app'
Jakub Kicinski says:
====================
nfp: move BPF offload code into app
This series moves the eBPF offload code out of netdev/vNIC handling and
starts building the nfp_app. Port init is moved into the apps as well
because various apps associate vNICs, representors with ports differently.
First patch adds a helper for updating tc stats which has been waiting
in my tree to be included in any moderately related series.
Next series will bring communicating with FW using control messages,
then representors, BPF maps, tc flower... :)
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
| -rw-r--r-- | include/net/pkt_cls.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h index f7762295b7b8..537d0a0ad4c4 100644 --- a/include/net/pkt_cls.h +++ b/include/net/pkt_cls.h @@ -157,6 +157,25 @@ static inline void tcf_exts_to_list(const struct tcf_exts *exts, #endif } +static inline void +tcf_exts_stats_update(const struct tcf_exts *exts, + u64 bytes, u64 packets, u64 lastuse) +{ +#ifdef CONFIG_NET_CLS_ACT + int i; + + preempt_disable(); + + for (i = 0; i < exts->nr_actions; i++) { + struct tc_action *a = exts->actions[i]; + + tcf_action_stats_update(a, bytes, packets, lastuse); + } + + preempt_enable(); +#endif +} + /** * tcf_exts_exec - execute tc filter extensions * @skb: socket buffer |
