-
Notifications
You must be signed in to change notification settings - Fork 2k
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
netreg: Initial import #2404
netreg: Initial import #2404
Conversation
* E. g. protocol numbers / next header numbers in IPv4/IPv6, | ||
* ports in UDP/TCP, or similar. | ||
*/ | ||
uint32_t demux_ctx; |
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 put this in netapi and netdev to uint16_t
...
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.
Question is: is this enough?
I am not quite convinced of this implementation, I think the lookup is still too expensive! (Compare to #2310) |
What*s the relation to #2310? |
ng_netreg_entry_t *start = entry; | ||
|
||
do { | ||
if (entry->proto_pid == proto_pid && entry->demux_ctx == demux_ctx) { |
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.
parens
@haukepetersen I was thinking about doing a lookup on a two-dimensional array (1 axis: type, other axis |
@haukepetersen I just looked at your implementation again: How does your implementation caters to demultiplexing contexts? |
Utilizes utlist instead of clist now |
it doesn't. The context stuff was introduced after I did the PR... |
It was not (it was already in the introductory PR of netapi), but this is not the point: With the demultiplexing context we either have to decide for a slower, but more memory efficient list implementation or a more memory-wasting, but faster, hash table implementation. A simple array-lookup is just not possible. |
A tree-based data structure would also be possible, but would need at least one extra pointer + the ROM size would be increasing since it would have a more complex code. |
9c216e1
to
9602e72
Compare
Changed semantic, added tests and fixes following from them |
Concerning the underlying data-structure: I think we could just provide more then one implementation in the future, one optimized for run-time and one for memory... Otherwise this PR looks good to me: ACK |
e3c092a
to
3e3885c
Compare
* E. g. protocol numbers / next header numbers in IPv4/IPv6, | ||
* ports in UDP/TCP, or similar. | ||
*/ | ||
uint16_t demux_ctx; |
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.
If I understood it correctly, the demultiplexing context here works similar to the one from the netapi– why does the demultiplexing context in netapi gets its own typedef'ed type (netapi_reg_demux_ctx_t
) and here it's a uint16_t
?
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.
This type does not exist in the most current version of netapi, since we moved all of the registration to this module. netapi_reg_demux_ctx_t
is quite a mouthful compared to a simple uint16_t
, so I left it out ;)
(I've had a bit of a hard time understanding |
Addressed comments and moved from (only available during testing) reset- to init-based setting of the values, just in case someone decides KERNEL_PID_UNDEF can't be 0 anymore ;-) |
👍 I'll run the tests on a SAMR21 after lunch and if that goes through and Travis is happy, I'd ACK, too. |
please squash. |
I'll wait till #2440 is merged. |
sorry, overlooked that dependency... |
now now now :-) |
599e61f
to
cd711ea
Compare
Rebased and squashed. @Lotterleben asked if she can merge ;-) |
let's just give Travis another chance to complain... @Lotterleben merge at will when Travis is happy! |
Travis is happy, the tests on the SAMR21are happy... Imma merge this now ✨ |
yeah! |
Depends on
#2397(merged)#2440(merged). Tests will follow when review is somewhat positive ;-)