From nobody Fri Jul 5 15:14:26 2024 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 4WFxrM00kvz5PgF3; Fri, 05 Jul 2024 15:14:27 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WFxrL4cKTz4GmV; Fri, 5 Jul 2024 15:14:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720192466; 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=B+2uG3H2CadRQvdamAT31QvwQq4UOyBosdsSmrod2nA=; b=Jb4bfaO1/AeDCeOLeunX9mMcs8HqjjkZBSF6mEo6d+g8QyBVEsEWDv4IzWoR+XBDMUER4w FL5InMn1OEjJI4t4mfr1K/RRDIGFjNoVO+hozzYDjyYIqcZ1ZRq1RwESAPR2erfzHqikGV qvYqlpFbLZIgGwm2WQR4E/7VlpbL6UWbk8mIPnm3yYdI1x0751Kk3ElSEdfOBfp2KjdW/F 1LRa+uwgp1RJ+A05BTGM4aOBD0+jVS0wH+uRezDScpIGrZD/5gOwAXq6WpfHffTqu4h1XO d0+tbG5ty3hjaHV6ACBzhjsoTmVLjYjOuAm7FawOIajkhhnsOXeyuXJn2ey7uA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720192466; a=rsa-sha256; cv=none; b=AD5wRddDnUCaAHOXfjA5F0UcmMR4dKj+kF4kEASEMOdbZhXAm83u3uu9S9DstyAX5XhZfL Yyqcgkdev+rbsMkcnLGS6aBOJGzR8vEdg3WCyDRhmywCqVXHzI47lffkTOdixT/42EVyZh kLc71TGx/U6sjrFCx19M+kLSimZdHmmgpQUwKjdwXvjdRrFi0ffmU5MrzQN1fCV1wRuOzJ XUI/cXaPvNwmFa3Vty80x2OCrVgIRfScy1XKhzLdew7LsWkqaBHH2QSuIbQswZD+ZuXQLQ VO/3C3rDj7exRMSpZ0wE0bO+iE1UI4RJHtFSheZBcG3V+XS30kTRSWrdCIU6Rw== 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=1720192466; 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=B+2uG3H2CadRQvdamAT31QvwQq4UOyBosdsSmrod2nA=; b=rShQ7Uvh4uFuIoOdF78f3faOdnGh78NIQkCdr57dlsga7PldWa7fq2tutAlDbmnfeOW04M Pvuti6WUwQs01LhsdFspDGPKrJCvPSUONxIKRR2EX4FZFp6P63pksNr+6NZsK3e0ZVjhga uVblNtD/GoeAYMqokBDbv0bUGo63cHwrymTwVbecgbLgpKogC/9M8m6K8SIeu7Y3pCnI34 puN70QlhzcbtmWnXVbHhvUviF9ZxMR8Oed3mZJWT32acznMhBej1lwOTua0k6hzOs2Uoo7 r3Jui0QfClPzgg7QuQXp/LjYotiSRwGjzNBJilssubKhMvbavtgogtW8xGsgGw== 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 4WFxrL48Dxz11d4; Fri, 5 Jul 2024 15:14:26 +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 465FEQo3099047; Fri, 5 Jul 2024 15:14:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 465FEQmp099044; Fri, 5 Jul 2024 15:14:26 GMT (envelope-from git) Date: Fri, 5 Jul 2024 15:14:26 GMT Message-Id: <202407051514.465FEQmp099044@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: 4a253ccbe813 - stable/14 - lo: Use new KPI to assign the first loop 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: 4a253ccbe8135afdbb5c6552e140aab6eae35ef9 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=4a253ccbe8135afdbb5c6552e140aab6eae35ef9 commit 4a253ccbe8135afdbb5c6552e140aab6eae35ef9 Author: Zhenlei Huang AuthorDate: 2024-06-26 10:00:37 +0000 Commit: Zhenlei Huang CommitDate: 2024-07-05 15:11:51 +0000 lo: Use new KPI to assign 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 (cherry picked from commit 2cb7605a2415a1c0dd35374a88f815ef00e31de9) --- 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 e135acef18bb..5558fe5a71ab 100644 --- a/sys/net/if_loop.c +++ b/sys/net/if_loop.c @@ -95,13 +95,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 @@ -143,8 +139,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); @@ -158,12 +152,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);