luojun1234 opened a new pull request, #6834: URL: https://github.com/apache/incubator-nuttx/pull/6834
Signed-off-by: luojun1 <luoj...@xiaomi.com> ## Summary modify iob to support buffer aligment and head padding features ## Impact 1.if config CONFIG_IOB_ALIGNMENT to 1 and CONFIG_IOB_HEADSIZE to 0, the iob_s initialization and memory usage are the same as before,no extra bytes are wasted. 2.In order to improve the performance on some platforms, the zero-copy mechanism can be used in the data transmission path, and the IP packets sent by TCPIP stack are directly sent to the HW for transmission, in this case, one feature is that cache line alignment may be required at the beginning of the buffer, at the same time we may need to provide a memory space for the HW controller (so that the HW controller can fill some data, such as the sending and receiving of USB RNDIS packets, the USB HW needs to put a 42-byte header before the original Ethernet frame), so we designed the io_head field in iob_s structure, and followed the principle of using io_data as the data buffer, we can configure the io_head field to align to the specified memory boundary. In addition, if the io_head length is also configured as an integer multiple of the cache line, then io_data can also be aligned to the cache line. ## Testing On the emulator, configure arbitrary io_head size and alignment size, wget works fine, configure the io_head size to 0 and the alignment size to 1, no extra bytes are wasted. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org