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
F102425426: D35296.diff
Tue, Nov 12, 2:41 AM
Unknown Object (File)
Fri, Oct 25, 6:57 AM
Unknown Object (File)
Sat, Oct 19, 11:44 PM
Unknown Object (File)
Sep 24 2024, 5:38 PM
Unknown Object (File)
Sep 24 2024, 12:26 AM
Unknown Object (File)
Sep 19 2024, 9:23 PM
Unknown Object (File)
Sep 17 2024, 10:27 AM
Unknown Object (File)
Sep 16 2024, 4:31 PM
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