Re: [PATCH v2] can: xilinx_can: avoid non-requested bus error frames

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4.10.2019 23.30, Marc Kleine-Budde wrote:
> From: Anssi Hannula <anssi.hannula@xxxxxxxxxx>
>
> Userspace can signal with CAN_CTRLMODE_BERR_REPORTING whether they need
> reporting of bus errors (CAN_ERR_BUSERROR) or not.
>
> However, xilinx_can driver currently always sends CAN_ERR_BUSERROR
> frames to userspace on bus errors.
>
> To improve performance on error conditions when bus error reporting is
> not needed, avoid sending CAN_ERR_BUSERROR frames unless requested via
> CAN_CTRLMODE_BERR_REPORTING.
>
> The error interrupt is still kept enabled as there is no dedicated state
> transition interrupt, but just disabling error frame submission still
> yields a significant performance improvement. In a simple test with
> continuous bus errors and no userspace programs reading/writing CAN I
> saw system CPU load reduced by 1/3.
>
> Tested on a ZynqMP board with CAN-FD v1.0.
>
> Signed-off-by: Anssi Hannula <anssi.hannula@xxxxxxxxxx>
> Signed-off-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>
> ---
> Hello,
>
> taking up Anssi Hannula's work.
>
> changes since v1:
> - xcan_err_interrupt(): use C99 initializers instead of memset() to
>   initialize struct can_frame cf.
> - xcan_err_interrupt(): convert initialization of berr_reporting to use
>   "if".
>
> Please test.

Thanks, I tried it on my HW and it seems to work like v1.


> regards,
> Marc
>
>  drivers/net/can/xilinx_can.c | 89 +++++++++++++++++++-----------------
>  1 file changed, 48 insertions(+), 41 deletions(-)
[...]

-- 
Anssi Hannula / Bitwise Oy
+358 503803997




[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux