From: Doug Brown <doug@schmorgal.com>
To: Pavel Pisa <pisa@fel.cvut.cz>
Cc: Francisco Iglesias <francisco.iglesias@amd.com>,
Jason Wang <jasowang@redhat.com>,
qemu-devel@nongnu.org
Subject: Re: [PATCH 2/5] hw/net/can/xlnx-versal-canfd: Fix CAN FD flag check
Date: Wed, 21 Aug 2024 17:01:01 -0700 [thread overview]
Message-ID: <fdce5258-59f7-486c-bfd1-a4befdf72e3e@schmorgal.com> (raw)
In-Reply-To: <202408210857.20254.pisa@fel.cvut.cz>
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:
>> - if (frame->flags == QEMU_CAN_FRMF_TYPE_FD) {
>> + if (frame->flags & QEMU_CAN_FRMF_TYPE_FD) {
>
> Reviewed-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
>
> That is a great catch, I have overlooked this in previous
> review of the Xilinx code.
Thank you for reviewing!
> When I look into hw/net/can/xlnx-versal-canfd.c functions
> regs2frame and store_rx_sequential then I see missing
> handling of flags QEMU_CAN_FRMF_ESI and QEMU_CAN_FRMF_BRS.
Nice find. It looks like it would be pretty straightforward to add
support for those flags. As far as I can tell they map directly to
register bits.
> In the function regs2frame is missing even initialization
> of frame->flags = 0 at the start, which I expect should be there.
> The
> frame->flags = QEMU_CAN_FRMF_TYPE_FD;
> should be then
> frame->flags |= QEMU_CAN_FRMF_TYPE_FD;
You're absolutely right. It looks like frame->flags isn't being
initialized at all when it's a non-FD frame. I can also take care of
this. I'll wait and see how the review goes for the other patches, and I
can add another patch to fix these flag issues in the next version of
the series.
> As for the DLC conversion, there are functions
>
> frame->can_dlc = can_dlc2len(xxxx)
> XXX = can_len2dlc(frame->can_dlc);
>
> provided by net/can/can_core.c
Nice! It seems like using these functions could simplify this code quite
a bit, by eliminating the need for canfd_dlc_array. I can add this as
another patch for the next version.
> I am not sure how much competent I am for the rest of the patches,
> because I do not know XilinX IP core so well. Review by Vikram Garhwal
> or somebody else from AMD/XilinX is more valueable there.
> But I can add my ACK there based on rough overview.
Thanks! I also see that Francisco reviewed a couple of the patches --
thanks Francisco! I will wait and see how review goes on the others.
For what it's worth, I was stress testing this in QEMU today and found
another issue with the FIFO read_index and store_index calculations and
the logic that wraps them around to 0. I will submit the fix for this
problem as another patch in the next version of the series (or a new
series if that's more convenient).
Doug
next prev parent reply other threads:[~2024-08-22 5:45 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-16 16:35 [PATCH 0/5] hw/net/can/xlnx-versal-canfd: Miscellaneous fixes Doug Brown
2024-08-16 16:35 ` [PATCH 1/5] hw/net/can/xlnx-versal-canfd: Fix interrupt level Doug Brown
2024-08-21 7:30 ` Francisco Iglesias
2024-08-16 16:35 ` [PATCH 2/5] hw/net/can/xlnx-versal-canfd: Fix CAN FD flag check Doug Brown
2024-08-21 6:57 ` Pavel Pisa
2024-08-22 0:01 ` Doug Brown [this message]
2024-08-22 1:11 ` Pavel Pisa
2024-08-24 1:54 ` Doug Brown
2024-08-25 16:50 ` Pavel Pisa
2024-08-25 17:30 ` Peter Maydell
2024-08-25 21:21 ` Doug Brown
2024-08-21 7:33 ` Francisco Iglesias
2024-08-16 16:35 ` [PATCH 3/5] hw/net/can/xlnx-versal-canfd: Translate CAN ID registers Doug Brown
2024-08-23 17:08 ` Francisco Iglesias
2024-08-16 16:35 ` [PATCH 4/5] hw/net/can/xlnx-versal-canfd: Fix byte ordering Doug Brown
2024-08-23 17:52 ` Francisco Iglesias
2024-08-16 16:35 ` [PATCH 5/5] hw/net/can/xlnx-versal-canfd: Handle RX of short FD frames Doug Brown
2024-08-23 18:11 ` Francisco Iglesias
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fdce5258-59f7-486c-bfd1-a4befdf72e3e@schmorgal.com \
--to=doug@schmorgal.com \
--cc=francisco.iglesias@amd.com \
--cc=jasowang@redhat.com \
--cc=pisa@fel.cvut.cz \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).