-
Notifications
You must be signed in to change notification settings - Fork 11
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
pktmem: Fix warning #84
base: master
Are you sure you want to change the base?
Conversation
JIRA: RTOS-555
5d1b27d
to
e085733
Compare
#define PKT_BUF_IDX 11 // log2(PAGE_SIZE) - ceil(log2(PKT_BUF_CNT)) | ||
#define PKT_BUF_SIZE (2048 - CACHE_LINE_SIZE) | ||
#define PKT_BUF_CNT (size_t)((_PAGE_SIZE - CACHE_LINE_SIZE) / PKT_BUF_SIZE) | ||
#define PKT_BUF_IDX 11 /* log2(_PAGE_SIZE) - ceil(log2(PKT_BUF_CNT)) */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't know what is _PAGE_SIZE as its in the arch.h
so making this value a constant is misleading . IMHO either this comment should change or LOG2 macro that does LOG2 in proprocessing stage should be added(probably overkill)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't know it's value and use definit oo on from arch.h, because it's target dependent. We need a value provided by arch for mmap/munap to work properly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, but the the reason for it being exactly 11 is that we assumed page_size == 4096 at least acoording to the comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, now I understand what you mean
JIRA: RTOS-555
Description
Fixes phoenix-rtos/phoenix-rtos-project#141
Motivation and Context
Types of changes
How Has This Been Tested?
Checklist:
Special treatment