From nobody Tue Jun 27 03:38:31 2023 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 4Qqr605FjYz4jqyW; Tue, 27 Jun 2023 03:38:32 +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 4Qqr5z45HKz3MCP; Tue, 27 Jun 2023 03:38:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687837111; 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=ZGzJn2PEng+6eGkJ/3Jcb0v8jfCA39ouFBhrkxG4Rd4=; b=K11ivxunzQzGGmO0fFSQaLZXVKDTb+368Jrh4S9/7lgDrIslbrtRuYSHlQ5NAssB9sV8sh /DJlDKfE/WUdUWtExStlGHG/3rFKQI9dLz00iY/b5m3Dl0C0xHqzH5vvv4lS4NX3yOX+w3 mS71d/QK0FB7E9YoclvzNss/XRlcDcAUUD45apQE7mmNGi2uZtaatsGYAo4B0JgS3/vvbw EXtH0txHAHaA5tPUBq6KwFugMyYpnQDhGvqT9CIeuODP6XGh+82LKf7lclAfD0oCJvkpbX LrYZRWu6y5Fv70vjw727+x47JcKGv8qm9esxPxumcJokNYj+4FjasnZT7xqkJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687837111; 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=ZGzJn2PEng+6eGkJ/3Jcb0v8jfCA39ouFBhrkxG4Rd4=; b=cNIV5/zPgep1ZL34zYs+1llPp/yGTXi1/Pf7wM66MMN9oCvsDR/vRcYKUeRkK3IaeVSK8k bjWQTLl8zPc9LzI5dwDTY9zRZw/Z9bjsqNEufzvIc7kocfDxDA84aekMq7XDHcIw+slbDS Qm4YSk+F96AMv60wvegxAl2ygXgM2QxxqmV5tHwX/dn7HyB/ftlzDFsqpCUue97qNwrF3p r1EwcyJK9ub/8U3Qib3nyvKFX74MxevZ8DKu35eWduCc52MFYuLTNwkqc3QJpRAUp7+5vI ugGByx0OMe1mPtoWSuSfMjXYNeIHXsfiKZsYsNEDB7n/DypB8kLKCtV5JR8CoA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687837111; a=rsa-sha256; cv=none; b=qrHmbNabW93xXoNwGqNekPkU+iiykaUGEDr1omxjLn62ZSR2cXL7hqNYc6d3w8OR9cnbBZ PAZCic0pieiLnAdMXOmk/U+S62OdUKIphbX2Tyh2TaPpKyM6vFXMnPVzcT+NaFO0wKPoSU hyh33OfT/tpj+/L+5G4BLiEdNHyPYhkLOJhO+PHg9mv3B7At9kjINHtQjHZqXg88YpeUNC 8RwCrx1q0yZt7aFR9L1uqN8DFHZCZZwQgKU5Hn6/B9BPEqzKabyIF4ZScDtqOkMoHGQDcf XvrEZRe83pRsDlzxBG5B5OOJNZw+Nx5h2AF75OaQRuPcm92REiIodyRX+bAE8w== 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 4Qqr5z38tczbp5; Tue, 27 Jun 2023 03:38:31 +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 35R3cVMo034559; Tue, 27 Jun 2023 03:38:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35R3cVo0034558; Tue, 27 Jun 2023 03:38:31 GMT (envelope-from git) Date: Tue, 27 Jun 2023 03:38:31 GMT Message-Id: <202306270338.35R3cVo0034558@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: af296130eadb - main - nvme_xpt: Tidy nvme_announce_periph for fabrics support. 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: af296130eadbad541d57717719d87bec43353e18 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=af296130eadbad541d57717719d87bec43353e18 commit af296130eadbad541d57717719d87bec43353e18 Author: John Baldwin AuthorDate: 2023-06-27 03:37:43 +0000 Commit: John Baldwin CommitDate: 2023-06-27 03:37:43 +0000 nvme_xpt: Tidy nvme_announce_periph for fabrics support. - Read the version from cts.protocol_version. - Only check xport_specific.nvme for PCI-e info for XPORT_NVME. Reviewed by: chuck, imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D40618 --- sys/cam/nvme/nvme_xpt.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/sys/cam/nvme/nvme_xpt.c b/sys/cam/nvme/nvme_xpt.c index 0575c5220c0b..f1bcd581a096 100644 --- a/sys/cam/nvme/nvme_xpt.c +++ b/sys/cam/nvme/nvme_xpt.c @@ -802,19 +802,22 @@ nvme_announce_periph(struct cam_periph *periph) xpt_action((union ccb*)&cts); if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) return; - nvmex = &cts.xport_specific.nvme; /* Ask the SIM for its base transfer speed */ xpt_path_inq(&cpi, periph->path); sbuf_new(&sb, buffer, sizeof(buffer), SBUF_FIXEDLEN); sbuf_printf(&sb, "%s%d: nvme version %d.%d", periph->periph_name, periph->unit_number, - NVME_MAJOR(nvmex->spec), - NVME_MINOR(nvmex->spec)); - if (nvmex->valid & CTS_NVME_VALID_LINK) - sbuf_printf(&sb, " x%d (max x%d) lanes PCIe Gen%d (max Gen%d) link", - nvmex->lanes, nvmex->max_lanes, - nvmex->speed, nvmex->max_speed); + NVME_MAJOR(cts.protocol_version), + NVME_MINOR(cts.protocol_version)); + if (cts.transport == XPORT_NVME) { + nvmex = &cts.proto_specific.nvme; + if (nvmex->valid & CTS_NVME_VALID_LINK) + sbuf_printf(&sb, + " x%d (max x%d) lanes PCIe Gen%d (max Gen%d) link", + nvmex->lanes, nvmex->max_lanes, + nvmex->speed, nvmex->max_speed); + } sbuf_printf(&sb, "\n"); sbuf_finish(&sb); sbuf_putbuf(&sb);