mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RFC PATCH v2 0/6] can: dev: add generic function can_update_bus_error_stats()
@ 2024-10-29  8:44 Dario Binacchi
  2024-10-29  8:44 ` [RFC PATCH v2 1/6] " Dario Binacchi
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Dario Binacchi @ 2024-10-29  8:44 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-amarula, Dario Binacchi, Alexandra Winter, Andrew Lunn,
	David S. Miller, Eric Dumazet, Frank Li, Gal Pressman,
	Haibo Chen, Han Xu, Jakub Kicinski, Kory Maincent,
	Marc Kleine-Budde, Paolo Abeni, Rob Herring, Sabrina Dubroca,
	Shannon Nelson, Simon Horman, Uwe Kleine-König,
	Vincent Mailhol, linux-can, netdev

This series originates from some tests I ran on a CAN communication for
one of my clients that reports sporadic errors. After enabling BERR
reporting, I was surprised that the command:

ip -details -statistics link show can0

did not display the occurrence of different types of errors, but only the
generic ones for reception and transmission. In trying to export this
information, I felt that the code related to managing statistics and handling
CAN errors (CRC, STUF, BIT, ACK, and FORM) was quite duplicated in the
implementation of various drivers, and there wasn't a generic function like
in the case of state changes (i. e. can_change_state). This led to the idea
of adding can_update_bus_error_stats() and the helpers for setting up the
CAN error frame.

Regarding patch 5/6 ("can: netlink: extend stats to the error types (ack,
CRC, form, ..."), I ran

./scripts/check-uapi.sh

which found

"error - 1/934 UAPI headers compatible with x86 appear _not_ to be backwards
compatible."

I included it in the series because I am currently interested in understanding
whether the idea behind each of the submitted patches makes sense, and I can
adjust them later if the response is positive, following your suggestions.

Changes in v2:
- Replace macros with static inline functions
- Update the commit message
- Replace the macros with static inline funcions calls.
- Update the commit message

Dario Binacchi (6):
  can: dev: add generic function can_update_bus_error_stats()
  can: flexcan: use can_update_bus_error_stats()
  can: dev: add helpers to setup an error frame
  can: flexcan: use helpers to setup the error frame
  can: netlink: extend stats to the error types (ack, CRC, form, ...)
  can: dev: update the error types stats (ack, CRC, form, ...)

 drivers/net/can/dev/dev.c              | 45 ++++++++++++++++++++++++
 drivers/net/can/flexcan/flexcan-core.c | 29 +++++-----------
 include/linux/can/dev.h                | 47 ++++++++++++++++++++++++++
 include/uapi/linux/can/netlink.h       |  6 ++++
 4 files changed, 106 insertions(+), 21 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-10-29  8:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-29  8:44 [RFC PATCH v2 0/6] can: dev: add generic function can_update_bus_error_stats() Dario Binacchi
2024-10-29  8:44 ` [RFC PATCH v2 1/6] " Dario Binacchi
2024-10-29  8:49   ` Marc Kleine-Budde
2024-10-29  8:44 ` [RFC PATCH v2 2/6] can: flexcan: use can_update_bus_error_stats() Dario Binacchi
2024-10-29  8:44 ` [RFC PATCH v2 3/6] can: dev: add helpers to setup an error frame Dario Binacchi
2024-10-29  8:57   ` Marc Kleine-Budde
2024-10-29  8:44 ` [RFC PATCH v2 4/6] can: flexcan: use helpers to setup the " Dario Binacchi
2024-10-29  8:44 ` [RFC PATCH v2 5/6] can: netlink: extend stats to the error types (ack, CRC, form, ...) Dario Binacchi
2024-10-29  8:44 ` [RFC PATCH v2 6/6] can: dev: update the error types stats " Dario Binacchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®