lib/nvmf: set low water mark in NVMe/TCP target to 1 byte
In NVMe/TCP target, the socket low water mark is set to sizeof(struct spdk_nvme_tcp_common_pdu_hdr), which is 8 bytes. In corner test, there might be 4 bytes data packet sent to NVMe/TCP target, after that, if there is no more data sent to the same socket, the 4 bytes won't be read by NVMe/TCP target qpair thread. Because of this, there is a IO request didn't complete in initiator. Then, if manual call the readv function to read the 4 bytes for the pdu in target, the io request complete normally in initiator. It seems like the pdu might be split, and in the situation, the IO request will not complete until new IO request reach. After set low water mark in NVMe/TCP target to 1 byte, just like iscsi target done, the issue disappear immediately. Signed-off-by: BinYang0 <bin.yang@jaguarmicro.com> Change-Id: I59d3d900f0b25632d786ef25ab096eabe43476bd Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13633 Reviewed-by: <chuanwei.ji@jaguarmicro.com> Reviewed-by: Qingmin Liu <qingmin.liu@jaguarmicro.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com> Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
57f867162e
commit
20cd4841f1
@ -1146,7 +1146,7 @@ nvmf_tcp_qpair_sock_init(struct spdk_nvmf_tcp_qpair *tqpair)
|
|||||||
spdk_trace_record(TRACE_TCP_QP_SOCK_INIT, 0, 0, (uintptr_t)tqpair);
|
spdk_trace_record(TRACE_TCP_QP_SOCK_INIT, 0, 0, (uintptr_t)tqpair);
|
||||||
|
|
||||||
/* set low water mark */
|
/* set low water mark */
|
||||||
rc = spdk_sock_set_recvlowat(tqpair->sock, sizeof(struct spdk_nvme_tcp_common_pdu_hdr));
|
rc = spdk_sock_set_recvlowat(tqpair->sock, 1);
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
SPDK_ERRLOG("spdk_sock_set_recvlowat() failed\n");
|
SPDK_ERRLOG("spdk_sock_set_recvlowat() failed\n");
|
||||||
return rc;
|
return rc;
|
||||||
|
Loading…
Reference in New Issue
Block a user