posix: update sendmsg_idx only if zerocopy is enabled
Sendmsg_idx is used in _sock_check_zcopy to check whether idx in MSG_ERRQUEUE and req's idx match. There is no need to update it if zerocopy is disabled. Change-Id: I24bb367e0bff006782d9052470857f6e4db90681 Signed-off-by: Richael Zhuang <richael.zhuang@arm.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12104 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Community-CI: Mellanox Build Bot Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
parent
5fd1f68b63
commit
449cab9569
@ -744,6 +744,7 @@ _sock_flush(struct spdk_sock *sock)
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (psock->zcopy) {
|
||||||
/* Handling overflow case, because we use psock->sendmsg_idx - 1 for the
|
/* Handling overflow case, because we use psock->sendmsg_idx - 1 for the
|
||||||
* req->internal.offset, so sendmsg_idx should not be zero */
|
* req->internal.offset, so sendmsg_idx should not be zero */
|
||||||
if (spdk_unlikely(psock->sendmsg_idx == UINT32_MAX)) {
|
if (spdk_unlikely(psock->sendmsg_idx == UINT32_MAX)) {
|
||||||
@ -751,6 +752,7 @@ _sock_flush(struct spdk_sock *sock)
|
|||||||
} else {
|
} else {
|
||||||
psock->sendmsg_idx++;
|
psock->sendmsg_idx++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Consume the requests that were actually written */
|
/* Consume the requests that were actually written */
|
||||||
req = TAILQ_FIRST(&sock->queued_reqs);
|
req = TAILQ_FIRST(&sock->queued_reqs);
|
||||||
|
Loading…
Reference in New Issue
Block a user