From nobody Mon May 09 22:03:33 2022 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 21BC41AD5F48; Mon, 9 May 2022 22:03:34 +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 4KxwD545ynz3mmq; Mon, 9 May 2022 22:03:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652133813; 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=nKHvscULgJSx7Q4JUn7G00r6IfF+Qqs7n0uZ+OWnE/Y=; b=kXVbU+eX3wfmoBeKBvM4ae3IQ7FkoxyYOyDjnBUUIqg49H/SHrgMLXl/EZAxYKDK2Pe3pC J2fODocZeXmDEglzdTMX0Il7zLo840dpHtnptizloqY6ow7iIrSTJ51TtTuSC+CtLlWENo e3bQbAdWiYvTjdeNeX5n2h8aZWQK3GREuOZfnnjvFDGbZq0dEZLhGPNRpC7QpmGjO4h+lR eGJARTveLLJCcjmeWjCandpnlROo5ZytavEclyMfoF4HYOOvYr3uW/an8U+KnuMvcr+p+8 +SGFvOycB2oY3gVPHvpgEgDTDtblDhrkeuxChTvrFFIktozoaiHSC9j398n9XQ== 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 43AFE190E6; Mon, 9 May 2022 22:03:33 +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 249M3XK1008942; Mon, 9 May 2022 22:03:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 249M3X7N008941; Mon, 9 May 2022 22:03:33 GMT (envelope-from git) Date: Mon, 9 May 2022 22:03:33 GMT Message-Id: <202205092203.249M3X7N008941@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: bce02a0ea43a - main - mpsutil: Fix device speed reporting. 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/main X-Git-Reftype: branch X-Git-Commit: bce02a0ea43a0cd4ee9aa23c815189d2ccb83745 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652133813; 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=nKHvscULgJSx7Q4JUn7G00r6IfF+Qqs7n0uZ+OWnE/Y=; b=gl4umJiDFB4QKJfPqDQtAByCZmSNKWFd88XjmqHy4H89c7FIK4WuNsdgRpeA60LhxfjDar Ry+kESLn4esWbpUxRjiO+i8BHvWZP92q90K2yo1mFWoRsCcmmsgXOZpGlgTWAU1DylFX/j 8Xeu8juFyrX8czA6nx7/gYwrvf9kvq6TmW3ZaEATTQWu1lHcvdBce9aBeMTCUrynJCjRNt sSkOQg+q25ZrSngzzDsTZZIzmrb+zanl0XeH2s3b/tJp6FtbmVVkda6ZLqQrMAFt/95w79 3BTll0LgLJPDfHJC7qYhPjEBirfMjbJxwoOBmJRgt7aZnlW+x6GJ2wvNtPHBdw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1652133813; a=rsa-sha256; cv=none; b=drzIuOGL+I1ndiHM5KpLwUBK+wxHIDCCJdsw4mrvnHwHN3E9CC/usGrLtALMjO/WPeLn8W O7bPS/S+cz1YzjdBRRiJ+O0xILru8j7cVa8E+ur+CrPi3G67HacM9gm/eUAJJazVy+LkhO UWRJMafqkaqXfLrg6uZCEC2xkVX6/24+6l7duj1RHDWEQjYdDi/SZ9fRYF2on5yGNn5W18 iE030qgva1tm3u3Icwsv7Uy31yQdKw3QGnTdLOe0PD0rTSRUP7aNCwqzdtP8G1YYGF98GX wC0kIaztHy0cWW+E/GtW4Ajn+uXt+Lwl0ukA/EP7iSVET+VYevuNX8wI5bCPqg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=bce02a0ea43a0cd4ee9aa23c815189d2ccb83745 commit bce02a0ea43a0cd4ee9aa23c815189d2ccb83745 Author: Alexander Motin AuthorDate: 2022-05-09 21:57:29 +0000 Commit: Alexander Motin CommitDate: 2022-05-09 22:03:24 +0000 mpsutil: Fix device speed reporting. Report controller SAS phy speed only for directly attached devices. For others try to read and report parent expander phy speed. MFC after: 1 week --- usr.sbin/mpsutil/mps_show.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/usr.sbin/mpsutil/mps_show.c b/usr.sbin/mpsutil/mps_show.c index d293003fc67f..ef20cd942d86 100644 --- a/usr.sbin/mpsutil/mps_show.c +++ b/usr.sbin/mpsutil/mps_show.c @@ -577,9 +577,12 @@ show_devices(int ac, char **av) type = get_device_type(le32toh(device->DeviceInfo)); - if (device->PhyNum < nphys) { - phydata = &sas0->PhyData[device->PhyNum]; - speed = get_device_speed(phydata->NegotiatedLinkRate); + if (device->DeviceInfo & 0x800) { /* Direct Attached */ + if (device->PhyNum < nphys) { + phydata = &sas0->PhyData[device->PhyNum]; + speed = get_device_speed(phydata->NegotiatedLinkRate); + } else + speed = ""; } else if (device->ParentDevHandle > 0) { exp1 = mps_read_extended_config_page(fd, MPI2_CONFIG_EXTPAGETYPE_SAS_EXPANDER, @@ -597,13 +600,13 @@ show_devices(int ac, char **av) free(device); return (error); } - speed = " "; + speed = ""; } else { speed = get_device_speed(exp1->NegotiatedLinkRate); free(exp1); } } else - speed = " "; + speed = ""; if (device->EnclosureHandle != 0) { snprintf(enchandle, sizeof(enchandle), "%04x", le16toh(device->EnclosureHandle));