anchao opened a new pull request, #21031: URL: https://github.com/apache/nuttx/pull/21031
## Summary
Optimize UDP read-ahead metadata handling by packing the fixed metadata
fields
into a small local header before copying them into the I/O buffer chain.
Previously, UDP read-ahead queueing copied each metadata field separately:
- datagram length
- optional interface index
- source address size
This change introduces a shared `UDP_READAHEAD_META_SIZE` layout definition
and
uses a local metadata buffer when queueing and reading buffered UDP packets.
The source address and packet payload layout remain unchanged.
This reduces the number of IOB copy operations needed when buffering and
later
reading UDP datagrams, while preserving the existing read-ahead layout and
UDP
datagram semantics.
## Impact
No user-visible behavior change is expected.
The change is internal to UDP read-ahead buffering and keeps compatibility
with
the existing metadata layout:
```text
|datalen|ifindex|src_addr_size|src_addr|[timestamp]|data|
Expected impact:
• fewer IOB copy operations for buffered UDP receive paths
• no protocol behavior change
• no socket API behavior change
• no build-system, documentation, or security impact
## Testing
sim/usbdev
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
