On 31/01/17(Tue) 12:16, Jeremie Courreges-Anglas wrote: > Martin Pieuchot <[email protected]> writes: > [...] > Yes, but I don't know which threshold warrants introducing a new > function. So far those are the first cases for counters_dec(); that > includes wip rip6stat, icmp6stat, icmpstat and tcpstat. And I'm not > even sure those decrements make sense. I guess we can add counters_dec() > and then later remove it if it is deemed useless.
Let's convert all the counters first. If some people think it doesn't make sense they can change the code afterward. > >> @@ -222,7 +225,9 @@ rip6_input(struct mbuf **mp, int *offp, > >> ICMP6_PARAMPROB_NEXTHEADER, > >> prvnxtp - mtod(m, u_int8_t *)); > >> } > >> - ip6stat.ip6s_delivered--; > >> + counters = counters_enter(&ref, ip6counters); > >> + counters[ip6s_delivered]--; > >> + counters_leave(&ref, ip6counters); > > > > Should we also use your counters_dec() here or do you think it's better > > to merge icmp6_rip6_input() and rip6_input()? > > I'm fine with using counters_dec(), I can see that those functions are > almost twins but I don't want to open a can of worms... Why not? Fewer code is always good! Anyway, this is something for later.
