From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 53BB51DD0EF for ; Wed, 26 Aug 2026 02:39:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787711997; cv=none; b=M3DL5Fvn+fUHhgQmw1c+8Odu1DCELTPEYfLSbC9fYL2M/DdebLb7NgO4gtBvrjUBADVLZaYQ2dUGgJD1Qg9ZQ26FT4P48IronWob8CCvxYx1VntDn+6OKBGcx9Iw4Xs0zLy8KkGZNqB73IsnozNwzW+JQkN1kO+bAA/DSlplQ1s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787711997; c=relaxed/simple; bh=w7lwfOulZDWCQ3L7FrixE2m/jYQbsUbfDOqz/A4vQz0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=gI3mjWicK0UpbF8sCf3pj2GVTHn1HThSiA1AtmDteWsdkK5MaW0dyUFAgu4tvmJhidQHKIGd2/xObmF9dj4zGNoEu+nvpNOflD/vB6nUbAPdKdQtq5t3ZO0OEeqGQFuOCnFkYdnG+oACCeLHmjF/p3Emwxj4224WrVpkJaXmmZk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: 68ddaf7ea0f711f19a56ed5b684f684d-20260826 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.19,REQID:2c452175-38b1-4e27-911a-106137048327,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:7db8b62,CLOUDID:d184f2d287596130b25f736e7f823e22,BulkI D:nil,BulkQuantity:0,SF:102|865|898,TC:nil,Content:0|15|50,EDM:-3,IP:nil,U RL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1, SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: 68ddaf7ea0f711f19a56ed5b684f684d-20260826 X-User: liuxixin@kylinos.cn Received: from [127.0.1.1] [(10.44.16.150)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA with TLSv1.3 TLS_AES_256_GCM_SHA384 256/256) with ESMTP id 1218028887; Wed, 26 Aug 2026 10:39:50 +0800 From: Xixin Liu To: linux-nvme@lists.infradead.org Cc: kbusch@kernel.org, axboe@kernel.dk, hch@lst.de, sagi@grimberg.me, hare@suse.de, dwagner@suse.de, linux-kernel@vger.kernel.org, liuxixin@kylinos.cn Subject: [PATCH v1 0/1] nvme-tcp: fix wrong status on deferred digest error Date: Wed, 26 Aug 2026 10:15:00 +0800 Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Mailer: patches/scripts/send-local.py Hi, A C2HData digest error stores a host status code in the per-request status field. Without DATA_SUCCESS the request is completed later from the rsp path. That path used to pass the stored value straight into complete, which expects CQE status field encoding and shifts right, so DATA_XFER_ERROR could be reported as INVALID_FIELD. This series keeps the per-request status as a host status code. On the rsp path, shift left when a host error was already stored, otherwise use the completion status field. To hit the TCP DATA_XFER_ERROR path without DATA_SUCCESS, enable data digest and temporarily change the target in drivers/nvme/target/tcp.c, nvmet_setup_c2h_data_pdu, after the digest is calculated: if (queue->data_digest) { pdu->hdr.flags |= NVME_TCP_F_DDGST; nvmet_tcp_calc_ddgst(cmd); cmd->exp_ddgst ^= cpu_to_le32(1); } The default target path does not set DATA_SUCCESS on C2HData, so the host stores the digest error and completes from the later rsp. Verified on linux-next with an nvmet-tcp loopback target. Unpatched: nvme nvme0: data digest error: recv 0x2542708 expected 0x2542709 nvme nvme0: Identify Controller failed (2) Patched: nvme nvme0: data digest error: recv 0x7ebd5719 expected 0x7ebd5718 nvme nvme0: Identify Controller failed (4) Status code 0x2 is INVALID_FIELD. Status code 0x4 is DATA_XFER_ERROR. recv and expected differ by one in both runs. Thanks, Xixin Liu --- Xixin Liu (1): nvme-tcp: fix wrong status on deferred digest error drivers/nvme/host/tcp.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) -- 2.53.0