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

question: about CONFIG_NET_BUF_POOL_USAGE #29574

Closed
ehudmarvell opened this issue Oct 27, 2020 · 3 comments
Closed

question: about CONFIG_NET_BUF_POOL_USAGE #29574

ehudmarvell opened this issue Oct 27, 2020 · 3 comments

Comments

@ehudmarvell
Copy link
Contributor

Hi,

I am using CONFIG_NET_BUF_POOL_USAGE and saw that increasing and decreasing "avail_count" is done without atomic variable and without any locks.

for example:

#if defined(CONFIG_NET_BUF_POOL_USAGE)
	pool->avail_count--;
	__ASSERT_NO_MSG(pool->avail_count >= 0);
#endif

Can you explain how can I be sure that avail_count is valid, is there any protections on it that I miss?

Thanks,
Ehud

@jukkar
Copy link
Member

jukkar commented Oct 27, 2020

The avail_count is currently used as a statistics variable to show some information in net-shell. This could be converted to be atomic_t if needed. Patches are welcome if you want to improve the code.

@ehudmarvell
Copy link
Contributor Author

Thank you

@ehudmarvell ehudmarvell reopened this Oct 27, 2020
@ehudmarvell
Copy link
Contributor Author

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