Page MenuHomeFreeBSD

Extend m_copyback() to support unmapped mbufs.
ClosedPublic

Authored by jhb on May 5 2021, 9:29 PM.

Details

Diff Detail

Repository
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

markj added inline comments.
sys/kern/uipc_mbuf.c
1899

m_unmappeduiomove() or so might be a better name then. Not sure if it's worth the churn.

This revision is now accepted and ready to land.May 6 2021, 1:48 PM
gallatin added inline comments.
sys/kern/uipc_mbuf.c
1899

We also have m_copyfromunmapped(). We could add a m_unmappeduiomove(.. int direction) and make the existing functions wrappers..

sys/kern/uipc_mbuf.c
1899

m_copy{to,from}unmapped() are kind of wrappers already, they just construct different uio's to pass to this routine. In that regard they are similar to the physcopy{in,out} wrappers around uiomove_fromphys(). uiomove_fromphys() suffers similar naming issues (it copies to/from physical pages, not only from physical pages). This routine is also used by m_mbuftouio() which is where it gets is original name from. I don't mind renaming this. It isn't a lot of churn. The one use case outside of this file is in soreceive() where it is paired with uiomove(), so something in the uiomove_* namespace ala uiomove_fromphys() might not be a bad name for it.

sys/kern/uipc_mbuf.c
1899

I don't have strong feelings about it. The m_* namespace makes more sense to me for this routine, so I'm inclined to prefer m_unmapped_uiomove(), but uiomove_mbuf_unmapped() or so would be ok. The name uiomove_fromphys() has always bugged me for exactly the reason you point out.

sys/kern/uipc_mbuf.c
1899

I'll add a followup commit after this one that renames it to m_unmapped_uiomove().