From nobody Mon Apr 10 04:16:45 2023 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 4Pvwf66Jj5z44kWQ; Mon, 10 Apr 2023 04:16:46 +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 4Pvwf60Ksqz4MdP; Mon, 10 Apr 2023 04:16:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681100206; 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=wHP29XErVEztMMQPYI3+poAQCUc1xVf7flUqu2NBF1o=; b=uppAW8vVOX1yYQALV7ChdSLJ1UDiAxe6WHzAQSMucU0bxs/2oCZrkSBxJA2bF/zMut1a7D rUtNT4oT786OCOhGOIOIk9nTkoQfOdMTGqcV+VJGrsc3a9YnjZqsQqhrhlu+mZPUmvZQtr F+Vh2jNgsqJC6WXEe32/7UoaiB6Sz4eRBiPj1myDzEPeVVrW2ucdLCZU2g44vk3iS/+T+T zcuCTV1cLr6vmDrXCZ40MRcTy4zmibbbqwUp0RbHJMsUn9II7drCSn+IZc85T7M3vsWEDM RqtB5eXRkvUjvqSvKHvZxw/Nrmkdwd0UFpJqmWqkuP6aknjZaC7VWoYap0bcRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681100206; 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=wHP29XErVEztMMQPYI3+poAQCUc1xVf7flUqu2NBF1o=; b=KKejKsn86K62sw2gzqTmD+iSL4UecC5BRkYbMeLkyX3CFqb2EGvzKuJ8zsrwRk3ESPRAIR nmuBIOBbv1IkccjvknYJil6wMyjgjNg65OqSU3a/DrTJuLZhbCwYAHS6xxOxvJLqujcr3F P4RXwloE+AgQm9wE4OPeFMLln+B+xwB6fCJlxYLktPm+0v6z4zXBIrzDDxVxtDb4GCS2D2 fUNttbxL5PCZZVhmepQVuXTQ8BQ+ui2hLLz7aYKEI1e+oLoFmLtig8+a1YLvRXPxs8o+TH 9+rqp1Hd0SrY2ydC7ez1llySMqJ0J+P83T/94zExAknRSVCmNqE5VR6bdOeXNw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1681100206; a=rsa-sha256; cv=none; b=a5Ek5gLf+9jZs7GjpH74+yNH7AQ11C3dkDLBay2GkqiXEl+ZNGcUdg/tIe1g4U9NnvD5Ck Jj84Fc507cNuL3I/OnjJwbNh81+aBHGAghm105PBXIq7uF+Y98h76l4k934sPH/6/8eBg8 ppQizsG2CxF5tabz0Tc8F+fpzL4StKE43NitHM3SvC6EXpwax7fA8v2pKINiLO0mP6mjTd U0QQ8RPSe4WKXKLHLmH6Mziisrf+o63uDVfr4oKN/5XyXcGn8Jb+ZEU3rTts4vKWLDCRt/ pRwLyfXI0KD3aQeYJnDPzweT0SipftoGK26RBfl0q5O4iPM2awdnXT41fJ+hig== 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 4Pvwf56JBmzbpx; Mon, 10 Apr 2023 04:16:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 33A4GjDs039582; Mon, 10 Apr 2023 04:16:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33A4GjOW039581; Mon, 10 Apr 2023 04:16:45 GMT (envelope-from git) Date: Mon, 10 Apr 2023 04:16:45 GMT Message-Id: <202304100416.33A4GjOW039581@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: 758fea562555 - stable/13 - lagg(4): Do not enter net epoch recursively 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 758fea562555ab90979b4bd269aa2cd084de63bb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=758fea562555ab90979b4bd269aa2cd084de63bb commit 758fea562555ab90979b4bd269aa2cd084de63bb Author: Zhenlei Huang AuthorDate: 2023-03-29 16:25:16 +0000 Commit: Zhenlei Huang CommitDate: 2023-04-10 04:15:04 +0000 lagg(4): Do not enter net epoch recursively This saves a little resources. No functional change intended. Reviewed by: kp Fixes: b8a6e03fac92 Widen NET_EPOCH coverage MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D39267 (cherry picked from commit d4a80d21b3d32a2de02d1820cc1f38dba1f127cb) --- sys/net/if_lagg.c | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c index e282fde66013..8a62286db81b 100644 --- a/sys/net/if_lagg.c +++ b/sys/net/if_lagg.c @@ -2006,18 +2006,15 @@ lagg_setflags(struct lagg_port *lp, int status) static int lagg_transmit_ethernet(struct ifnet *ifp, struct mbuf *m) { - struct epoch_tracker et; struct lagg_softc *sc = (struct lagg_softc *)ifp->if_softc; - int error; + NET_EPOCH_ASSERT(); #if defined(KERN_TLS) || defined(RATELIMIT) if (m->m_pkthdr.csum_flags & CSUM_SND_TAG) MPASS(m->m_pkthdr.snd_tag->ifp == ifp); #endif - NET_EPOCH_ENTER(et); /* We need a Tx algorithm and at least one port */ if (sc->sc_proto == LAGG_PROTO_NONE || sc->sc_count == 0) { - NET_EPOCH_EXIT(et); m_freem(m); if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); return (ENXIO); @@ -2025,26 +2022,21 @@ lagg_transmit_ethernet(struct ifnet *ifp, struct mbuf *m) ETHER_BPF_MTAP(ifp, m); - error = lagg_proto_start(sc, m); - NET_EPOCH_EXIT(et); - return (error); + return (lagg_proto_start(sc, m)); } static int lagg_transmit_infiniband(struct ifnet *ifp, struct mbuf *m) { - struct epoch_tracker et; struct lagg_softc *sc = (struct lagg_softc *)ifp->if_softc; - int error; + NET_EPOCH_ASSERT(); #if defined(KERN_TLS) || defined(RATELIMIT) if (m->m_pkthdr.csum_flags & CSUM_SND_TAG) MPASS(m->m_pkthdr.snd_tag->ifp == ifp); #endif - NET_EPOCH_ENTER(et); /* We need a Tx algorithm and at least one port */ if (sc->sc_proto == LAGG_PROTO_NONE || sc->sc_count == 0) { - NET_EPOCH_EXIT(et); m_freem(m); if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); return (ENXIO); @@ -2052,9 +2044,7 @@ lagg_transmit_infiniband(struct ifnet *ifp, struct mbuf *m) INFINIBAND_BPF_MTAP(ifp, m); - error = lagg_proto_start(sc, m); - NET_EPOCH_EXIT(et); - return (error); + return (lagg_proto_start(sc, m)); } /* @@ -2068,16 +2058,14 @@ lagg_qflush(struct ifnet *ifp __unused) static struct mbuf * lagg_input_ethernet(struct ifnet *ifp, struct mbuf *m) { - struct epoch_tracker et; struct lagg_port *lp = ifp->if_lagg; struct lagg_softc *sc = lp->lp_softc; struct ifnet *scifp = sc->sc_ifp; - NET_EPOCH_ENTER(et); + NET_EPOCH_ASSERT(); if ((scifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || lp->lp_detaching != 0 || sc->sc_proto == LAGG_PROTO_NONE) { - NET_EPOCH_EXIT(et); m_freem(m); return (NULL); } @@ -2090,7 +2078,6 @@ lagg_input_ethernet(struct ifnet *ifp, struct mbuf *m) m = NULL; } - NET_EPOCH_EXIT(et); return (m); }