-
Notifications
You must be signed in to change notification settings - Fork 405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposed fix for issue 48. #49
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,7 +66,7 @@ | |
#define XDMA_OFS_CONFIG (0x3000UL) | ||
|
||
/* maximum number of desc per transfer request */ | ||
#define XDMA_TRANSFER_MAX_DESC (2048) | ||
#define XDMA_TRANSFER_MAX_DESC (512) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. was this a necessary change for the default configuration? can you comment on why this is necessary? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thinks this change isn't nessary. It didn't solve my problem (see #54). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The documentation from Xilinx (https://www.xilinx.com/support/documentation/ip_documentation/xdma/v4_1/pg195-pcie-dma.pdf) notes that Gen3x16 has a descriptor FIFO depth of 1024 and Gen3x8 (which is what we're using) is 512. I'm having trouble interpretting the language on pages 24 and 25, but it sounds like the engine might be smart about not overflowing this FIFO. What's certain is that the engine can't possibly fetch more than the FIFO allows at once, so I believe the value I've shown is safest for all hardware. I would be genuinely curious if anyone has benchmarked the performance at different values for this constant. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a message of a race condition here: ref to Maybe your review and dev knowledge may get some ideas... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would open a new issue for that. It doesn't seem related to this. You need details like which commit hash you're using and the sample program that caused the error. For what it's worth, it seems odd to me that the engine apparently times out after only one descriptor completed (see completed_desc_count). Also, FYI, error 512 is ERESTARTSYS and is explicitly returned by xdma_xfer_submit on timeout. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Hello, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i tried the changes by bhathaway. I also experimented with various numbers down to XDMA_TRANSFER_MAX_DESC (16). Job works for a few minutes and hangs eventually. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Quite an old topic but without benchmarking, I can tell that testing using a loopback channel (3x16), I see the following:
I cannot say for sure that the IP works the way I think it does but I'm just putting these here for others to possibly test/confirm or just to help them. |
||
|
||
/* maximum size of a single DMA transfer descriptor */ | ||
#define XDMA_DESC_BLEN_BITS 28 | ||
|
@@ -161,6 +161,11 @@ | |
#define XDMA_ID_H2C 0x1fc0U | ||
#define XDMA_ID_C2H 0x1fc1U | ||
|
||
/* x86 assumptions needed for other architectures */ | ||
#define PAGE_SIZE_X86 0x1000 | ||
#define PAGE_SHIFT_X86 12 | ||
#define PAGE_MASK_X86 0xfff | ||
|
||
/* for C2H AXI-ST mode */ | ||
#define CYCLIC_RX_PAGES_MAX 256 | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This macro is hardcore. I guess you all have moved on to aarch ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm trying to make sure that the driver works on x86 and aarch architectures, which is why I made this change. The adjacency accesses make x86 page size assumptions, which is why I propose adding these macros instead of just using "PAGE_SIZE" and "PAGE_MASK", which are standard. Either way it's much better than the magic numbers within the current code.