Re: [PATCH v2 7/7] hw/net/can/xlnx-versal-canfd: Fix FIFO issues

2024-08-29 Thread Doug Brown
Hi Pavel, On 8/29/2024 6:24 AM, Pavel Pisa wrote: > Generally, I agree that index should wrap up for cyclic FIFO > implementation and change looks logical to me but I do not > see and studied all consequences related to emulated HW. > > If that is confirmed or corrected by somebody from AMD/Xilin

[PATCH v2 3/7] hw/net/can/xlnx-versal-canfd: Translate CAN ID registers

2024-08-26 Thread Doug Brown
uding RX filtering. Signed-off-by: Doug Brown Reviewed-by: Francisco Iglesias --- hw/net/can/xlnx-versal-canfd.c | 53 -- 1 file changed, 50 insertions(+), 3 deletions(-) diff --git a/hw/net/can/xlnx-versal-canfd.c b/hw/net/can/xlnx-versal-canfd.c index 89686

[PATCH v2 1/7] hw/net/can/xlnx-versal-canfd: Fix interrupt level

2024-08-26 Thread Doug Brown
: Doug Brown Reviewed-by: Francisco Iglesias --- hw/net/can/xlnx-versal-canfd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/net/can/xlnx-versal-canfd.c b/hw/net/can/xlnx-versal-canfd.c index 5f083c21e9..ad0c4da3c8 100644 --- a/hw/net/can/xlnx-versal-canfd.c +++ b/hw/net

[PATCH v2 5/7] hw/net/can/xlnx-versal-canfd: Fix byte ordering

2024-08-26 Thread Doug Brown
The endianness of the CAN data was backwards in each group of 4 bytes. For example, the following data: 00 11 22 33 44 55 66 77 was showing up like this: 33 22 11 00 77 66 55 44 Fix both the TX and RX code to put the data in the correct order. Signed-off-by: Doug Brown Reviewed-by: Francisco

[PATCH v2 7/7] hw/net/can/xlnx-versal-canfd: Fix FIFO issues

2024-08-26 Thread Doug Brown
calculation for wrapping the store index was off by one, which caused new messages to be written to the wrong location in the FIFO. This caused incorrect messages to be delivered. Signed-off-by: Doug Brown --- hw/net/can/xlnx-versal-canfd.c | 36 +++--- 1 file changed, 3

[PATCH v2 2/7] hw/net/can/xlnx-versal-canfd: Fix CAN FD flag check

2024-08-26 Thread Doug Brown
When checking the QEMU_CAN_FRMF_TYPE_FD flag, we need to ignore other potentially set flags. Before this change, received CAN FD frames from SocketCAN weren't being recognized as CAN FD. Signed-off-by: Doug Brown Reviewed-by: Pavel Pisa Reviewed-by: Francisco Iglesias --- hw/net/can

[PATCH v2 4/7] hw/net/can/xlnx-versal-canfd: Handle flags correctly

2024-08-26 Thread Doug Brown
Add support for QEMU_CAN_FRMF_ESI and QEMU_CAN_FRMF_BRS flags, and ensure frame->flags is always initialized to 0. Note that the Xilinx IP core doesn't allow manually setting the ESI bit during transmits, so it's only implemented for the receive case. Signed-off-by: Doug Brown --

[PATCH v2 6/7] hw/net/can/xlnx-versal-canfd: Simplify DLC conversions

2024-08-26 Thread Doug Brown
Use QEMU's helper functions can_dlc2len() and can_len2dlc() for translating between the raw DLC value and the SocketCAN length value. This also has the side effect of correctly handling received CAN FD frames with a DLC of 0-8, which was broken previously. Signed-off-by: Doug Brown --- h

[PATCH v2 0/7] hw/net/can/xlnx-versal-canfd: Miscellaneous fixes

2024-08-26 Thread Doug Brown
with SocketCAN on the host system. Changes in v2: - Added handling of ESI and BRS flags, ensured frame->flags is initialized - Switched to use common can_dlc2len() and can_len2dlc() functions - Added fix for FIFO wrapping problems I observed during stress testing Doug Brown (7): hw/net/can

