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

dp_flow flags rename #435

Merged
merged 3 commits into from
Nov 22, 2023
Merged

dp_flow flags rename #435

merged 3 commits into from
Nov 22, 2023

Conversation

PlagueCZ
Copy link
Contributor

I noticed there are a few bitfield-type variables in dp_flow (which makes sense as this is actually stored in the packet space), but these are called flags even though they are not flags, but enums.

So I moved them out of the structure (made sure the bitfield still works) and put the right types to them. I also moved nxt_hop to a better-aligned place.

This also lead to some connected refactorings (mentioned in notes below)

@github-actions github-actions bot added enhancement New feature or request size/XL labels Nov 20, 2023

uint8_t aged : 2;

bool aged;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed the bit sizes because those usually make the code slower (unaligned access, masking, ...).

Now if this structure needs to be small (I did not find a reason for it to be), then I will put the sizes back, though the structure needs some changes to make them effective (for example merge pf0, pf1 and aged to a byte, etc.

@PlagueCZ PlagueCZ changed the base branch from main to feature/design_doc November 21, 2023 12:13
@PlagueCZ PlagueCZ changed the base branch from feature/design_doc to main November 21, 2023 12:13
@github-actions github-actions bot added size/L and removed size/XL labels Nov 21, 2023
include/dp_mbuf_dyn.h Outdated Show resolved Hide resolved
@PlagueCZ PlagueCZ marked this pull request as ready for review November 22, 2023 10:32
Copy link
Collaborator

@guvenc guvenc left a comment

Choose a reason for hiding this comment

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

Thanks. The flags are definitely more readable now.

@guvenc guvenc merged commit edafa09 into main Nov 22, 2023
7 checks passed
@guvenc guvenc deleted the feature/dp_flow_flags_rename branch November 22, 2023 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants