From nobody Sat Sep 27 15:13:57 2025 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 4cYrZY6sbtz68Dc8; Sat, 27 Sep 2025 15:13:57 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cYrZY1g27z44Cp; Sat, 27 Sep 2025 15:13:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1758986037; 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=GRyv2F6jP5E4Leo8RSVCV+oCP3XnY+JnrtExC5gUHE4=; b=tzuPtJse8bIH7JMyRiTaGCvue0XSC1iDZDBlR0J5/ryn8TvSttGMLyXigs8ZXi89Dvp8os LdEdK6wr9/wXeC+PQNixmu4Gn2uRgdPIsDR/lS17qyRW3VoBpyUv2E7O4lUmojfct7vowR ZYZYl0vSOeRRYyDTR0huBb32Akp+ceY/v2pSplbuh2vxCuKAV0GJVQckyLh1Lmd8SJ567J 8mJqibvOzqS79SwJvdVsZq9vkViVnyOn+cFmu/v+1MOH2HOk9Q5t8wfgFDEpOF2jnzza4X 0/2EhB7snEDP4tylCDVfhQy9r1VGeZsO26NLMv9M25PM0H8WpmNAugsfVjPURw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1758986037; 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=GRyv2F6jP5E4Leo8RSVCV+oCP3XnY+JnrtExC5gUHE4=; b=VgB2eblbuI70kjVjXqS75S4pvgff7vFMzQU1Spf1y/6+Q/r41v8f7YUXU50FUauCB4ubk4 MiKcO7bwW1a799LqaM16Ls4yC2nuHykfQYzspFPvs+3ITCvrHMs3XfxZ3ludbfErJf6zXD G6OoaZ9m9N/Y0gLj7Jxic4ROTNOAIHP3OY694f3iDqDyLI5GNOQizqPlcatgrn71CNnOuk /PaK+gyihJQUCFlKOfU6BU//cYTUcxH5QvvJJmacQtln2onEKO4/vGIMe3pOorIt8e1mrW zJEV0mv4+k7v4doZak8g9v0DPXLSxfSRZ+Aq5rMVJGyxcmrAxbCWDXltjHdFjw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1758986037; a=rsa-sha256; cv=none; b=h+FP8u0kX/bMU9TAER3EVajUAJG4z0buLDk2v8DhmhOxtHhyBpR1ih3phOPlyo4HZ2fvyA XnY9N6ZkTh3rSKb2eRkpw0lcfc8KyU2Xw3Zr9XAPJwNFeRWXmZLXpT5RJlBahgnrwQaA+k R+e5gyNUxo4XoFgPrsHawUa2ONxiZoC+8NsTS4EGFaEXAhFI47tb66WOddvwPqtuA0BUT1 yEfd+pV5ViNxx6UFSsNpsJ7QVfXnkKVe2rJh/CuFHMqr9xX6GnxsGasDY9ra9ZSJaHPhWo k/tVg57HcnGZiPXQXurZOeWOmQPplh1+OQ+5bKaNwK8QrPgzLEUpmqcQueEauA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4cYrZY1DH6zfy9; Sat, 27 Sep 2025 15:13:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 58RFDv2k083133; Sat, 27 Sep 2025 15:13:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58RFDv38083127; Sat, 27 Sep 2025 15:13:57 GMT (envelope-from git) Date: Sat, 27 Sep 2025 15:13:57 GMT Message-Id: <202509271513.58RFDv38083127@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 04741ceafa2c - stable/14 - iflib: Set the get counter routine prior to attaching the interface 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 04741ceafa2c14b6352626e66b99d023a65be006 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=04741ceafa2c14b6352626e66b99d023a65be006 commit 04741ceafa2c14b6352626e66b99d023a65be006 Author: Zhenlei Huang AuthorDate: 2025-08-30 15:23:51 +0000 Commit: Zhenlei Huang CommitDate: 2025-09-27 15:11:36 +0000 iflib: Set the get counter routine prior to attaching the interface This ensures other threads, e.g. ioctl threads, see the correct counter routine once after the interface has been attached. This change partially reverts commit 23ac9029f96b, which for unclear reason moved setting the get counter routine after ether_ifattach(). Reviewed by: kbowling, kgalazka, #iflib Fixes: 23ac9029f96b Update iflib to support more NIC designs MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D50712 (cherry picked from commit ae7f8da8bf6ed0c4f0e9f0e95ae2b08abce54378) --- sys/net/iflib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 1113a5e8e9f4..65d383e2d51e 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -5431,7 +5431,6 @@ iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ct DEBUGNET_SET(ctx->ifc_ifp, iflib); - if_setgetcounterfn(ctx->ifc_ifp, iflib_if_get_counter); iflib_add_device_sysctl_post(ctx); iflib_add_pfil(ctx); ctx->ifc_flags |= IFC_INIT_DONE; @@ -5785,6 +5784,7 @@ iflib_register(if_ctx_t ctx) if_settransmitfn(ifp, iflib_if_transmit); #endif if_setqflushfn(ifp, iflib_if_qflush); + if_setgetcounterfn(ifp, iflib_if_get_counter); if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); ctx->ifc_vlan_attach_event = EVENTHANDLER_REGISTER(vlan_config, iflib_vlan_register, ctx,