-
Notifications
You must be signed in to change notification settings - Fork 1.4k
mm/iob: add iob_init method to support external buffer init as iob structure #17439
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
base: master
Are you sure you want to change the base?
Conversation
acassis
left a 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.
@zhhyu7 I think it requires to update the Documentation https://nuttx.apache.org/docs/latest/components/mm/index.html#i-o-buffers to include this new IOB initialization. Otherwise it will be Another Hidden Feature of NuttX (AHFN).
OK, I will update the Documentation. |
…ructure This interface allows different protocol modules to use their own unique IOB buffer sources and allocation strategies without interfering with each other. Representative examples are the IP protocol and the CAN protocol. The IP protocol generally transmits packets of varying lengths and requires relatively high peak throughput. In this case, to ensure higher performance, IOB_BUFSIZE is often configured to be relatively large, such as greater than 500. The CAN protocol generally transmits short packets of fixed length. In this case, to improve memory utilization, IOB_BUFSIZE is often configured to be relatively small, such as 16 or 64. To optimize the memory utilization when the IP protocol and the CAN protocol share the same core, this interface was added. Signed-off-by: zhanghongyu <[email protected]>
Done. |
@acassis could you review again? |
Summary
This interface allows different protocol modules to use their own unique IOB buffer sources and allocation strategies without interfering with each other. Representative examples are the IP protocol and the CAN protocol. The IP protocol generally transmits packets of varying lengths and requires relatively high peak throughput. In this case, to ensure higher performance, IOB_BUFSIZE is often configured to be relatively large, such as greater than
500. The CAN protocol generally transmits short packets of fixed length. In this case, to improve memory utilization, IOB_BUFSIZE is often configured to be relatively small, such as 16 or 64. To optimize the memory utilization when the IP protocol and the CAN protocol share the same core, this interface was added.
Impact
Added an IOB allocation interface, The IOB allocated by this interface can flow and be release between the protocol stack and the network card driver just like a regular IOB.
Testing
sim:matter
Added test code in arch/sim/src/sim/sim_netdriver.c to use a fixed buffer list as IOB to test this interface, and both ping and iperf can communicate normally.