Skip to content
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

Bug in InitDpdk: First arg in rte_args ignored #41

Open
ssaroiu opened this issue Aug 19, 2024 · 2 comments
Open

Bug in InitDpdk: First arg in rte_args ignored #41

ssaroiu opened this issue Aug 19, 2024 · 2 comments

Comments

@ssaroiu
Copy link
Member

ssaroiu commented Aug 19, 2024

Dpdk::InitDpdk calls rte_eal_init with rte_args, which are command-line options without the program name (basename). A typical rte_args might look like --log-level=eal,8 --proc-type=auto or -c 0x0 -n 6.

However, rte_eal_init expects the traditional argc, argv format, including the program name. In its implementation, rte_eal_init ignores argv[0] and processes arguments starting from argv[1].

As a result, the first parameter in rte_args is ignored by DPDK.

I tested a simple fix by adding a dummy first argument, but this feels like a hack. I can submit a PR with this fix if you'd like. Let me know.

Example of fix in my code

image

@anujkaliaiitd
Copy link
Collaborator

Hi Stefan. This fix looks good to me, thanks! Please feel free to push directly. This probably explains the trouble I had with enabling DPDK debug logs in Machnet. It might be useful to keep the original eal,8 log filter, but it's fine to change it to 1 if you're finding that better.

@ssaroiu
Copy link
Member Author

ssaroiu commented Aug 20, 2024

Thanks Anuj.

I issued PR #42 with this fix. I feel more comfortable if you do a reviewing pass before merging into main.

Note that I also changed the core mask for some of the tests from "0x0" to "0x1". A core mask of "0x0" makes no sense and DPDK would complain:
EAL: No lcores in coremask: [0x0]
EAL: invalid coremask syntax

Changing the mask to 0x1 fixed the issue.

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

No branches or pull requests

2 participants