Confluence will be unusable 23-July-2024 at 06:00 due to a Crowd upgrade.
Files:
Classes:
IBuf class methods implemented in CBufImpl:
IBuf virtual methods implemented in CBufImpl:
...
typedef queue< IBufChain *, boost::lockfree::fixed_sized< true > > CBufQueueBase;)
CEventBufSync
CBufImpl private variables:
...
IBufChain class methods implemented in CBufChainImpl:
...
...
IBufChain virtual methods implemented in CBufChainImpl:
...
...
CBufChainImpl private variables:
...
IBufQueue class methods:
IBufQueue virtual methods:
CBufQueue private attributes
Till,
I am going through the CPSW code and have some questions and comments, starting with the CPSW buffer implementation. BTW I like the approach to the buffer chains which minimizes the number of copies to the copy from the UDP receive and the copy to user space.
1. It appears you base the buffer size constants and container variables around the assumption that we will limit each buffer element size to 64K. I am not sure if that is a safe assumption once we add support for interfaces that are not TCP/IP or UDP. With PGP or axi-stream we can have much larger buffers. Also you seem to hardcode some ethernet based constants in the .h file and I am not sure that is the best place for a generic implementation. (more notes on size later)
2. In adjPayload you have this line:
if ( delta > beg || delta > old_size )
return false;
Why do you care if the shift size is greater than the beginning payload offset? Should this be an unsigned compare to check for left shifts beyond the beginning of the buffer?
...
Lastly a code convention question. Is it standard practice to declare classes, even internal ones, within the .cc files? It is hard to use tools such as doxygen with this approach. It is also hard to follow the code structure.
9. Additional notes on question. It seems that a public free list
allocator would also make sense to set the headroom size for each buffer
at creation. Different implementations will need different headroom
depending on protocol. Of course one could just allocated a large enough
space for all possibilities, but it is hard to anticipate that and some
headroom needs may be excessive compared to the norm.
10. Perhaps the IBufChain::insert functions should include a passed
value which determines the amount of space to copy to each buffer. It
seems now that the max possible size is used for each buffer.