Skip to content

Fix pciedriver and portalmem to support newest kernel versions#198

Open
tchomphoochan wants to merge 6 commits intocambridgehackers:masterfrom
tchomphoochan:kernel-updates
Open

Fix pciedriver and portalmem to support newest kernel versions#198
tchomphoochan wants to merge 6 commits intocambridgehackers:masterfrom
tchomphoochan:kernel-updates

Conversation

@tchomphoochan
Copy link
Copy Markdown

@tchomphoochan tchomphoochan commented Mar 2, 2025

RHEL7 has hit EOL, so do Amazon's old version of FPGA Developer AMI and F1 instances.

The new AMI (intended for F2 instances) runs on Ubuntu 20.04. I made the changes necessary for Connectal to compile successfully on Ubuntu 20.04. I also made sure that it compiles on Ubuntu 24.04 as well, since that's one of the most recent systems I expect most people will want to use.

If there are people with access to older machines who could try to compile (i.e. sudo make install) and report any additional fixes needed, say, for Ubuntu 16.04, that would be appreciated.

Unfortunately, I haven't quite figured out how to actually support synthesis for F2 instances yet.

Copy link
Copy Markdown

@jameyhicks-cmt jameyhicks-cmt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for submitting this PR. I have a few comments.

Comment thread boardinfo/awsf1.json
"MemTagSize=16", "MemServerTags=8",
"DEFAULT_NOPROGRAM=1",
"CONNECTAL_BITS_DEPENDENCES=build/checkpoints/to_aws/mkTop.SH_CL_routed.dcp", "CONNECTAL_RUN_SCRIPT=$(CONNECTALDIR)/scripts/run.aws"],
"CONNECTAL_BITS_DEPENDENCES=build/checkpoints/to_aws/mkTop.SH_CL_routed.dcp", "CONNECTAL_RUN_SCRIPT=$(CONNECTALDIR)/scripts/aws/run.awsf1"],
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this was ever really debugged, but it's good to fix the typo

Comment thread cpp/poller.cpp Outdated
for (int i = 0; i < numWrappers; i++) {
if (!portal_wrappers)
fprintf(stderr, "Poller: No portal_instances revents=%d\n", portal_fds[i].revents);
// if (!portal_wrappers)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want to comment out this code

Copy link
Copy Markdown
Author

@tchomphoochan tchomphoochan Mar 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Not sure why it was commented.

Comment thread drivers/pcieportal/pcieportal.c Outdated
#include <linux/poll.h> /* poll_table, etc. */
#include <asm/uaccess.h> /* copy_to_user, copy_from_user */
#include <linux/dma-buf.h>
// #include <linux/dma-mapping.h>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have these files gone away? If so we need an appropriate ifdef around these lines

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I'm not sure yet. I was integrating parts of the changes implemented by @ljz-1109 and must have missed that.

I can look into this and introduce necessary #ifdefs.

Copy link
Copy Markdown
Author

@tchomphoochan tchomphoochan Mar 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Not sure why it was commented. Those files still remain to these days.

Those files are needed for the recent kernel API for setting up DMA. While they seem to be transitively included through other files (hence commenting out works), it's probably best to make those includes explicit.

Comment thread pcie/pcieflat Outdated
@@ -441,7 +441,7 @@ if __name__ == '__main__':
buf = fcntl.ioctl(fd, BNOC_GET_TLP, ' ' * Tlp_len)
foo = ''
for x in buf:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow, I'm sorry this code is so ugly. Seems like it should be buf.hex() or reverse(buf).hex() or something like that but if your changes work I am OK with them.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto previous comment. I'm having trouble understanding how this code works so I'm just taking the working change for granted now.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants