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
194 return retval;194 return retval;
195}195}
196 196
197static 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
197static int tcf_sample_dump(struct sk_buff *skb, struct tc_action *a,207static int tcf_sample_dump(struct sk_buff *skb, struct tc_action *a,
198 int bind, int ref)208 int bind, int ref)
199{209{
@@ -280,6 +290,7 @@ static struct tc_action_ops act_sample_ops = { · 80 unmodified lines
280 .id = TCA_ID_SAMPLE,290 .id = TCA_ID_SAMPLE,
281 .owner = THIS_MODULE,291 .owner = THIS_MODULE,
282 .act = tcf_sample_act,292 .act = tcf_sample_act,
293 .stats_update = tcf_sample_stats_update,
283 .dump = tcf_sample_dump,294 .dump = tcf_sample_dump,
284 .init = tcf_sample_init,295 .init = tcf_sample_init,
285 .cleanup = tcf_sample_cleanup,296 .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