Re: [PATCH 2/5] hw/net/can/xlnx-versal-canfd: Fix CAN FD flag check

2024-08-25 Thread Doug Brown
Hi Peter and Pavel, On 8/25/2024 10:30 AM, Peter Maydell wrote: > We're currently still in codefreeze for the upcoming 9.1 release, > so I would recommend sending a v2 with the extra patches. Nothing > except critical bugfixes is going to be applied upstream for > the next week or two. Thanks, t

Re: [PATCH 2/5] hw/net/can/xlnx-versal-canfd: Fix CAN FD flag check

2024-08-23 Thread Doug Brown
Hello Pavel and Francisco, On 8/21/2024 6:11 PM, Pavel Pisa wrote: > Vikram Garhwal is listed even as whole CAN subsystem comaintainer > > > https://gitlab.com/qemu-project/qemu/-/blob/3472f54522a928f0020d6928d54c007f862c5478/MAINTAINERS#L2690 Unfortunately I am totally new to submitting patc

Re: [PATCH 2/5] hw/net/can/xlnx-versal-canfd: Fix CAN FD flag check

2024-08-21 Thread Doug Brown
Hi Pavel, (Dropping Vikram from the email chain; I received "recipient not found" errors from AMD's mail servers in response to all of my patches) On 8/20/2024 11:57 PM, Pavel Pisa wrote: > Hello Doug Brown, > > On Friday 16 of August 2024 18:35:02 Doug Brown wrote: >

[PATCH 1/5] hw/net/can/xlnx-versal-canfd: Fix interrupt level

2024-08-16 Thread Doug Brown
: Doug Brown --- hw/net/can/xlnx-versal-canfd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/net/can/xlnx-versal-canfd.c b/hw/net/can/xlnx-versal-canfd.c index 5f083c21e9..ad0c4da3c8 100644 --- a/hw/net/can/xlnx-versal-canfd.c +++ b/hw/net/can/xlnx-versal-canfd.c

[PATCH 5/5] hw/net/can/xlnx-versal-canfd: Handle RX of short FD frames

2024-08-16 Thread Doug Brown
There was no case for handling received CAN FD frames with a DLC of 0-8. This was already handled properly with TX. Add similar code for RX. Signed-off-by: Doug Brown --- hw/net/can/xlnx-versal-canfd.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/hw/net/can

[PATCH 0/5] hw/net/can/xlnx-versal-canfd: Miscellaneous fixes

2024-08-16 Thread Doug Brown
tions. - Incoming CAN FD frames with DLC = 1-7 weren't handled correctly. I don't have any actual Versal hardware to compare behavior against, but with these changes, it plays nicely with SocketCAN on the host system. Doug Brown (5): hw/net/can/xlnx-versal-canfd: Fix interrupt level hw/net/

[PATCH 2/5] hw/net/can/xlnx-versal-canfd: Fix CAN FD flag check

2024-08-16 Thread Doug Brown
When checking the QEMU_CAN_FRMF_TYPE_FD flag, we need to ignore other potentially set flags. Before this change, received CAN FD frames from SocketCAN weren't being recognized as CAN FD. Signed-off-by: Doug Brown --- hw/net/can/xlnx-versal-canfd.c | 2 +- 1 file changed, 1 insertion(

[PATCH 3/5] hw/net/can/xlnx-versal-canfd: Translate CAN ID registers

2024-08-16 Thread Doug Brown
uding RX filtering. Signed-off-by: Doug Brown --- hw/net/can/xlnx-versal-canfd.c | 53 -- 1 file changed, 50 insertions(+), 3 deletions(-) diff --git a/hw/net/can/xlnx-versal-canfd.c b/hw/net/can/xlnx-versal-canfd.c index 8968672b84..1704b558d0 100644 --- a/hw/ne

[PATCH 4/5] hw/net/can/xlnx-versal-canfd: Fix byte ordering

2024-08-16 Thread Doug Brown
The endianness of the CAN data was backwards in each group of 4 bytes. For example, the following data: 00 11 22 33 44 55 66 77 was showing up like this: 33 22 11 00 77 66 55 44 Fix both the TX and RX code to put the data in the correct order. Signed-off-by: Doug Brown --- hw/net/can/xlnx