From nobody Wed Jun 26 10:01:24 2024 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 4W8HKK6XC3z5PTSM; Wed, 26 Jun 2024 10:01:25 +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 4W8HKK0l3Rz4N00; Wed, 26 Jun 2024 10:01:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719396085; 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=5gp678yIV1oB8u3o+7DtE1AQvaMA0TSHWLRomU5wNqc=; b=q43xqUZ8f1NlUXWcqFM9Jg8ZFlNKmtFTWdL956j+FyLzegV3lund1XLnPXMaXd3cp5ymtn sDlqxZ2oX+NU0b+EIcvDPPb7ze8SAOlmn2rn34552OOPJGcuvt4VTLXRoPbpmHw2YgtrOb nwzdRQw8AVXiSYVOUOMfgrAqODegsfBuCHyaTxQTxQtpiSjcee1xFZ0FYkjai/yNaCSYhe lX3jwcH7AAplI/69jgCjYNmxgyv4ZD+kqLN9P8U3dytJgC/KQEXK7OyZS1NJHVktWXD8YP WaE5oCXQpiIiRv/6ZQ0Osw1zXhrfWE4XRI45ycodP4MSW6zDCAYF5pWHSIsiAg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1719396085; a=rsa-sha256; cv=none; b=wNOq577JAyA4cxoHNIvt6o0ZI7VA3TDohBly4mSAcIXiauXk0axTetaOVW9J1Zf7M3NGwY 2Jhl5pwX62U9IKcJOnlCcnLMim/DWkAqrFUNmwOva8eIN11762BaU4GWK4lcxoLyx59zgY p3IJGWB+VlsDOyfkIz6rSEXGl9q55z4a/FiKGB6aOEUFVWkiT1wdxcEi5lvhGXwqTLyeCH hnRYLWRI43ZZBdxYEaQObS6oGEpnVGqHu54B3GwkcdK5rW8dc34bruFslVFrPA8hFKYoW3 RVNprK7rldSQqzY75lkFc3eJpyOOuCB6hTPqMemWzeCUt/Su4YzHIVz531rxkQ== 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=1719396085; 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=5gp678yIV1oB8u3o+7DtE1AQvaMA0TSHWLRomU5wNqc=; b=OEsRRxbnnu0mh0Om3NEZzt6phiGIUtDRMga5ZdRNfY3H/cRM1zKgp4Hz6LkLk79m0uAfPJ ZFBHYKyBZerXM6YK1lnlXyZBF2YzAYp/v/YsdQOLu9G47QurhKM+GcROemoqUufvx/020B PoDkkAE1nrCf0rIG3ZAXlw1qu+1+4LEU3wFZ3W6sL0i2EXmGienHzGbyAOyT76C7J+jQzg jtAs9DsFr8WrheD/BjCdaxVy3eb14s3UOXso9UV2gSwy3n2A4FdA3f/E/jC0aHlOX/pi8W hRu6Wql52tATcLJY691F59SzF2xK1TXYAky0fHjhpAOqaiqWa4y1aFIYZWZHFw== 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 4W8HKK0Ltbzh8q; Wed, 26 Jun 2024 10:01:25 +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 45QA1Oo5090774; Wed, 26 Jun 2024 10:01:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45QA1OgO090771; Wed, 26 Jun 2024 10:01:24 GMT (envelope-from git) Date: Wed, 26 Jun 2024 10:01:24 GMT Message-Id: <202406261001.45QA1OgO090771@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 2cb7605a2415 - main - lo: Use new KPI to create the first loop interface 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: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2cb7605a2415a1c0dd35374a88f815ef00e31de9 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=2cb7605a2415a1c0dd35374a88f815ef00e31de9 commit 2cb7605a2415a1c0dd35374a88f815ef00e31de9 Author: Zhenlei Huang AuthorDate: 2024-06-26 10:00:37 +0000 Commit: Zhenlei Huang CommitDate: 2024-06-26 10:00:37 +0000 lo: Use new KPI to create the first loop interface While here remove a pointless static local variable lo_cloner. No functional change intended. Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45728 --- sys/net/if_loop.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c index c5be3d17f447..926d264073ec 100644 --- a/sys/net/if_loop.c +++ b/sys/net/if_loop.c @@ -93,13 +93,9 @@ static int looutput(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, struct route *ro); VNET_DEFINE(struct ifnet *, loif); /* Used externally */ - -#ifdef VIMAGE VNET_DEFINE_STATIC(struct if_clone *, lo_cloner); #define V_lo_cloner VNET(lo_cloner) -#endif -static struct if_clone *lo_cloner; static const char loname[] = "lo"; static int @@ -141,8 +137,6 @@ lo_clone_create(struct if_clone *ifc, char *name, size_t len, ifp->if_hwassist = LO_CSUM_FEATURES | LO_CSUM_FEATURES6; if_attach(ifp); bpfattach(ifp, DLT_NULL, sizeof(u_int32_t)); - if (V_loif == NULL) - V_loif = ifp; *ifpp = ifp; return (0); @@ -156,12 +150,9 @@ vnet_loif_init(const void *unused __unused) .destroy_f = lo_clone_destroy, .flags = IFC_F_AUTOUNIT, }; - lo_cloner = ifc_attach_cloner(loname, &req); -#ifdef VIMAGE - V_lo_cloner = lo_cloner; -#endif + V_lo_cloner = ifc_attach_cloner(loname, &req); struct ifc_data ifd = { .unit = 0 }; - ifc_create_ifp(loname, &ifd, NULL); + ifc_create_ifp(loname, &ifd, &V_loif); } VNET_SYSINIT(vnet_loif_init, SI_SUB_PSEUDO, SI_ORDER_ANY, vnet_loif_init, NULL);