Implement this callback in order to get the offloaded stats added to the kernel stats.
Unified · Split
| @@ -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 | ||
| 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 | |||
| 197 | static int tcf_sample_dump(struct sk_buff *skb, struct tc_action *a, | 207 | static 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, |