act_api.c (6870112c46c867f50cd27570860a05bd82614b5c) | act_api.c (4b61d3e8d3daebbde7ec02d593f84248fdf8bec2) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-or-later 2/* 3 * net/sched/act_api.c Packet action API. 4 * 5 * Author: Jamal Hadi Salim 6 */ 7 8#include <linux/types.h> --- 1045 unchanged lines hidden (view full) --- 1054 *attr_size = tcf_action_full_attrs_size(sz); 1055 return i - 1; 1056 1057err: 1058 tcf_action_destroy(actions, bind); 1059 return err; 1060} 1061 | 1// SPDX-License-Identifier: GPL-2.0-or-later 2/* 3 * net/sched/act_api.c Packet action API. 4 * 5 * Author: Jamal Hadi Salim 6 */ 7 8#include <linux/types.h> --- 1045 unchanged lines hidden (view full) --- 1054 *attr_size = tcf_action_full_attrs_size(sz); 1055 return i - 1; 1056 1057err: 1058 tcf_action_destroy(actions, bind); 1059 return err; 1060} 1061 |
1062void tcf_action_update_stats(struct tc_action *a, u64 bytes, u32 packets, 1063 bool drop, bool hw) | 1062void tcf_action_update_stats(struct tc_action *a, u64 bytes, u64 packets, 1063 u64 drops, bool hw) |
1064{ 1065 if (a->cpu_bstats) { 1066 _bstats_cpu_update(this_cpu_ptr(a->cpu_bstats), bytes, packets); 1067 | 1064{ 1065 if (a->cpu_bstats) { 1066 _bstats_cpu_update(this_cpu_ptr(a->cpu_bstats), bytes, packets); 1067 |
1068 if (drop) 1069 this_cpu_ptr(a->cpu_qstats)->drops += packets; | 1068 this_cpu_ptr(a->cpu_qstats)->drops += drops; |
1070 1071 if (hw) 1072 _bstats_cpu_update(this_cpu_ptr(a->cpu_bstats_hw), 1073 bytes, packets); 1074 return; 1075 } 1076 1077 _bstats_update(&a->tcfa_bstats, bytes, packets); | 1069 1070 if (hw) 1071 _bstats_cpu_update(this_cpu_ptr(a->cpu_bstats_hw), 1072 bytes, packets); 1073 return; 1074 } 1075 1076 _bstats_update(&a->tcfa_bstats, bytes, packets); |
1078 if (drop) 1079 a->tcfa_qstats.drops += packets; | 1077 a->tcfa_qstats.drops += drops; |
1080 if (hw) 1081 _bstats_update(&a->tcfa_bstats_hw, bytes, packets); 1082} 1083EXPORT_SYMBOL(tcf_action_update_stats); 1084 1085int tcf_action_copy_stats(struct sk_buff *skb, struct tc_action *p, 1086 int compat_mode) 1087{ --- 557 unchanged lines hidden --- | 1078 if (hw) 1079 _bstats_update(&a->tcfa_bstats_hw, bytes, packets); 1080} 1081EXPORT_SYMBOL(tcf_action_update_stats); 1082 1083int tcf_action_copy_stats(struct sk_buff *skb, struct tc_action *p, 1084 int compat_mode) 1085{ --- 557 unchanged lines hidden --- |