From nobody Tue Feb 10 09:30:42 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 4f9GWk5xtVz6RlcM for ; Tue, 10 Feb 2026 09:30:42 +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 "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4f9GWk3fVSz3Crw for ; Tue, 10 Feb 2026 09:30:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1770715842; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UldjtbBu/w1WdE+ExDxsHGz9OY1tpINYhXlao+dSB28=; b=U4Lxg0oHHodaDO+OePbk8Uw3HlvbdhJcGpCyioV4ONIQfwEXEJlCHQzZzye2SH0wJtKL5d 3Oc/DyrFF5EGbt2aH7nCJq83eZ4cih1xiB3nOY9W+fL9OKs48eDfFRTkJTLMEdJEKp2ZDy N27n8gJnXFDkeQckuylwWJZ/XyFfVkputBBKc3hslcnnnzyer7NDmoJX+v7ncSRGYzJLq4 UCDjgH0aI/i5mMHkCNQhK8YHwBRC3Bov0Mtf16+yjO2qf5ABfZSu2izpiJGAoQHB/d5HTZ oadEqfKkVDWapcffq5h3OhTrH2J9YvEfc0oUYWHpK8wGe9gQS5I+PDyFK3fhjg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1770715842; a=rsa-sha256; cv=none; b=l8iFjWdq4YH+PcZQn3Gm30Xp/NHOqlufW089BhTsn8+NCnGZXdw1toRgwobOs0rBrbaNWU BsC5O/aYXa5yfLA4Hqk5gTLMQKeoyOoO4xCpBMwqCYfcA5NNlX6+tGGRIgCITUoF8s5hL2 3ekcGZhJcbY8PxDsNBeMzpV6EzBZyEYAYuHKnP+qOMYru+FxQImCMTZz1/CbVVBap62Wbp ZFC9DT7Ul+cX3blNwvQsfYK9yIjOMPSU4DTskFSuGE+Ov5JKKZm0Gd4uXSk/roUn6TyJw+ 2eZCh2wUYop41pxH9xhf+gSib+bVdUP8j8yObQ64RV3/IGb65Z6qIUI3sIkUoA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1770715842; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UldjtbBu/w1WdE+ExDxsHGz9OY1tpINYhXlao+dSB28=; b=U3Ym/of28PjkQrepJDGbGWYfyhDxDOQtfkI5DvUuiT1wX6FLVt2s4W2lSlcoOH3xrTuMkg AtwFK9CtWyy3YQ7f5VB/nEmHQaZLkdOptrRsHpTbHQLOcZZTdctb/ddYSCgQHC5FXi1qHV lzgLF+IwTCmy96QaCCuMbS3BbWoi3vj4CNwgaJlDMsmzepTG64fSenz9S5Hk2CirfoL5x9 G0XF2LzhQ2VZDRISL1Px7pqIh0z5jMHtVTvQWYn7wfA95Ac0j4U8bl9O6qkHCpSjU7GtCM iT5FO2RempRphu86A2HLP7uay5korukyGMtfl88/4o9O0DXFi4lz8iAYtT3SSQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4f9GWk30Bmz1CJf for ; Tue, 10 Feb 2026 09:30:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 19463 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 10 Feb 2026 09:30:42 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Chandrakanth Patil From: Sumit Saxena Subject: git: c2f799d4193f - main - iflib: Add support for SIOCGIFDOWNREASON ioctl 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ssaxena X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c2f799d4193f135f4d36e9f622b10b825b9144eb Auto-Submitted: auto-generated Date: Tue, 10 Feb 2026 09:30:42 +0000 Message-Id: <698afac2.19463.238207ee@gitrepo.freebsd.org> The branch main has been updated by ssaxena: URL: https://cgit.FreeBSD.org/src/commit/?id=c2f799d4193f135f4d36e9f622b10b825b9144eb commit c2f799d4193f135f4d36e9f622b10b825b9144eb Author: Chandrakanth Patil AuthorDate: 2026-01-30 07:15:55 +0000 Commit: Sumit Saxena CommitDate: 2026-02-10 09:30:06 +0000 iflib: Add support for SIOCGIFDOWNREASON ioctl This change adds native support for the SIOCGIFDOWNREASON ioctl in iflib. When ifconfig issues SIOCGIFDOWNREASON, the request is now routed through a new driver callback (IFDI_GET_DOWNREASON). iflib allocates the ifdownreason structure, calls the driver to fill the down-reason message, and then returns the data back to ifconfig for display. Without this change, iflib-based drivers cannot implement link-down reason reporting even if the hardware provides the information. No functional change for existing drivers unless they implement the new IFDI_GET_DOWNREASON method. Existing drivers continue to behave as before. Reviewed by: gallatin, erj, kgalazka, ssaxena, #iflib Differential Revision: https://reviews.freebsd.org/D54045 MFC After: 1 week --- sys/net/ifdi_if.m | 11 +++++++++++ sys/net/iflib.c | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/sys/net/ifdi_if.m b/sys/net/ifdi_if.m index f4a3db5092ab..cb24ba36ee60 100644 --- a/sys/net/ifdi_if.m +++ b/sys/net/ifdi_if.m @@ -117,6 +117,12 @@ CODE { { return (false); } + + static int + null_get_downreason(if_ctx_t _ctx __unused, struct ifdownreason *_ifdr __unused) + { + return (ENOTSUP); + } }; # @@ -364,3 +370,8 @@ METHOD bool needs_restart { if_ctx_t _ctx; enum iflib_restart_event _event; } DEFAULT null_needs_restart; + +METHOD int get_downreason { + if_ctx_t _ctx; + struct ifdownreason *_ifdr; +} DEFAULT null_get_downreason; diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 8e2fd257ca74..08282d1799b8 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -4540,6 +4540,11 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) err = IFDI_PRIV_IOCTL(ctx, command, data); CTX_UNLOCK(ctx); break; + case SIOCGIFDOWNREASON: + CTX_LOCK(ctx); + err = IFDI_GET_DOWNREASON(ctx, (struct ifdownreason *)data); + CTX_UNLOCK(ctx); + break; default: err = ether_ioctl(ifp, command, data); break;