nvmf/tcp: fix async bugs when ddgst enalbed

If host disconnect the connection when fabric commands are offload to
DSA, there will be use-after-free problems.

Now, disable the offload of fabrics command.

Fix issue 2828

Signed-off-by: MengjinWu <mengjin.wu@intel.com>
Change-Id: I669b01728e1ad275b7b121d47141bdf3fe5f7d9f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15992
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
MengjinWu 2022-12-16 12:25:17 +00:00 committed by Tomasz Zawadzki
parent 941cf96d3c
commit 9e9da4675f

View File

@ -1909,7 +1909,8 @@ nvmf_tcp_pdu_payload_handle(struct spdk_nvmf_tcp_qpair *tqpair, struct nvme_tcp_
SPDK_DEBUGLOG(nvmf_tcp, "enter\n");
/* check data digest if need */
if (pdu->ddgst_enable) {
if (!pdu->dif_ctx && tqpair->group && (pdu->data_len % SPDK_NVME_TCP_DIGEST_ALIGNMENT == 0)) {
if (tqpair->qpair.qid != 0 && !pdu->dif_ctx && tqpair->group &&
(pdu->data_len % SPDK_NVME_TCP_DIGEST_ALIGNMENT == 0)) {
rc = spdk_accel_submit_crc32cv(tqpair->group->accel_channel, &pdu->data_digest_crc32, pdu->data_iov,
pdu->data_iovcnt, 0, data_crc32_calc_done, pdu);
if (spdk_likely(rc == 0)) {