From nobody Wed Nov 29 01:55:40 2023 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 4Sg2Tm6RX8z52t9Y; Wed, 29 Nov 2023 01:55:40 +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 4Sg2Tm5KKXz4DS8; Wed, 29 Nov 2023 01:55:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701222940; 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=wLzJL7bNGAsj88GNCsKZpoN2V4KpLiOU83cnL2Nau3M=; b=gg+mFiWZiQOQlK5qr1ZL7F84tqcu5hOvfJL25TONGBBA+nftIZ5ufvYFq3FQqceJXHdibD thvrZB3jvleG0Wx5zs8I/t3JaybeEa2uWh/c55wIn24IuVdE5bQ/STGW6LgqIc8N5fyfMx aNvRQYmksGVJna0IbBAFbqfGVMRMM0jVAx2lh0kIAdHJGXSJSdCaFPW1f6i/tZmXqvbsra Nm+RKH4uyA7KGRNGNt94OZlVmwx0cB3g5Vk2Mggg0ZDL/zyubahXUVbJ8cEXb6B8GXSq0M fm2eK98IfILAuzNYcQWexIbhg9iEWinksFbIx5eJJuPnGGf/RhSLKQ9YpOSTaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701222940; 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=wLzJL7bNGAsj88GNCsKZpoN2V4KpLiOU83cnL2Nau3M=; b=gQ+yxfheTN8jgPGYKAl8yBHjnGV4GgDzT3dpxgEKZAnrgJYlkzo34I5mtMV93p5hkuHIMJ Z5OgCjX4WLVOaPawSgmV+VgOCmlqmASOUaXOo2OloxtFQq1wFN/0422tDgDyanRzkffvs/ rhR/xjSe/cTi0HzaeMLpuQBfgaGLOpzBiaekcnZfvLJRygBBO5kpFLScQfCnSkZpldFIYp 2vCY84qLHazGyghGks2BsfZ0Cld+3qxueV8r19QMBlUzuiP5HJqYbMBU73LC+py9q4JmJ2 g6HCXV5B2nN9xRdSCvR7T2ajGwmcqEOeJhATyuXA5+LGvle3IpcB24TdjEoS2g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1701222940; a=rsa-sha256; cv=none; b=Qi9zl19XPtia0WiGt+xCRTX1TCKhuZLvqwfcVi0vAhJjfs5UKo0PVyaRTIqyPbJf51oeht 91IOfuB1m9v+BQoZqYDMCx/4OVQFt0ZcashYCjdzvuYmWs6eVLlRoKRz1uXdVRt3DSBuVE TpELeJRtY0UI+7JUNLpaUi87Scc87jT4zwmR+To/8YX18IWLa9GjyxucuphnfZwZV7Xdqh M1rEcYt0Ec61n+Et2Ac+4p7AWTCppXS+lIxpH9ENa8VGzsJWXMLdkCcG/BfI94YBlbrPG3 l5sNfGJqLxVd8Lf5kvxvMzcevytoJj6OS9f+il/LcuvlXBsSP6dWjZfEpwHOcw== 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 4Sg2Tm49hbzmhg; Wed, 29 Nov 2023 01:55:40 +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 3AT1texv064606; Wed, 29 Nov 2023 01:55:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3AT1te7h064603; Wed, 29 Nov 2023 01:55:40 GMT (envelope-from git) Date: Wed, 29 Nov 2023 01:55:40 GMT Message-Id: <202311290155.3AT1te7h064603@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: 28a274342ea0 - main - mpi3mr: Add firmware version 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: 28a274342ea0b0666b56704477d2d1c17564942e Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=28a274342ea0b0666b56704477d2d1c17564942e commit 28a274342ea0b0666b56704477d2d1c17564942e Author: Warner Losh AuthorDate: 2023-11-29 01:50:10 +0000 Commit: Warner Losh CommitDate: 2023-11-29 01:50:10 +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 --- 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 35baa82fe487..5109b970b3bc 100644 --- a/sys/dev/mpi3mr/mpi3mr.c +++ b/sys/dev/mpi3mr/mpi3mr.c @@ -1564,6 +1564,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)) { @@ -1660,6 +1661,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, @@ -1675,7 +1682,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); @@ -2219,7 +2226,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: @@ -2235,9 +2241,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=("); @@ -2880,7 +2884,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 7df31cb15e3f..2af94123c090 100644 --- a/sys/dev/mpi3mr/mpi3mr.h +++ b/sys/dev/mpi3mr/mpi3mr.h @@ -555,8 +555,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");