From nobody Thu Oct 08 04:08:54 2026 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 4j0c1l5sm2z6k2J2 for ; Thu, 08 Oct 2026 04:08:59 +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 "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4j0c1l49t8z4VHx for ; Thu, 08 Oct 2026 04:08:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791432539; 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=jJpUlR+pbnCFkAyursb6kqXGLa8do+ibdu8C3MAmfWM=; b=hSwvcOHnHwsJ+ShlTtILlgGVYH8ysTjRPDglbxX1TZnfwKOD6+yh1e+JHMUqN83HmASTe4 +gCJgcH1Z/QfILPB5flGNvWxGbJdEFSI9cAUHjfSDjbkODk0YiJbom0RoTwY6AogCCV6ZZ qBvr59dtttPgvvS5hjGy/xHL+sn8RiZIqVCLFeB0yTdXniiRIjjVRVDVPqJQO+JazWn+q3 MzWdLjx/jq5Lp10sakdlvvXncX+rSjBKoTJBWdefYKyqI59HKS/5NN8OpxuL1cJPXaZSqW aMlkXTmnHxGsh671JYCjLO8OkzvrJdJPZQ7xtxYUM357Chpt/9FX3rDphM6qfQ== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1791432539; b=M7RyO9PmkveXBxvvhWCkw4wJ4a9G8ckSYWWdVndHnafanWS+Z0G5smeqI11+NNXRwlWB86 V92laV14QW77tUpboX8ZBNNmBwKG9x+01fUJ5d8aY7+gMI0h2T9HtAKzuoViEpyJO/KY/q RllUo0rTtSDaG2ikOElA/cp33PXgAkXsDYthA6BpMb0huz4ic8B2d7g70T0kokHNiQBKF4 eJ+RtyUCAa7Qy7ukefzQW6KaK237Dsjg6/gzZ2IWEzzkOo5fPWgan9uWMWgRbRROtPmkQm vfqJxStrfqUsq7nce9YWY7znRAAL3hZdRNXMMhwgyr5yI55vTDNIeHt3+iQryg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791432539; 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=jJpUlR+pbnCFkAyursb6kqXGLa8do+ibdu8C3MAmfWM=; b=nuHVxNZceUyKaW9GvIipaCyXtyX7RZVN8mTQCATT38EBBNLFeQSETZ8fvh322PCWLrwSSQ ZNh2VF7r+oU9EQRWCGnSDrMjGmClXRofpipMB7cCRxwq3PhA8KQKocb0bjAH7ZC9weZY2a CSIHnbu/okbh8ac3/Tf5bQV3wXKeaH/+CMYt0ipNHncEBSciNc02zX7W8DFRMXzsIi1S/7 hEVWsWqmbgZXB0OAGR34/Ik8/fzMWiKEWBSFDW04ZLGL39SAM6w+zBIV+8EtJFCrQWw4K7 Z9PxoPAOnyEzeGSMgq7OmLECTN+XGz/TNjdS/IH1B2izGZM24hJioiMl/mpbjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4j0c1l3GZBzMgk for ; Thu, 08 Oct 2026 04:08:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 36853 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 08 Oct 2026 04:08:54 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ravi Pokala Subject: git: bf97446e34ab - main - ipmi(4): improve debugging for ioctl(IPMICTL_SEND_COMMAND) 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rpokala X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bf97446e34abfe096d91d8c2bd49ea9a50d2227d Auto-Submitted: auto-generated Date: Thu, 08 Oct 2026 04:08:54 +0000 Message-Id: <6ac71756.36853.6161b320@gitrepo.freebsd.org> The branch main has been updated by rpokala: URL: https://cgit.FreeBSD.org/src/commit/?id=bf97446e34abfe096d91d8c2bd49ea9a50d2227d commit bf97446e34abfe096d91d8c2bd49ea9a50d2227d Author: Ravi Pokala AuthorDate: 2026-10-08 04:01:12 +0000 Commit: Ravi Pokala CommitDate: 2026-10-08 04:08:22 +0000 ipmi(4): improve debugging for ioctl(IPMICTL_SEND_COMMAND) Add a knob to debug ioctl(IPMICTL_SEND_COMMAND). Log the IPMI NetFn and Cmd fields, followed by a hexdump of the request data. Upon completion, log the hexdump of the response data. Reviewed by: adrian, imp, ngie Sponsored by: Vdura Differential Revision: https://reviews.freebsd.org/D59514 --- share/man/man4/ipmi.4 | 34 +++++++++++++++++++++++++++++++++- sys/dev/ipmi/ipmi.c | 18 ++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/share/man/man4/ipmi.4 b/share/man/man4/ipmi.4 index 0d2e32c01470..eb32edc8b6dd 100644 --- a/share/man/man4/ipmi.4 +++ b/share/man/man4/ipmi.4 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 25, 2017 +.Dd October 8, 2026 .Dt IPMI 4 .Os .Sh NAME @@ -99,6 +99,38 @@ power cycle subcomand of the chassis control command as described in section 28. of the IPMI standard. The length of time the system is off will be at least one second, but may be longer if the power cycle interval has been set (see section 28.9). +.Sh SYSCTL VARIABLES +The following +.Xr sysctl 8 +variables are available: +.Bl -tag -width indent +.It Va hw.ipmi.cycle_wait +If an IPMI power-cycle reboot hook is configured, wait this long for +power-down. (sec) +.It Va hw.ipmi.hexdump_send +When sending commands to the BMC, log the NetFn and Cmd, and the data sent +to and received from the BMC. +.It Va hw.ipmi.wd_init_enable +Initialize the BMC watchdog during IPMI driver attachment. +.It Va hw.ipmi.wd_pretimeout_countdown +Trigger an interrupt before the BMC watchdog resets the system. (sec) +.It Va hw.ipmi.wd_shutdown_countdown +Set the BMC watchdog timer and countdown from here. (sec) +.It Va hw.ipmi.wd_startup_countdown +Initial BMC watchdog counter starting value. (sec) +.It Va hw.ipmi.wd_timer_actions +What action to take when the BMC watchdog timer expires: +.Bl -tag -offset indent -compact -width 0x0 +.It 0 +NONE +.It 1 +RESET +.It 2 +POWER_DOWN +.It 3 +POWER_CYCLE +.El +.El .Sh IOCTLS Sending and receiving messages through the .Nm diff --git a/sys/dev/ipmi/ipmi.c b/sys/dev/ipmi/ipmi.c index 5f759017441c..abc432f1520e 100644 --- a/sys/dev/ipmi/ipmi.c +++ b/sys/dev/ipmi/ipmi.c @@ -89,6 +89,9 @@ static int wd_pretimeout_countdown = 120; /* sec */ static int cycle_wait = 10; /* sec */ static int wd_init_enable = 1; +/* Log IPMICTL_SEND_COMMAND transactions */ +static int hexdump_send = 0; + static SYSCTL_NODE(_hw, OID_AUTO, ipmi, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "IPMI driver parameters"); SYSCTL_INT(_hw_ipmi, OID_AUTO, on, CTLFLAG_RWTUN, @@ -110,6 +113,9 @@ SYSCTL_INT(_hw_ipmi, OID_AUTO, wd_pretimeout_countdown, CTLFLAG_RWTUN, SYSCTL_INT(_hw_ipmi, OID_AUTO, cycle_wait, CTLFLAG_RWTUN, &cycle_wait, 0, "IPMI power cycle on reboot delay time (seconds)"); +SYSCTL_INT(_hw_ipmi, OID_AUTO, hexdump_send, CTLFLAG_RWTUN, + &hexdump_send, 0, + "IPMI driver hexdump IPMICTL_SEND_COMMAND"); static struct cdevsw ipmi_cdevsw = { .d_version = D_VERSION, @@ -327,6 +333,12 @@ ipmi_ioctl(struct cdev *cdev, u_long cmd, caddr_t data, ipmi_free_request(kreq); return (error); } + if (hexdump_send) { + printf("IPMI_REQ_MSG: netfn=%02x cmd=%02x\n", + req->msg.netfn, req->msg.cmd); + hexdump(kreq->ir_request, req->msg.data_len, + "SEND_COMMAND ->\n", 0); + } IPMI_LOCK(sc); dev->ipmi_requests++; error = sc->ipmi_enqueue_request(sc, kreq); @@ -442,6 +454,12 @@ ipmi_ioctl(struct cdev *cdev, u_long cmd, caddr_t data, if (error == 0) error = copyout(kreq->ir_reply, recv->msg.data + 1, len - 1); + if (hexdump_send) { + printf("IPMI_RECV_MSG: netfn=%02x cmd=%02x\n", + recv->msg.netfn, recv->msg.cmd); + hexdump(kreq->ir_reply, len - 1, + "RECEIVE_MSG <-\n", 0); + } ipmi_free_request(kreq); if (error) return (error);