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

[catnip] Missing Check for Return Value of rte_eal_init() #327

Merged
merged 1 commit into from
Nov 17, 2022

Conversation

ppenna
Copy link
Contributor

@ppenna ppenna commented Nov 11, 2022

Description

This PR fixes #326.

Summary of Changes

  • Added a check for the return value of rte_eal_init()

@ppenna ppenna added the bug Something Isn't Working label Nov 11, 2022
@ppenna ppenna self-assigned this Nov 11, 2022
rte_eal_init(eal_init_refs.len() as i32, eal_init_refs.as_ptr() as *mut _);
let ret: libc::c_int = unsafe { rte_eal_init(eal_init_refs.len() as i32, eal_init_refs.as_ptr() as *mut _) };
if ret < 0 {
bail!("EAL initialization failed {:?}", ret);
Copy link
Contributor

@BrianZill BrianZill Nov 13, 2022

Choose a reason for hiding this comment

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

Is there any way we can get access to rte_errno here? And print that instead of the return value? rte_eal_init() is documented as returning -1 on error, and "rte_errno is set to a value indicating the cause for failure".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for noting this. I've updated the fix for getting and printing the value of rte_errno.

Copy link
Contributor

Choose a reason for hiding this comment

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

Awesome! Thanks.

Copy link
Contributor

@BrianZill BrianZill left a comment

Choose a reason for hiding this comment

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

Looks good now, thanks!

@ppenna ppenna merged commit 7139fa8 into dev Nov 17, 2022
@ppenna ppenna deleted the bugfix-catnip-init branch November 17, 2022 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something Isn't Working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants