ng_pktbuf: new default packet buffer implementation#3496
ng_pktbuf: new default packet buffer implementation#3496miri64 merged 4 commits intoRIOT-OS:masterfrom
Conversation
e655e98 to
a442bd4
Compare
There was a problem hiding this comment.
is it really necessary to add a->size here? I assumed that the address of b is already at least a->size bytes next to a
There was a problem hiding this comment.
Yes. It's not about the size between pointer a and pointer b (which would just be the size of chunk a plaus anything in-between), but the size of the space between the chunks represented by a and b. To put this graphically:
(((uint8_t *)b) - ((uint8_t *)a)):
|------------|
+---------+ +---------+
+---------+ +---------+
a b
vs.
(size_t)(((uint8_t *)b) - (((uint8_t *)a) + a->size));
|--|
+---------+ +---------+
+---------+ +---------+
a b
This is correcting for the fact, that I size-up the chunk to the next word-aligned pointer and the next size that would fit an _unused_t struct in _pktbuf_alloc()
|
Tested successfully with 6LoWPAN in the iot-lab testbed in the following configurations:
You need the following PRs for it (or just use the commit abeb852 in my repository):
|
1481534 to
74c8cf8
Compare
|
Just had to think about it: I think it would make sense to rename this new implementation to |
|
Fine by me. |
|
Renamed and made unittests only available for |
Makefile.dep
Outdated
There was a problem hiding this comment.
I think we can make this more general: ifeq(,$(filter ng_pktbuf_%, $(USEMODULE)))?!
There was a problem hiding this comment.
For me that was a nice function...
There was a problem hiding this comment.
ng_pktbuf_init() does the same but is now mandatory on first start ;-)
There was a problem hiding this comment.
Ahh, cool! You think it's reasonable to spend a small comment there?
There was a problem hiding this comment.
Tell me what to write apart from "initializes the packet buffer" and I'll do it :>
|
For the protocol: I'm running a test-application on the iot-lab_M3 node which sends 1000 UDP packets for payloads from 10:1:330 bytes/packet without a pause. No faults and the result looks valid. |
|
And again, to finish my protocol: I'm running a test-application on the iot-lab_M3 node which "virtually" receives 1000 UDP packets for payloads from 10:1:330 bytes/packet without a pause. No faults and the result looks valid. Of course, IPHC and fragmentation are enabled. Note: That was not possible with the old implementation. Häppi to see that :-) |
04d7154 to
d85a7bf
Compare
|
and green lights, btw |
|
Cenk found some last minute erroros |
|
Hups, what did I see? There were no green lights, sry... |
|
No I just pushed something |
b32067e to
cbc97a4
Compare
|
Added some last minute optimizations. :-) |
2ae9b11 to
1d3abfa
Compare
There was a problem hiding this comment.
This assert only checks if at least one condition is met, but should check that all of them are met.
There was a problem hiding this comment.
Who coded this stuff? Certainly not me :D
3f4b39a to
9578ab9
Compare
|
ACK |
This simplifies the `ng_pktbuf` API by adding a new function `ng_pktbuf_mark()` which takes over some functionality of `ng_pktbuf_add()`. `size == 0` for `ng_pktbuf_add()` is now illegal.
9578ab9 to
377f5cc
Compare
|
Some unittests were still failing… now everything should be alright (hopefully) |
|
Unittests succeeded \o/ |
ng_pktbuf: new default packet buffer implementation
Implements the API proposed in #3458. It also simplifies a lot in the packet buffer. It still isn't perfect (there is happening way to much copying for my taste), but I think it's a first step in a better direction.