Data allocated by m_uiotombuf() usually goes into a socket buffer.
We are interested in the length of useful data to be added to sb_ccc,
as well as total memory used by mbufs. The later would be added to
sb_mbcnt. Calculating this value at allocation time allows to save
on extra traversal of the mbuf chain.
Details
Details
- Reviewers
markj - Group Reviewers
network transport - Commits
- rG9b841b0e2390: m_uiotombuf: write total memory length of the allocated chain in pkthdr
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sys/sys/mbuf.h | ||
---|---|---|
219 | How is a consumer supposed to know whether memlen is populated or not? It sounds very general but it's only set by m_uiotombuf(). How do we know that setting memlen won't clobber a field in PH_loc? I'm not very familiar with PH_loc's usage so it's not clear to me. |
sys/sys/mbuf.h | ||
---|---|---|
219 | At this moment m_uiotombuf() supports it, but other chain allocation functions can and should support it future. The PH_loc belongs to a subsystem that is sure it owns the mbuf. For a freshly allocated mbuf this works perfect. |