why not a set of counters which are toggled between.
e.g.
struct netdevice... {
uint64 tx_pkts_counter[2];
uint64 tx_octets_counter[2];
uint64 rx_pkts_counter[2];
uint64 rx_octets_counter[2];
int counter_bounce;
...
}
where readers simply do something like:
tx_bytes +=
netdevice[foo]->tx_octets_counter[(netdevice[foo]->counter_bounce)];
and writer(s) alternate between updating one uint64 and an alternate one?
in this manner, you don't need to do any special synchronization or atomic
updates or have any dependency on any particular architecture being able to
do atomic 64-bit ops.
cheers,
lincoln.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/