commit 3218d973b68bc6d9f88d9e2374f3ada3df5ee7ff Author: Frederik Deweerdt Date: Tue May 31 18:23:54 2022 -0700 [doc] msg_zerocopy.rst: clarify the TCP shutdown scenario Explicitly mention that applications shouldn't be calling `close(2)` on a TCP socket without draining the error queue. diff --git a/Documentation/networking/msg_zerocopy.rst b/Documentation/networking/msg_zerocopy.rst index 15920db8d35d..9373631d0a82 100644 --- a/Documentation/networking/msg_zerocopy.rst +++ b/Documentation/networking/msg_zerocopy.rst @@ -144,6 +144,11 @@ the socket. A socket that has an error queued would normally block other operations until the error is read. Zerocopy notifications have a zero error code, however, to not block send and recv calls. +For protocols like TCP, transmissions can occur after the application +has called close(2). In cases where it's undesirable to delay calling +close(2) until all notifications have been processed, the application +can use shutdown(2), and keep polling the error queue until all +transmissions have completed. Notification Batching ~~~~~~~~~~~~~~~~~~~~~