From nobody Tue Dec 31 16:25:10 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 4YMyxM1L2Kz5jjP9; Tue, 31 Dec 2024 16:25:11 +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 4YMyxL4wKCz4XyD; Tue, 31 Dec 2024 16:25:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1735662310; 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=Gaty92ktzUwaJcLMWSToDBjJpDI0sbpbwLPsIVYA+n8=; b=Ic3bYy1Ib0yn257yamUzW6UkBWDXPUOu24julcwOwO/31/psfB6T1i9FvaBE8oJflAuuqm b2+KBe1qbcArx03vnvPYzm9uUwBBB2YotPB8JaXXuJ0Uan5M7bjIf7ex0xwZM3ysXapkuy DGwlL5sMK/65T6V0YXZAe8HHLZLpRV0RtjKzaQ9dtZri/kpDyPwXDU0LvxWxdM5FHtuWLu toE8o0OZPz5lIDghceZzEyqfRMQJOewLN77zVJaxOWb06OI0nKaDXnKlaMFKA88F3YjQ8A 26JuNHABv08BEYiNJ9eAyvG4V1Rz0NzM9wO+UsoldKXU3q28hmTjtRhqnaCauA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1735662310; 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=Gaty92ktzUwaJcLMWSToDBjJpDI0sbpbwLPsIVYA+n8=; b=BmQEtSa90aigoc1iKl63t+PZKt8UMIuhRyS9mobfNQN50bf3ajYRv0sIfuXCvhbQIVY4FJ pmTnZGEkHhTYBflL8BgIY4eUeV/nkhEl+TZ0xf4ZSoTOOLdX2d+jq4DnFgatE925YqNEWL ECqgeRZTDmuhhBilmHA+lz9sGP1gvoa9OenHp1G6F0s4CFiQJqc+cfMQ6ngQjh02Kw8S4L 3lRjSCpLtpHoAv6HkorUQ6vVjMlENkamEJeRhKRccq+kesKx4aehlk5a0ACjowHEUse1Mx mrrFPZLqDM8oBg3pDsRw55PaAX5au7pE7UuEznTo7kGsn2LhSrUXekwPvnndWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1735662310; a=rsa-sha256; cv=none; b=ajxNLZG/PbosuZoFBeajU6zEcHLmL6n3tW+np4IXZ5n5yZ18RButxBtgcmJY/7QcMhwaot MbZ2ggTKO4adL0+9JCB8oMq7ct1AYgInYuJKfdP6Y+uBIZRiV8b6bUscef2Eu1GGw5InKf aCShzr84twmx8FudewJ82qT0UwHaKhNKiC8+X3tfhYxHdScXVMyi8QWp5xjZTfNjGYp0D2 G91EwDXrrE5oCoO8KoG22uvSA/UNt5xjWYYRuWqX1wHj4yU1FqGbH+SXMCxAHvHZ74KYnq jN2W3USOqRf1FejhaF7E7m/knkVocl58NWNIwjmKjD7BfbWnRtDPRcm+nKVneA== 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 4YMyxL4XFCznKL; Tue, 31 Dec 2024 16:25:10 +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 4BVGPAJF040649; Tue, 31 Dec 2024 16:25:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BVGPAAf040646; Tue, 31 Dec 2024 16:25:10 GMT (envelope-from git) Date: Tue, 31 Dec 2024 16:25:10 GMT Message-Id: <202412311625.4BVGPAAf040646@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 4940584bbf0b - main - TCP RACK, BBR: cleanup of ctf_process_inbound_raw() 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: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4940584bbf0b809130f6ac1a7a0c6b00d373af1e Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=4940584bbf0b809130f6ac1a7a0c6b00d373af1e commit 4940584bbf0b809130f6ac1a7a0c6b00d373af1e Author: Michael Tuexen AuthorDate: 2024-12-31 16:22:03 +0000 Commit: Michael Tuexen CommitDate: 2024-12-31 16:22:03 +0000 TCP RACK, BBR: cleanup of ctf_process_inbound_raw() Instead of dealing with ifp == NULL, which should never happen, assume that this is not true. Use KASSERT to make this clear. No functional change intended. Reviewed by: glebius, rrs CID: 1523767 MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48258 --- sys/netinet/tcp_stacks/rack_bbr_common.c | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/sys/netinet/tcp_stacks/rack_bbr_common.c b/sys/netinet/tcp_stacks/rack_bbr_common.c index 156091feeb30..da26b8cb1f9b 100644 --- a/sys/netinet/tcp_stacks/rack_bbr_common.c +++ b/sys/netinet/tcp_stacks/rack_bbr_common.c @@ -361,26 +361,15 @@ ctf_process_inbound_raw(struct tcpcb *tp, struct mbuf *m, int has_pkt) int32_t retval, nxt_pkt, tlen, off; int etype = 0; uint16_t drop_hdrlen; - uint8_t iptos, no_vn=0; + uint8_t iptos; inp = tptoinpcb(tp); INP_WLOCK_ASSERT(inp); NET_EPOCH_ASSERT(); - - if (m) - ifp = m_rcvif(m); - else - ifp = NULL; - if (ifp == NULL) { - /* - * We probably should not work around - * but kassert, since lro alwasy sets rcvif. - */ - no_vn = 1; - goto skip_vnet; - } + KASSERT(m != NULL, ("ctf_process_inbound_raw: m == NULL")); + ifp = m_rcvif(m); + KASSERT(ifp != NULL, ("ctf_process_inbound_raw: ifp == NULL")); CURVNET_SET(ifp->if_vnet); -skip_vnet: tcp_get_usecs(&tv); while (m) { m_save = m->m_nextpkt; @@ -466,18 +455,14 @@ skip_vnet: m_freem(m); m = m_save; } - if (no_vn == 0) { - CURVNET_RESTORE(); - } + CURVNET_RESTORE(); INP_UNLOCK_ASSERT(inp); - return(retval); + return (retval); } skipped_pkt: m = m_save; } - if (no_vn == 0) { - CURVNET_RESTORE(); - } + CURVNET_RESTORE(); return (0); }