From nobody Sat Dec 17 19:19:00 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NZG3n0vkDz1CgTj; Sat, 17 Dec 2022 19:19:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NZG3m64c0z4Dkq; Sat, 17 Dec 2022 19:19:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1671304740; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8XyG/Oe+qJ+alCf1e/glV8EwDRMAbar/ofzz5iBau5M=; b=Loib4Nw4dCR+VkxyomsKpQuFXnSExZ8b3j7XuP9x/NOttqJRbKZZ9BZy0fQzmhTT2aDoST hCVWVteckWnaMXkHTog/KPLQsSeu9fSM4unNgpgzs2U5NVZKhKKPlZpbhi9fRkJ9I5MBGj UV3EqY8T7tlS7H0xDyG+bd+hBvKpHGiu5IPtxFIV+muhX6VEgXICVUrRWTYhZJ8qkpXjF6 dTVw++25/cHs199pO/pZeR2NxaVqA+w0rBK1LdxCf5puOhK51g3fUXwsIxYqqj6CZqceVn PpnfasIgd9HK5BWUFnUaBLEQGPM8188MExuUSAcI/kc4ttHrVM05rgKMPpY2kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1671304740; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8XyG/Oe+qJ+alCf1e/glV8EwDRMAbar/ofzz5iBau5M=; b=GglYExZk6hVNoRMdnK3FGNu0JlvpCGQECIkqRMVjANx57FZftPkTHF/kb4Jo+dHjvTK/o4 d82oxSaYclEGDw3EQQVa6i7S80ZI5lQFVyscg5YylnqqTBrwtviUzF7Klq/saF+fMUQ4Cp PSwB6pegnDqh5nv8E1CN7EgbWiA1wdeuYNpo/kzrXp+NBp7Sd8h6eIT8+Ts7DsHQDU0hqh raVbNEiiFvdFW9tWeTxCh+OeAtj5pIP4+IBGp8ohGIqs+URm3HQxBtNqrhsPmW8NqPaGuH /jMbkgQAO3gfkgxb27y+F+dc5e8QySgKVFVaAoietJO6LsRr8OlOzeqnEqUUQA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1671304740; a=rsa-sha256; cv=none; b=gPS3naNg5rm9ZZguugDtdCirwcTQTjttlga1nbs+VHd+1H2Tr8wFhrLSWAu25MliBc50Ly 0SSz9w62ex+/aASB8UBYNUDVv6OXNzxqc5mPO4Mgpqyh1ROtFMNeibO8gj8hHgJle7euER kjfyIx1dr64VXKoncOQmngVi+32+6tQeMxKl8erD1iAMrygMxZUnNp6z/d9Pq58DOTaj1L Wd/k2spiXx2fRJtjm2TR9e2N02FtfBhGwNM8nLqDqdZOUS+q/XnjtwPBa/XYtaizC7mfGD I1n5OIszxm6+E5RoE6fG8XfbDazXw1P3m4qRyehNCOJrUbOuwaiFlWiDVwoIuQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NZG3m58Crz12xM; Sat, 17 Dec 2022 19:19:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2BHJJ0Et073243; Sat, 17 Dec 2022 19:19:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2BHJJ0SS073242; Sat, 17 Dec 2022 19:19:00 GMT (envelope-from git) Date: Sat, 17 Dec 2022 19:19:00 GMT Message-Id: <202212171919.2BHJJ0SS073242@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: f7c086f2c27d - stable/13 - bhyve virtio-scsi: Fix residual reporting. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f7c086f2c27d185ee831947378de9671298387db Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=f7c086f2c27d185ee831947378de9671298387db commit f7c086f2c27d185ee831947378de9671298387db Author: Alexander Motin AuthorDate: 2022-12-03 15:08:20 +0000 Commit: Alexander Motin CommitDate: 2022-12-17 19:18:38 +0000 bhyve virtio-scsi: Fix residual reporting. CTL does not really use residual field and it always returned zero. Use ext_data_filled instead. MFC after: 2 weeks (cherry picked from commit b81ac5cdc355029b4d5723fcdfcbcbedeb94dcd9) --- usr.sbin/bhyve/pci_virtio_scsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bhyve/pci_virtio_scsi.c b/usr.sbin/bhyve/pci_virtio_scsi.c index 563798f19b07..e00591a603e0 100644 --- a/usr.sbin/bhyve/pci_virtio_scsi.c +++ b/usr.sbin/bhyve/pci_virtio_scsi.c @@ -559,7 +559,7 @@ pci_vtscsi_request_handle(struct pci_vtscsi_queue *q, struct iovec *iov_in, } else { cmd_wr->sense_len = MIN(io->scsiio.sense_len, sc->vss_config.sense_size); - cmd_wr->residual = io->scsiio.residual; + cmd_wr->residual = ext_data_len - io->scsiio.ext_data_filled; cmd_wr->status = io->scsiio.scsi_status; cmd_wr->response = VIRTIO_SCSI_S_OK; memcpy(&cmd_wr->sense, &io->scsiio.sense_data,