From nobody Thu Oct 08 04:08:54 2026 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 4j0c1f3Jbcz6k296 for ; Thu, 08 Oct 2026 04:08:54 +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 4j0c1f2pPKz4V1t for ; Thu, 08 Oct 2026 04:08:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791432534; 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=Gm7WmIatuciOtTGw3lOF1EKh+XyoFvxhg8c0wEelp90UPnkdZ+6cOiufvzPeJb0vpjZegQ p7M9ZQ9/SK9DV5L0pPZZ5/zjLTIFB/rvDqUv1QYYy5dOhUhtdulQNDgqxI3i+TGCODjum4 Qs1EmHCMoOFE/YhCvp5TrHAAuoupwgk9JCQ3qeBKZ6fOHYhIPYNJ3ADTrICffEgNN5WqSb JzKgIoiTZeZlBxsLwB47SF/vur5e8WbaR+bJL3PsYtl3Za2rq+DMHzaHyPeEO8aCuW82hy XdqKQsPE4MXRwH9oo2GWnWk97hyhxrJ9WG/nYnQpIOp0hoiRZeOwDaD7F3RgTg== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1791432534; b=KCEvQlcvaxc3ay76cPY/vpjYZ7cbcej2cQHzbRIH4XkgCz15T3iqL94uiVztyoAUpOx7Z9 yyaFPITliCC6itYxlQB1f/WJgwmJuawfwWCztVs6SYkT5iFRSw+kJhog+efsQ2RmX2hnXt AT4dxgmq+ecXCzxd5oL+klOwn9GnwvCCjSHg27eOABz4VHMMlCuoxDh4eRqML5VBbHrVie q0MaPidVaXbTlMWAQMSc/gHfKjjOPS0Zs+g1VdMEeWOfPnEQLQFUxgrbiTiMbtQ4kX5H9w UJlaLAzU9CigcFxWHHiwFUcXLiWqJCTnTWs6LOCz8+JJ1AeFrgRtKeKQEDEngQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791432534; 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=v+dYl6TqIu4lV/lf/bDZ9ZV0lG5aesLUKNjvMiX2DcCAijZGpPC0Ayo0ed/5XHokNBOVYv R6UBw+8Aae0cE6f7XjcOWcPzSJ+fhwVQcDbWCIB6W8Z8Fzopn8gsei0HV226RoqAmmHo5x XrqwpnfxTy8gUtvTtifRzyxPS/emKp5uUCvDGAzTjRs4I8cw0JS7TAPu5z+spUpY1jTyL0 PJGaB1ZZ50kZn+eHhGlBCFhELCkAyOwkim7hPdrNZ4KYcFFkcJvtdFZEiDV3LdHXOMb7WU dPAtWSpaiNMvsA9GknMIRqG2QSFm/8swyJ+8MiTaXmsSnqn5NZ4rGELtNlkw8w== 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 4j0c1f1bzGzM6Q for ; Thu, 08 Oct 2026 04:08:54 +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 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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);