Commit 31d048ca authored by Jacek Kalwas's avatar Jacek Kalwas Committed by Tomasz Zawadzki
Browse files

sock: clarify spdk_sock_recv[_next] on failure behavior



All SPDK in-tree usages check for EAGAIN errno on failure.
This is likely due to SSL implementation which defines set of retryable
errors. Moreover, in case preadv2 (if used in the future) EAGAIN
can be also returned if used with NOWAIT flag.

Change-Id: I3a4631e19a9e3e5d43adae284cbd504b55ed6833
Signed-off-by: default avatarJacek Kalwas <jacek.kalwas@nutanix.com>
Reviewed-on: https://review.spdk.io/c/spdk/spdk/+/25954


Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: default avatarSPDK Automated Test System <spdkbot@gmail.com>
Reviewed-by: default avatarBen Walker <ben@nvidia.com>
Reviewed-by: default avatarJim Harris <jim.harris@nvidia.com>
parent c4a10ad5
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -413,11 +413,13 @@ int spdk_sock_flush(struct spdk_sock *sock);
/**
 * Receive a message from the given socket.
 *
 * On failure check errno matching EAGAIN to determine failure is retryable.
 *
 * \param sock Socket to receive message.
 * \param buf Pointer to a buffer to hold the data.
 * \param len Length of the buffer.
 *
 * \return the length of the received message on success, -1 on failure.
 * \return the length of the received message on success, -1 on failure with errno set.
 */
ssize_t spdk_sock_recv(struct spdk_sock *sock, void *buf, size_t len);

@@ -469,6 +471,8 @@ ssize_t spdk_sock_readv(struct spdk_sock *sock, struct iovec *iov, int iovcnt);
 * This code path will only work if the recvbuf is disabled. To disable
 * the recvbuf, call spdk_sock_set_recvbuf with a size of 0.
 *
 * On failure check errno matching EAGAIN to determine failure is retryable.
 *
 * \param sock Socket to receive from.
 * \param buf Populated with the next portion of the stream
 * \param ctx Returned context pointer from when the buffer was provided.