From nobody Fri Jan 19 17:17:34 2024 X-Original-To: dev-commits-src-all@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 4TGmWz1X3sz56xQc; Fri, 19 Jan 2024 17:17:35 +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 4TGmWy6BnRz4MlP; Fri, 19 Jan 2024 17:17:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705684654; 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=Z24vVrwNDJjHiFWKdtYz4dwfgFS15JZ3RJh3g4CTsfo=; b=OI+NSFbbLuBj14/7dz98vNypsCDrqhVDuZYiC02N9peN2u/mctHZHnbTtmVpqVO4L95TdB ghdOJDhvTZbD1DTsOhCNQ7/DCxHolZESeWs1FTo44DQ2OkG9kUbzyQfewad7VZW6jDTSGY idchDqDrJC9iQ+I20ZoGOR9XbzrwT8+JMCoS/yT6sXBbhwfYxCQpG4Zt6t2lvtcrYPIWUk vauQ3EYiXmCZLpgJiT4c+WCMZCmcr7g84G59AnPra/V+3qAMzk8CHnXm49TM3UELh46GJP zD4WZeqKaCiIFda+FJHC6mcNgdndDUNWVYWuEueJUcj1jbKc05NrIGZ04Q60HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705684654; 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=Z24vVrwNDJjHiFWKdtYz4dwfgFS15JZ3RJh3g4CTsfo=; b=sRrQFh4/oUWhsL1LChzkfuQwrWa1upoD+qFrtWr/gtl8foW+4viPuI0hm30/ACr8YXBpMj 8/Mi1JRqzESJJwq/XjvyWiKqP3zlDcoCElHn0/5d9J0TPxEW4yMjWevEgVZQW7DrYanU8t ewylOAFVdD7Ot8zuqrA35rmkHC1742PVUQWekVIN7gfaApUAHgpNifiu0OBVOLCN0gFuVO 1QPUXxPA/gjpIk1OaKtQCPMCMf67e72oPZSPiE0NP1pgxedCgqpMOj+UWj31/5t/E9wK4A +dI4K1UuSK9MVqJnSI1Z7fG+CjsXxNcfDEmxb3YS3OtT118qcHjy4UQK0eBK1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705684654; a=rsa-sha256; cv=none; b=v5X/zSwYbxqOK+bHVOtMpL4keyUVY1UOUfq6gwFpcorynBejfbsXgaAO+iyTc9QtaMiIJ5 15wLt012VSUaBwIzdPi8y9Bz7y4BWxHow4y+DbNDI+SDOgiMqzWkr9Q8asjBuJRTKZmGOC iDbX0DnImvo/SFAnJhcvoZTkO9zrXhCyBz7mnqW9CEnwwdobWAmRyRnW/uPAhEg4xczVsp 9mAYcnpnphF5MdqJSTtmtzhN47MSH+iyaKx6M7DOFYjGKnvGe0Po5FcX16BGrzhdECu4j9 PGpXIYzvaGvC744CxAdqqJrCGeFWRzrlAdH0kdfPDrJMlum7bE/TVdsOBX3oUg== 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 4TGmWy4yhZz10tG; Fri, 19 Jan 2024 17:17:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40JHHYmr097013; Fri, 19 Jan 2024 17:17:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40JHHYHP097010; Fri, 19 Jan 2024 17:17:34 GMT (envelope-from git) Date: Fri, 19 Jan 2024 17:17:34 GMT Message-Id: <202401191717.40JHHYHP097010@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: ac4f33d2cd37 - stable/14 - mpi3mr: Cleaup setting of status in processing scsiio requests List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/14 X-Git-Reftype: branch X-Git-Commit: ac4f33d2cd37027b7adac2b0cb4b54e1458aa4b7 Auto-Submitted: auto-generated The branch stable/14 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=ac4f33d2cd37027b7adac2b0cb4b54e1458aa4b7 commit ac4f33d2cd37027b7adac2b0cb4b54e1458aa4b7 Author: Warner Losh AuthorDate: 2023-11-29 01:49:30 +0000 Commit: Alexander Motin CommitDate: 2024-01-19 17:16:49 +0000 mpi3mr: Cleaup setting of status in processing scsiio requests More uniformly use mpi3mr_set_ccbstatus in mpi3mr_action_scsiio. The routine mostly used it, but also has setting of status by hand. In those cases where we want to error out the request, use this routine. As part of this, move setting CAM_SIM_QUEUED later in the function to when we're sure it's been queued. Remove the places we clear it before this. Sponsored by: Netflix Reviewed by: mav, jhb Differential Revision: https://reviews.freebsd.org/D42542 (cherry picked from commit cf8c23230aabd30aa9251975dbe705da559a2d02) --- sys/dev/mpi3mr/mpi3mr_cam.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/sys/dev/mpi3mr/mpi3mr_cam.c b/sys/dev/mpi3mr/mpi3mr_cam.c index 44b613ad7915..b6e47eac058a 100644 --- a/sys/dev/mpi3mr/mpi3mr_cam.c +++ b/sys/dev/mpi3mr/mpi3mr_cam.c @@ -1025,7 +1025,7 @@ mpi3mr_action_scsiio(struct mpi3mr_cam_softc *cam_sc, union ccb *ccb) cam_sc->flags |= MPI3MRSAS_QUEUE_FROZEN; } ccb->ccb_h.status &= ~CAM_SIM_QUEUED; - ccb->ccb_h.status |= CAM_REQUEUE_REQ; + mpi3mr_set_ccbstatus(ccb, CAM_REQUEUE_REQ); xpt_done(ccb); return; } @@ -1099,39 +1099,38 @@ mpi3mr_action_scsiio(struct mpi3mr_cam_softc *cam_sc, union ccb *ccb) mpi3mr_dprint(sc, MPI3MR_TRACE, "[QID:%d]: func: %s line:%d CDB: 0x%x targetid: %x SMID: 0x%x\n", (queue_idx + 1), __func__, __LINE__, scsi_opcode, csio->ccb_h.target_id, cm->hosttag); - ccb->ccb_h.status |= CAM_SIM_QUEUED; - switch ((ccb->ccb_h.flags & CAM_DATA_MASK)) { case CAM_DATA_PADDR: case CAM_DATA_SG_PADDR: device_printf(sc->mpi3mr_dev, "%s: physical addresses not supported\n", __func__); mpi3mr_release_command(cm); - ccb->ccb_h.status = CAM_REQ_INVALID; - ccb->ccb_h.status &= ~CAM_SIM_QUEUED; + mpi3mr_set_ccbstatus(ccb, CAM_REQ_INVALID); xpt_done(ccb); return; case CAM_DATA_SG: device_printf(sc->mpi3mr_dev, "%s: scatter gather is not supported\n", __func__); mpi3mr_release_command(cm); - ccb->ccb_h.status = CAM_REQ_INVALID; + mpi3mr_set_ccbstatus(ccb, CAM_REQ_INVALID); xpt_done(ccb); return; case CAM_DATA_VADDR: case CAM_DATA_BIO: if (csio->dxfer_len > (MPI3MR_SG_DEPTH * MPI3MR_4K_PGSZ)) { + mpi3mr_set_ccbstatus(ccb, CAM_REQ_TOO_BIG); mpi3mr_release_command(cm); - ccb->ccb_h.status = CAM_REQ_TOO_BIG; xpt_done(ccb); return; } + ccb->ccb_h.status |= CAM_SIM_QUEUED; cm->length = csio->dxfer_len; if (cm->length) cm->data = csio->data_ptr; break; default: - ccb->ccb_h.status = CAM_REQ_INVALID; + mpi3mr_release_command(cm); + mpi3mr_set_ccbstatus(ccb, CAM_REQ_INVALID); xpt_done(ccb); return; }