lib/sock: do not fail spdk_sock_flush() on ENOBUFS
When net.core.optmem_max is not set high enough, a call to sendmsg() might fail with ENOBUFS. Currently this is treated as an error. When we have no more buffer space left, we should continue to process any completions and by doing so, free up the auxiliary buffers we ran out of. With this change I was able to run perf against the spdk target with a purposely set to a low, value of optmem_max, where previously it would fail. This fixes github issue #1592 Signed-off-by: Jeffry Molanus <jeffry.molanus@gmail.com> Change-Id: Ieeeed4fbecd827d0da815456b57fbe81495fe54d Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4129 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
parent
e4ff3a5bf1
commit
c66275c075
@ -801,7 +801,7 @@ _sock_flush(struct spdk_sock *sock)
|
||||
}
|
||||
rc = sendmsg(psock->fd, &msg, flags);
|
||||
if (rc <= 0) {
|
||||
if (errno == EAGAIN || errno == EWOULDBLOCK) {
|
||||
if (errno == EAGAIN || errno == EWOULDBLOCK || (errno == ENOBUFS && psock->zcopy)) {
|
||||
return 0;
|
||||
}
|
||||
return rc;
|
||||
|
Loading…
Reference in New Issue
Block a user