From nobody Mon Dec 04 18:19:13 2023 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 4SkX4K6YB7z52f8W; Mon, 4 Dec 2023 18:19:13 +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 4SkX4K62B7z3R53; Mon, 4 Dec 2023 18:19:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701713953; 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=z+KFy1WRYlPhDXIREcNKHYPE0kPSolJBNoDkFHF2xxo=; b=AvJ4o+OaxiBH8Kry7lHcuV5KYop81SiigQpUw4B8MARVwnggBdQ/PzF1eZJAeTeO9DPa9l Jl310ZjoYBxsSnAEDmD0NzMNabuvWElqli7prFLROJYinjCYIyk+6PQsdws2bAijbuhVtf g9Iq9mtlZE40Im8LwP4p9qIGPP+/P3elwOwOCTOltmISvR4cseF0Ga8H5dgl+PJexkrHBI 2BI8x3XqLHh904vOpu7pex5Wh7NCeichJMUetSf01ikohciCN4YE3RQsHsK1L02ojDJnMG 3RDHk4cQCPKU3j+cGIXOGvyciEY5fozSDs4hlEOoaGzHcOOmZe2oQl8eugU45Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701713953; 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=z+KFy1WRYlPhDXIREcNKHYPE0kPSolJBNoDkFHF2xxo=; b=be+kqVPkhURvin9CFNAnSX2TSoQw8YDe1NslQMce3KIj6EnNDbGmqubPnIycefKXLNEVLV WA0QzqTK9ON51ZG46QgYJVrOYpKp5soa077sTkxq9w2BfXY50Oc/0D/E9xbn51PlWhguu6 Fz9DNH8YUS2mlYHZtLYumIF3H2VsEFJct7+uBJfu4Qw4uIpLee108e9c5OE5as+dyR8CMv vkX0sJ4E9JrKxZSsKxQy1/uL2foBlk12vtZ77s8Vhvui7/s/OCkyumPiHGZokNbxxcWQpk IxibHi/3H4zHGhsaevQ0as6tfzEQUs6Lq073m1Fr/VFjBbrpNcEtycWyd/IDmA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1701713953; a=rsa-sha256; cv=none; b=QCa0sFGV1p6AXhI6RfoBl10DJS2f3c4kj+s6HEjtVAvpq6fk/KOBy0eap25kDnonZl+3Uc PDboDOZzieQbTiSj8WBd5ZdzgeWFHCbmEozfe7p+joBAMGIDKy0+tRUJCuHhCKqe0r4T1g erKaRy+XYqqBUkG3ebJkDz68xPD0etvnb83OYAeMDtxtHS62g++/nWm1viNbaQ/zwPjKHO nZJIUwM40ddULgA7iXDM8/Z5mV9dPQDeydXHoatrXDRd4Y7cKeUpbrjgnpvzWM9FAVMvIG Z0x91nsmPjgZP4b65/sD+QdkV4M4tdmkp5Beg4kAu/ZVa3ItH/IDMrbr2CkucA== 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 4SkX4K54vSzcCg; Mon, 4 Dec 2023 18:19:13 +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 3B4IJDuK077661; Mon, 4 Dec 2023 18:19:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3B4IJD5i077658; Mon, 4 Dec 2023 18:19:13 GMT (envelope-from git) Date: Mon, 4 Dec 2023 18:19:13 GMT Message-Id: <202312041819.3B4IJD5i077658@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 5b0010b4678d - main - if_tuntap: fix NOIP build 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5b0010b4678d778967a5a82fb38507e46a071e38 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=5b0010b4678d778967a5a82fb38507e46a071e38 commit 5b0010b4678d778967a5a82fb38507e46a071e38 Author: Gleb Smirnoff AuthorDate: 2023-12-04 18:18:56 +0000 Commit: Gleb Smirnoff CommitDate: 2023-12-04 18:18:56 +0000 if_tuntap: fix NOIP build Note: this removes one TUNDEBUG() for the sake of not having one more ifdefed variable declaration and for the overall code brevity. The call from tuntap into LRO can be so easily traced with dtrace(1) that an 80-ish printf(9)-based debugging can be omitted. Fixes: 99c79cab422705f92f05a2924a29bdf823372ebf --- sys/net/if_tuntap.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/sys/net/if_tuntap.c b/sys/net/if_tuntap.c index 5a4231604f5a..fccc666e2a00 100644 --- a/sys/net/if_tuntap.c +++ b/sys/net/if_tuntap.c @@ -1178,13 +1178,13 @@ tundtor(void *data) if ((tp->tun_flags & TUN_VMNET) != 0 || (l2tun && (ifp->if_flags & IFF_LINK0) != 0)) goto out; - +#if defined(INET) || defined(INET6) if (l2tun && tp->tun_lro_ready) { TUNDEBUG (ifp, "LRO disabled\n"); tcp_lro_free(&tp->tun_lro); tp->tun_lro_ready = false; } - +#endif if (ifp->if_flags & IFF_UP) { TUN_UNLOCK(tp); if_down(ifp); @@ -1229,6 +1229,7 @@ tuninit(struct ifnet *ifp) getmicrotime(&ifp->if_lastchange); TUN_UNLOCK(tp); } else { +#if defined(INET) || defined(INET6) if (tcp_lro_init(&tp->tun_lro) == 0) { TUNDEBUG(ifp, "LRO enabled\n"); tp->tun_lro.ifp = ifp; @@ -1237,6 +1238,7 @@ tuninit(struct ifnet *ifp) TUNDEBUG(ifp, "Could not enable LRO\n"); tp->tun_lro_ready = false; } +#endif ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; TUN_UNLOCK(tp); /* attempt to start output */ @@ -1783,7 +1785,6 @@ tunwrite_l2(struct tuntap_softc *tp, struct mbuf *m, struct epoch_tracker et; struct ether_header *eh; struct ifnet *ifp; - int result; ifp = TUN2IFP(tp); @@ -1839,14 +1840,12 @@ tunwrite_l2(struct tuntap_softc *tp, struct mbuf *m, /* Pass packet up to parent. */ CURVNET_SET(ifp->if_vnet); NET_EPOCH_ENTER(et); - if (tp->tun_lro_ready && ifp->if_capenable & IFCAP_LRO) { - result = tcp_lro_rx(&tp->tun_lro, m, 0); - TUNDEBUG(ifp, "tcp_lro_rx() returned %d\n", result); - } else - result = TCP_LRO_CANNOT; - if (result == 0) +#if defined(INET) || defined(INET6) + if (tp->tun_lro_ready && ifp->if_capenable & IFCAP_LRO && + tcp_lro_rx(&tp->tun_lro, m, 0) == 0) tcp_lro_flush_all(&tp->tun_lro); else +#endif (*ifp->if_input)(ifp, m); NET_EPOCH_EXIT(et); CURVNET_RESTORE();