[5/6] can: netlink: extend stats to the error types (ack, CRC, form, ...)

Message ID 20241011162341.606443-5-dario.binacchi@amarulasolutions.com
State New
Headers show
Series
  • [1/6] can: dev: add generic function can_update_bus_error_stats()
Related show

Commit Message

Dario Binacchi Oct. 11, 2024, 4:23 p.m. UTC
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Change-Id: Ia81c2ed814f8d06cde63352519e56981d3e43bba
---
 include/uapi/linux/can/netlink.h | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Michael Trimarchi Oct. 11, 2024, 6:09 p.m. UTC | #1
HI Dario

On Fri, Oct 11, 2024 at 6:23 PM Dario Binacchi
<dario.binacchi@amarulasolutions.com> wrote:
>
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> Change-Id: Ia81c2ed814f8d06cde63352519e56981d3e43bba
> ---
>  include/uapi/linux/can/netlink.h | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/include/uapi/linux/can/netlink.h b/include/uapi/linux/can/netlink.h
> index 9f56fad4785b..a694fd478efe 100644
> --- a/include/uapi/linux/can/netlink.h
> +++ b/include/uapi/linux/can/netlink.h
> @@ -111,6 +111,11 @@ struct can_device_stats {
>         __u32 bus_off;          /* Changes to bus off state */
>         __u32 arbitration_lost; /* Arbitration lost errors */
>         __u32 restarts;         /* CAN controller re-starts */
> +       __u32 bit_error;        /* Bit error */
> +       __u32 stuff_error;      /* Bit stuffing error */
> +       __u32 form_error;       /* form error */
> +       __u32 ack_error;        /* ack error */
> +       __u32 crc_error;        /* CRC error */
>  };
>

Please check if you broke uapi compatibility

./scripts/check-uapi.sh -b HEAD -p HEAD^
Installing user-facing UAPI headers from HEAD... OK
Installing user-facing UAPI headers from HEAD^... OK
Checking changes to UAPI headers between HEAD^ and HEAD...
==== ABI differences detected in include/linux/can/netlink.h from
HEAD^ -> HEAD ====
    [C] 'struct can_device_stats' changed:
      type size changed from 192 to 224 (in bits)
      1 data member insertion:
        '__u32 bits', at offset 192 (in bits) at netlink.h:117:1
=====================================================================================

error - 1/930 UAPI headers compatible with x86 appear _not_ to be
backwards compatible


For instance I have tried to add one field in that struct. There are
no padding or exstension of it so I think that we need to see how this
can be extendend

https://lpc.events/event/17/contributions/1642/attachments/1161/2401/Improving_UAPI_Review.pdf

Michael

>  /*
> --
> 2.43.0
>

Patch

diff --git a/include/uapi/linux/can/netlink.h b/include/uapi/linux/can/netlink.h
index 9f56fad4785b..a694fd478efe 100644
--- a/include/uapi/linux/can/netlink.h
+++ b/include/uapi/linux/can/netlink.h
@@ -111,6 +111,11 @@  struct can_device_stats {
 	__u32 bus_off;		/* Changes to bus off state */
 	__u32 arbitration_lost; /* Arbitration lost errors */
 	__u32 restarts;		/* CAN controller re-starts */
+	__u32 bit_error;        /* Bit error */
+	__u32 stuff_error;      /* Bit stuffing error */
+	__u32 form_error;       /* form error */
+	__u32 ack_error;        /* ack error */
+	__u32 crc_error;        /* CRC error */
 };
 
 /*