Page MenuHomeFreeBSD

unix/dgram: add a specific receive method - uipc_soreceive_dgram
ClosedPublic

Authored by glebius on May 23 2022, 9:01 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 28 2024, 10:53 PM
Unknown Object (File)
Jan 28 2024, 10:53 PM
Unknown Object (File)
Jan 28 2024, 10:53 PM
Unknown Object (File)
Jan 28 2024, 10:53 PM
Unknown Object (File)
Jan 28 2024, 10:49 PM
Unknown Object (File)
Jan 28 2024, 9:54 PM
Unknown Object (File)
Jan 14 2024, 9:57 AM
Unknown Object (File)
Dec 20 2023, 5:30 AM
Subscribers

Details

Summary

With this second step PF_UNIX/SOCK_DGRAM has protocol specific
implementation. This gives some possibility performance
optimizations. However, it still operates on the same struct
socket as all other sockets do.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Note: this patch is a step towards D35303.

sys/kern/uipc_usrreq.c
1290

Doesn't this copy internalized control messages?

1336
1445

Looks like this error is lost?

glebius added inline comments.
sys/kern/uipc_usrreq.c
1290

Yes, and this is the intent. Before we did the same in soreceive_generic() uipc_socket.c:2159

1445

Good catch! In the soreceive_generic() we catch the error much later and my code doesn't have it. I'm looking in making unp_externalize() to never fail, at least for SOCK_DGRAM.

glebius marked 2 inline comments as done.

Simplify and improve handling of unp_externalize().

markj added inline comments.
sys/kern/uipc_usrreq.c
1434
1435

Related, unp_scan() will visit m->m_nextpkt, since it was intended to operate on the entire socket buffer. I can't find any problems caused by that, but it seems rather subtle. Might be worth asserting m->m_nextpkt == NULL before calling unp_scan() below and elsewhere in your patch set. Or improve the KPI to remove such footguns.

This revision is now accepted and ready to land.May 25 2022, 7:49 PM
This revision now requires review to proceed.May 31 2022, 3:51 AM
This revision is now accepted and ready to land.Jun 6 2022, 1:30 PM