On Fri, Feb 18, 2011 at 05:23:38PM +0100, Wolfgang Grandegger wrote:
> >> I want to drop incrementing the netdev stats errors. The CAN stats
> >> should be kept, of course. Currently, we increment both stats for bus
> >> errors, e.g.:
I would prefer to keep netdev stats (as generic as possible), and only keep
in CAN stats what is really different from ethernet.
> 
> First, not all bus errors are associated with rx:
> 
>   ACK errors may happen on TX
>   CRC errors may happen on RX
>   BIT errors may happen on RX *and* TX
>   FORM errors may happen on RX *and* TX
> 
[...]
> Any better idea?
I would agree most of the above.
However, I differentiate 2 situations:
1)
> >>   can_stats->bus_errors++;
> >>   stats->rx_errors++;

I believe these 2 structs have overlapping semantics, in the way that
some bus_errors are rx_errors, but not all (as Wolfgang explained).

This can be addressed by eliminating overlapping struct members.

I did a quick cross-comparison:
My proposal would be:
a) replace can_stats->arbitration_lost with stats->collisions
b) drop can_stats->bus_errors, use appropriate stats->XXX like
stats->tx_aborted_errors
stats->tx_carrier_errors
stats->rx_crc_errors
stats->rx_frame_errors

c) keep can_stats->{error_warning,error_passive,bus_off,restarts}.
I don't think an ethernet equivalent for these exists.

2)
>    stats->rx_over_errors++;
>    stats->rx_errors++;

This looks to me as bad interpretation of the netdev stats. Probably happened
to me too. 

Kurt
_______________________________________________
Socketcan-core mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-core

Reply via email to