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

Update NET_BUF_POOL_FIXED_DEFINE: added the alignment for net_buf_data #48713

Conversation

npal-cy
Copy link
Contributor

@npal-cy npal-cy commented Aug 4, 2022

include/net: add the alignment for data in NET_BUF_POOL_FIXED_DEFINE
NET_BUF_POOL_FIXED_DEFINE locates net_buf_data in __noinit section,
it does not guarantees that data buffer will aligned.

There is wifi driver which required network buffers to be aligned.

Changes:
line below (from NET_BUF_POOL_FIXED_DEFINE macro):
static uint8_t __noinit net_buf_data_##_name[_count][_data_size];
is updated to:
static uint8_t __noinit net_buf_data_##_name[_count][_data_size] __net_buf_align;

Signed-off-by: Nazar Palamar nazar.palamar@infineon.com

Some background for this update in discord: https://discord.com/channels/720317445772017664/733037635194585148/1004652532716552273

jhedberg
jhedberg previously approved these changes Aug 5, 2022
Copy link
Contributor

@rlubos rlubos left a comment

Choose a reason for hiding this comment

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

@npal-cy The signoff entry seems to have the wrong format, the email address should be surrounded by square brackets (<>) - it causes compliance failure.

NET_BUF_POOL_FIXED_DEFINE locates net_buf_data in __noinit section,
it does not guarantees that data buffer will aligned.

There is wifi driver which required network buffers to be aligned.

Changes:
line below (from NET_BUF_POOL_FIXED_DEFINE macro):
 static uint8_t __noinit net_buf_data_##_name[_count][_data_size];
is updated to:
 static uint8_t __noinit net_buf_data_##_name[_count][_data_size]
 __net_buf_align;

Signed-off-by: Nazar Palamar <nazar.palamar@infineon.com>
@npal-cy
Copy link
Contributor Author

npal-cy commented Aug 5, 2022

@npal-cy The signoff entry seems to have the wrong format, the email address should be surrounded by square brackets (<>) - it causes compliance failure.

Thanks! fixed.

@fabiobaltieri fabiobaltieri merged commit 5897de1 into zephyrproject-rtos:main Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants