From nobody Fri Jan 19 17:17:39 2024 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 4TGmX34q1Rz56xfQ; Fri, 19 Jan 2024 17:17:39 +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 4TGmX32Vfmz4Mxt; Fri, 19 Jan 2024 17:17:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705684659; 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=I0XZEAFTUAJk5WvsINbHpoNuu2gA1QzKcQFsQN1uvQU=; b=xbGyjZeFBvqhPfUg5R7FqsTFYKkMCrTIaKWPwhRS296H+PrWAawJggaWF0/JnA1OfbxFW2 AFtvUg0xDKCqCCFWkCLt6sgB3P5WAgrdBgEAk3CAGlFieLRn67Yaqum42xLgqZCEk41oQW Zf0HPZYHY6iuBHTO1Pbh5judHfHMO6XkMXHxjazfAAhfmc9332mFyAUvHJiVt4co/W9GrQ kP4Boc0OTyJZEG4nR0Q4HUM/7+Oi6MLuwR4mq9Y4vCChHLtEkvT9M5u+L6uz9xz8czZaxd /WTGB4nv68ljhQG7xgE+eTXC/aRizzqtZ5w6PsFSaGp/gc1AC95AScWvu59qeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705684659; 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=I0XZEAFTUAJk5WvsINbHpoNuu2gA1QzKcQFsQN1uvQU=; b=DSH5QLvDhnN7oXC3mg8Wp7B3kxkelpGSN+6fsiRu263IROx1UNfWGgytwaL3Ism2dyuXEO CPkGVbxQLaqckIjhGhTp9+Gdw9jO2+/H3074e7DEAUev0PcgfVtXJn8Qo1lLlp0gbUYn6s iWIsEj6htM68L4XWlfHA1OXsAzBr44sG9nfFBucE4Jmgj2b5f8Jzo2VUDcnuE8/TSNGrwO 9V9XKrtY3egQvQyzD6k1WrE6fRl948ax0DCy97wOeR3Zr+k2PGOfhKkwyKnrFf5dZLEVxt 91/RkoJv4bdToMvceI7lf3tI5u6oN6Up/LKV5MnoRp/tAOUzU4v7OaR3hhIztQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705684659; a=rsa-sha256; cv=none; b=Df5V7AOaLJ5Btm/F7ulHrcd34lBtL9fwseoPVgWXy+wG4nESfL/ttHovgNZhNtrCxvGGPT phetIafNdmIt2DZseR6hde8V5TWSwh5C2Kw3HmpOZ9j840dgWz7yU5nn0jDTNsZM2N7xU4 KBilQ+BU+1Ji+oz5gcTIQAB9eDG0qkphOmavSvho9MpPa+YgiXZwp0o+pexvNrIpEIUSWV giTNz7XW2CQ6WsttiMUt/SeucanG20Ijg7Ln7Cs8PWsWnl2kGV9UFTEk/KWXvFf9W7DFCH BNuSpR2NFAkTlpJoUOJzfc2tvYaNEssipeW/9vj30S+1E0DC2YMUGL3/Z8LbLQ== 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 4TGmX31bjHz10cM; Fri, 19 Jan 2024 17:17:39 +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 40JHHdW1097204; Fri, 19 Jan 2024 17:17:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40JHHde3097201; Fri, 19 Jan 2024 17:17:39 GMT (envelope-from git) Date: Fri, 19 Jan 2024 17:17:39 GMT Message-Id: <202401191717.40JHHde3097201@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: 835db4182391 - stable/14 - mpi3mr: Add firmware version 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/14 X-Git-Reftype: branch X-Git-Commit: 835db41823919e9b025e6867f52cc97b07c67fea Auto-Submitted: auto-generated The branch stable/14 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=835db41823919e9b025e6867f52cc97b07c67fea commit 835db41823919e9b025e6867f52cc97b07c67fea Author: Warner Losh AuthorDate: 2023-11-29 01:50:10 +0000 Commit: Alexander Motin CommitDate: 2024-01-19 17:16:50 +0000 mpi3mr: Add firmware version Publish the firmware version on the card like we do for mps/mpr. Sponsored by: Netflix Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D42588 (cherry picked from commit 28a274342ea0b0666b56704477d2d1c17564942e) --- sys/dev/mpi3mr/mpi3mr.c | 15 +++++++++------ sys/dev/mpi3mr/mpi3mr.h | 3 +-- sys/dev/mpi3mr/mpi3mr_pci.c | 4 ++++ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/sys/dev/mpi3mr/mpi3mr.c b/sys/dev/mpi3mr/mpi3mr.c index 9bd6417d5345..b54a1844b173 100644 --- a/sys/dev/mpi3mr/mpi3mr.c +++ b/sys/dev/mpi3mr/mpi3mr.c @@ -1565,6 +1565,7 @@ static int mpi3mr_process_factsdata(struct mpi3mr_softc *sc, { int retval = 0; U32 ioc_config, req_sz, facts_flags; + struct mpi3mr_compimg_ver *fwver; if (le16toh(facts_data->IOCFactsDataLength) != (sizeof(*facts_data) / 4)) { @@ -1661,6 +1662,12 @@ static int mpi3mr_process_factsdata(struct mpi3mr_softc *sc, sc->io_throttle_high = (sc->facts.io_throttle_high * 2 * 1024); sc->io_throttle_low = (sc->facts.io_throttle_low * 2 * 1024); + fwver = &sc->facts.fw_ver; + snprintf(sc->fw_version, sizeof(sc->fw_version), + "%d.%d.%d.%d.%05d-%05d", + fwver->gen_major, fwver->gen_minor, fwver->ph_major, + fwver->ph_minor, fwver->cust_id, fwver->build_num); + mpi3mr_dprint(sc, MPI3MR_INFO, "ioc_num(%d), maxopQ(%d), maxopRepQ(%d), maxdh(%d)," "maxreqs(%d), mindh(%d) maxPDs(%d) maxvectors(%d) maxperids(%d)\n", sc->facts.ioc_num, sc->facts.max_op_req_q, @@ -1676,7 +1683,7 @@ static int mpi3mr_process_factsdata(struct mpi3mr_softc *sc, sc->facts.max_dev_per_tg, sc->facts.max_io_throttle_group, sc->facts.io_throttle_data_length * 4, sc->facts.io_throttle_high, sc->facts.io_throttle_low); - + sc->max_host_ios = sc->facts.max_reqs - (MPI3MR_INTERNALCMDS_RESVD + 1); @@ -2220,7 +2227,6 @@ mpi3mr_display_ioc_info(struct mpi3mr_softc *sc) { int i = 0; char personality[16]; - struct mpi3mr_compimg_ver *fwver = &sc->facts.fw_ver; switch (sc->facts.personality) { case MPI3_IOCFACTS_FLAGS_PERSONALITY_EHBA: @@ -2236,9 +2242,7 @@ mpi3mr_display_ioc_info(struct mpi3mr_softc *sc) mpi3mr_dprint(sc, MPI3MR_INFO, "Current Personality: %s\n", personality); - mpi3mr_dprint(sc, MPI3MR_INFO, "FW Version: %d.%d.%d.%d.%05d-%05d\n", - fwver->gen_major, fwver->gen_minor, fwver->ph_major, - fwver->ph_minor, fwver->cust_id, fwver->build_num); + mpi3mr_dprint(sc, MPI3MR_INFO, "%s\n", sc->fw_version); mpi3mr_dprint(sc, MPI3MR_INFO, "Protocol=("); @@ -2881,7 +2885,6 @@ int mpi3mr_initialize_ioc(struct mpi3mr_softc *sc, U8 init_type) sc->reply_sz = sc->facts.reply_sz; } - mpi3mr_display_ioc_info(sc); retval = mpi3mr_reply_alloc(sc); diff --git a/sys/dev/mpi3mr/mpi3mr.h b/sys/dev/mpi3mr/mpi3mr.h index 8d92f8f80e57..3a9612449c63 100644 --- a/sys/dev/mpi3mr/mpi3mr.h +++ b/sys/dev/mpi3mr/mpi3mr.h @@ -556,8 +556,7 @@ struct mpi3mr_softc { uint32_t chain_frame_size; struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_tree; - char fw_version[16]; - char msg_version[8]; + char fw_version[32]; struct mpi3mr_chain *chains; struct callout periodic; struct callout device_check_callout; diff --git a/sys/dev/mpi3mr/mpi3mr_pci.c b/sys/dev/mpi3mr/mpi3mr_pci.c index 8a2c101e06c2..d07463366943 100644 --- a/sys/dev/mpi3mr/mpi3mr_pci.c +++ b/sys/dev/mpi3mr/mpi3mr_pci.c @@ -145,6 +145,10 @@ mpi3mr_setup_sysctl(struct mpi3mr_softc *sc) OID_AUTO, "io_cmds_highwater", CTLFLAG_RD, &sc->io_cmds_highwater, 0, "Max FW outstanding commands"); + SYSCTL_ADD_STRING(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), + OID_AUTO, "firmware_version", CTLFLAG_RD, sc->fw_version, + strlen(sc->fw_version), "firmware version"); + SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "mpi3mr_debug", CTLFLAG_RW, &sc->mpi3mr_debug, 0, "Driver debug level");