From nobody Fri Jan 12 17:08:28 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 4TBSfj2MxFz57BCn; Fri, 12 Jan 2024 17:08:29 +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 4TBSfj1qNqz4bCh; Fri, 12 Jan 2024 17:08:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705079309; 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=eEuicgCP+QqzsejWvj4aRVw2hgCpvTZ/iepLXuHsvMU=; b=fHUuZUzVNQEhetTPXiOyVRfzwrJLkT0+E8NEuTyr+Sduh3VwK3HG1OYaFYkb4rLk07yEMn UbiS2tuK5Pn9OHAdjT3VJp3GMonPl9ChdT6zO81iA27ycofZB8uroeTITKw4o6VKsmg9rB 6ruvvHcq63rMUXrjW6t19HF4M5vVu+S00AlS/UAABrqKI3s5f15T+OAV5XynurFv1prXVe 8MVD0AyiHgdetzKyHK4PHdZXm/igttppoxIBNrB2fq+9OQGTYeMt1GbaIknHN14p4FTLEC zCVygTjjMwXxjS4Z/ZbKZwu0Zcc2hzB14DkwnisrQuj5tQnYSDdIGUD2+CXYfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705079309; 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=eEuicgCP+QqzsejWvj4aRVw2hgCpvTZ/iepLXuHsvMU=; b=f38yh2mH058DlmyLnFYnr+j83Tpi2Y+OOAg5PcjJzSLjWVPz5GfIImZgl+Ki3qKaeZZ3xi odbtYGHtnDZ/l3UcBy8DFQiDWe/QukyiO8Gev8zSUfg+Dlza2SoSXf4hffRoH52JeMWZwM XEPYG7dQl23Nd4wmaQq6nHPa96DDAm/0Bnx4aLd8NVg9DUdCTg5M2eFGuZhBIEwMmMMFEX +epvCNGRugLzaDc3cl8WdpF+UBhe/kSLxyL9sFSLxn/r2purNc1w9jl5zQ3Lv/gUOFFuCV s9g+hdtPGupcVMjbrCdybvtwcdHG1kIu5b4IjnJ1oQijHoh9bsL4SXPS7DlDxA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705079309; a=rsa-sha256; cv=none; b=rJaBu75Fnu4Nx6qKNgP/fR9rmRMfoNvAhuRaEtpG0zJavbrc8Fsv/JvEMR2Yj+DaTV0TQM JZsOlzoddp4i+d6NmWzV4FEy1ZJR2sTTfWBTsvGb6WBhr36N+DaFOTFa5C8gn6AmxgL+0O eHoh2wTJajum6K5scuAgeXOUfX3BEDGL3swdvC+gPkdvYZ/+2kygWeebimXRwnIT9sy0VY rJj4z+Rs43dKdaU5fdxPSAzyH+03qMQA4xIIZ+XGN/5yLxJczZ3OTQYxd+4fzEjNwyJy0B A8dKKXKFtnCRWfcnrJX5GiZ86ZZET8AgFrAgAskv3N8U+bhK2YhiQVWZ3Pq9WQ== 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 4TBSfj0bmMz19G1; Fri, 12 Jan 2024 17:08:29 +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 40CH8S06015364; Fri, 12 Jan 2024 17:08:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CH8Stk015361; Fri, 12 Jan 2024 17:08:28 GMT (envelope-from git) Date: Fri, 12 Jan 2024 17:08:28 GMT Message-Id: <202401121708.40CH8Stk015361@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 0459cf327549 - stable/14 - if_tuntap: fix NOIP build 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: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0459cf327549f067ea1583a8d428e556232b6082 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=0459cf327549f067ea1583a8d428e556232b6082 commit 0459cf327549f067ea1583a8d428e556232b6082 Author: Gleb Smirnoff AuthorDate: 2023-12-04 18:18:56 +0000 Commit: Michael Tuexen CommitDate: 2024-01-12 17:05:12 +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 (cherry picked from commit 5b0010b4678d778967a5a82fb38507e46a071e38) --- 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 98c5044d6867..4cb219dc92b6 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();