Date: Wed, 5 Feb 2025 19:49:28 GMT From: Michael Tuexen <tuexen@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 92d87203c00e - stable/13 - TCP RACK, BBR: cleanup of ctf_process_inbound_raw() Message-ID: <202502051949.515JnSZX069973@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=92d87203c00e5b47f5505702b2a86fae3c1cf063 commit 92d87203c00e5b47f5505702b2a86fae3c1cf063 Author: Michael Tuexen <tuexen@FreeBSD.org> AuthorDate: 2024-12-31 16:22:03 +0000 Commit: Michael Tuexen <tuexen@FreeBSD.org> CommitDate: 2025-02-05 19:34:37 +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 Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48258 (cherry picked from commit 4940584bbf0b809130f6ac1a7a0c6b00d373af1e) --- sys/netinet/tcp_stacks/rack_bbr_common.c | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/sys/netinet/tcp_stacks/rack_bbr_common.c b/sys/netinet/tcp_stacks/rack_bbr_common.c index 1426043f5326..4a1f167e90f4 100644 --- a/sys/netinet/tcp_stacks/rack_bbr_common.c +++ b/sys/netinet/tcp_stacks/rack_bbr_common.c @@ -400,23 +400,13 @@ ctf_process_inbound_raw(struct tcpcb *tp, struct socket *so, struct mbuf *m, int int32_t retval, nxt_pkt, tlen, off; int etype = 0; uint16_t drop_hdrlen; - uint8_t iptos, no_vn=0; + uint8_t iptos; 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; @@ -508,18 +498,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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202502051949.515JnSZX069973>