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)
Fri, Apr 5, 10:42 AM
Unknown Object (File)
Fri, Apr 5, 10:42 AM
Unknown Object (File)
Fri, Apr 5, 10:42 AM
Unknown Object (File)
Fri, Apr 5, 10:42 AM
Unknown Object (File)
Fri, Apr 5, 10:42 AM
Unknown Object (File)
Fri, Apr 5, 10:18 AM
Unknown Object (File)
Jan 28 2024, 10:53 PM
Unknown Object (File)
Jan 28 2024, 10:53 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
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 45779
Build 42667: arc lint + arc unit

Event Timeline

Note: this patch is a step towards D35303.

sys/kern/uipc_usrreq.c
1286

Doesn't this copy internalized control messages?

1332
1441

Looks like this error is lost?

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

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

1441

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
1430
1431

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