mm/iob: add iob_init method to support external buffer init as iob structure
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.
@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.
@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).
@acassis Done.
@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).
@acassis could you review again?
please add a commit message and sign the change
@jerpelea The current commit message is as follows, do I need to make any changes?
mm/iob: add iob_init method to support external buffer init as iob structure
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]>
@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).
Done.
@acassis please review again.