From nobody Mon Jul 7 23:18:17 2025 X-Original-To: dev-commits-src-main@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 4bbgCF6jFZz61VPR; Mon, 07 Jul 2025 23:18:17 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbgCF5wKNz41Bb; Mon, 07 Jul 2025 23:18:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751930297; 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=/cr8vf+6rEUwrEY4yXQVq9LHAm2a4i6zR1ai7fG1DxU=; b=r/xEhJ5yXzPM46baC3UNQZ5/+U19BRurCpCdzBbKSr1L0BkxvyyOypqxm8LTinbRQYT8IC mCt9UFJrZxINzVpoyMSXYn7zHPEElnLhHnRuy1sDmtW217KrLIj9Ly5r8lcN99cGJ+4Aj4 y6HGfBHEXbDH26TgfHbR1NDON0cHSaXzlgXBOzaXLH3wnNkt8Vv2jGa/OkJ3CQcbhdrn13 SZIV+7QZj0XvR8PJZj8iHw1xq68qZWL/Xb63xaxuKSsoLHUtvb9SRHHYvXte2cHsjFq/8U iLCIJaAs3fURgfIReNTYIN4Im5yQJpr2r0/HhdxdkZ5VrcMqx/3ZbwXNm/LXcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751930297; 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=/cr8vf+6rEUwrEY4yXQVq9LHAm2a4i6zR1ai7fG1DxU=; b=yrhlsITv7qqCH4AY5pi9vpbHWAm1EWdSwuoe4spDmhg+AE4oQaIl0OCW2crYQUMiTBjqUN 1lW7hR8o4TcA8G3UKJCQzObPkjb7FEmtA1sPN3fphzwedpxg5UF8Wjpx/TV5uMUkrqM59m r6BlsXQyPEM8yqKy53NDwfKX7kc3ryep8KHJBqE2cJIXj/smj+AiVprliQJpYjqkQXxUJH uoc1h0A59klyOeVp2lnJDwMkmRjtAI//5sCKUJT7Vi3kM00MLYcaKzj8sXHUlisd5tbeu3 oi5dMz59fnWkg4iLDicjx24+WE9RADa/vMyf5YVBDVwYE61zXCd1ei5lAbpLnA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751930297; a=rsa-sha256; cv=none; b=nktLfk0inzv8NLmqwD/eZ0vwkBa/ODRCWtW2yN9w05CltMZZ/y1n5nyewiyJAZC1O09ORW KMJlUzOBFH+CvkmJEMIw0vTQCvvRSpxMjJ/sdCJtrUfm8uq5RIen9QPCtg+dB1zOIMjDJC RzKmYs1CfF2S8ynfp6pKrP5Nc7roJsZmeA0MxjwvH0FJU/C17o4IDKY6C9hGarV/eHJZG1 eDcxX9Vwj9Py5SXufWYWasFFYRuylb4vVQ4MUoIEcbXnmPTM0znmXA80WCK08rDyY9rZU1 jh8xLXclrqEZtx8hJfv/UZX1VsaQwSySycM0v2d8fPgPG4M7PjsfpIie3IrIJg== 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 4bbgCF5D3rz19sd; Mon, 07 Jul 2025 23:18:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567NIHcR045585; Mon, 7 Jul 2025 23:18:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567NIHWS045582; Mon, 7 Jul 2025 23:18:17 GMT (envelope-from git) Date: Mon, 7 Jul 2025 23:18:17 GMT Message-Id: <202507072318.567NIHWS045582@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 5ac5ebfa7533 - main - cam/scsi: Use xpt_path_inq() instead of hand-rolled expansion List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5ac5ebfa7533d9c3d2b7dd0443a2dba04bf0c687 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=5ac5ebfa7533d9c3d2b7dd0443a2dba04bf0c687 commit 5ac5ebfa7533d9c3d2b7dd0443a2dba04bf0c687 Author: Warner Losh AuthorDate: 2025-07-07 20:04:24 +0000 Commit: Warner Losh CommitDate: 2025-07-07 23:17:00 +0000 cam/scsi: Use xpt_path_inq() instead of hand-rolled expansion Use xpt_path_inq() for all XPT_PATH_INQ requests. They all should be CAM_PRIORITY_NONE since XPT_PATH_INQ is an unqueued command, so the minor changes here from _NORMAL to _NONE don't matter. And the one place we preseve the priority doesn't matter either: It's an allocated CCB, true, but it only ever stores the CPI from XPT_PATH_INQ. Sponsored by: Netflix Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D51121 --- sys/cam/scsi/scsi_xpt.c | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/sys/cam/scsi/scsi_xpt.c b/sys/cam/scsi/scsi_xpt.c index 439dd2050a95..175716ca6a67 100644 --- a/sys/cam/scsi/scsi_xpt.c +++ b/sys/cam/scsi/scsi_xpt.c @@ -1945,10 +1945,7 @@ scsi_scan_bus(struct cam_periph *periph, union ccb *request_ccb) xpt_done(request_ccb); return; } - xpt_setup_ccb(&work_ccb->ccb_h, request_ccb->ccb_h.path, - request_ccb->ccb_h.pinfo.priority); - work_ccb->ccb_h.func_code = XPT_PATH_INQ; - xpt_action(work_ccb); + xpt_path_inq(&work_ccb->cpi, request_ccb->ccb_h.path); if (work_ccb->ccb_h.status != CAM_REQ_CMP) { request_ccb->ccb_h.status = work_ccb->ccb_h.status; xpt_free_ccb(work_ccb); @@ -2294,10 +2291,7 @@ scsi_scan_lun(struct cam_periph *periph, struct cam_path *path, CAM_DEBUG(path, CAM_DEBUG_TRACE, ("scsi_scan_lun\n")); - memset(&cpi, 0, sizeof(cpi)); - xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NONE); - cpi.ccb_h.func_code = XPT_PATH_INQ; - xpt_action((union ccb *)&cpi); + xpt_path_inq(&cpi, path); if (cpi.ccb_h.status != CAM_REQ_CMP) { if (request_ccb != NULL) { @@ -2421,10 +2415,7 @@ scsi_devise_transport(struct cam_path *path) struct scsi_inquiry_data *inq_buf; /* Get transport information from the SIM */ - memset(&cpi, 0, sizeof(cpi)); - xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NONE); - cpi.ccb_h.func_code = XPT_PATH_INQ; - xpt_action((union ccb *)&cpi); + xpt_path_inq(&cpi, path); inq_buf = NULL; if ((path->device->flags & CAM_DEV_INQUIRY_DATA_VALID) != 0) @@ -2732,10 +2723,7 @@ scsi_set_transfer_settings(struct ccb_trans_settings *cts, struct cam_path *path inq_data = &device->inq_data; scsi = &cts->proto_specific.scsi; - memset(&cpi, 0, sizeof(cpi)); - xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NONE); - cpi.ccb_h.func_code = XPT_PATH_INQ; - xpt_action((union ccb *)&cpi); + xpt_path_inq(&cpi, path); /* SCSI specific sanity checking */ if ((cpi.hba_inquiry & PI_TAG_ABLE) == 0 @@ -3046,10 +3034,7 @@ _scsi_announce_periph(struct cam_periph *periph, u_int *speed, u_int *freq, stru return; /* Ask the SIM for its base transfer speed */ - memset(&cpi, 0, sizeof(cpi)); - xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NORMAL); - cpi.ccb_h.func_code = XPT_PATH_INQ; - xpt_action((union ccb *)&cpi); + xpt_path_inq(&cpi, path); /* Report connection speed */ *speed = cpi.base_transfer_speed;