From b5383af40a994b24000d6ca5187c508d7b33b7eb Mon Sep 17 00:00:00 2001 From: MengjinWu Date: Tue, 31 May 2022 10:27:53 +0800 Subject: [PATCH] lib/nvmf: another chance to calc crc32 when accel_tasks are used up If accel_tasks are used up, we should not directly return but give an another chance to calc it directly. Signed-off-by: MengjinWu Change-Id: I983b65d7dfff0fea3974682e886d2dcf309cd2c3 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12841 Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Shuhei Matsumoto Reviewed-by: Aleksey Marchuk Reviewed-by: Konrad Sztyber Reviewed-by: Xiaodong Liu --- lib/nvmf/tcp.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/nvmf/tcp.c b/lib/nvmf/tcp.c index de1739f4f..5d1295fa0 100644 --- a/lib/nvmf/tcp.c +++ b/lib/nvmf/tcp.c @@ -999,9 +999,10 @@ pdu_data_crc32_compute(struct nvme_tcp_pdu *pdu) /* Only suport this limitated case for the first step */ if (spdk_likely(!pdu->dif_ctx && (pdu->data_len % SPDK_NVME_TCP_DIGEST_ALIGNMENT == 0) && tqpair->group)) { - spdk_accel_submit_crc32cv(tqpair->group->accel_channel, &pdu->data_digest_crc32, - pdu->data_iov, pdu->data_iovcnt, 0, data_crc32_accel_done, pdu); - return; + if (!spdk_accel_submit_crc32cv(tqpair->group->accel_channel, &pdu->data_digest_crc32, pdu->data_iov, + pdu->data_iovcnt, 0, data_crc32_accel_done, pdu)) { + return; + } } crc32c = nvme_tcp_pdu_calc_data_digest(pdu);