History

sched: act_sample: Implement stats_update callback

Implement this callback in order to get the offloaded stats added to the kernel stats.

Ido Schimmel committed 5 years ago

Commit 58c04391 parent 762c1ad1 file · +11 −0Browse files

Unified · Split

net/sched/act_sample.c+11−0
@@ -194,6 +194,16 @@ static int tcf_sample_act(struct sk_buff *skb, const struct tc_action *a, · 193 unmodified lines
194194 return retval;
195195 }
196196
197+static void tcf_sample_stats_update(struct tc_action *a, u64 bytes, u64 packets,
198+ u64 drops, u64 lastuse, bool hw)
199+{
200+ struct tcf_sample *s = to_sample(a);
201+ struct tcf_t *tm = &s->tcf_tm;
202+
203+ tcf_action_update_stats(a, bytes, packets, drops, hw);
204+ tm->lastuse = max_t(u64, tm->lastuse, lastuse);
205+}
206+
197207 static int tcf_sample_dump(struct sk_buff *skb, struct tc_action *a,
198208 int bind, int ref)
199209 {
@@ -280,6 +290,7 @@ static struct tc_action_ops act_sample_ops = { · 80 unmodified lines
280290 .id = TCA_ID_SAMPLE,
281291 .owner = THIS_MODULE,
282292 .act = tcf_sample_act,
293+ .stats_update = tcf_sample_stats_update,
283294 .dump = tcf_sample_dump,
284295 .init = tcf_sample_init,
285296 .cleanup = tcf_sample_cleanup,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t