git: 40fa3e40b584 - main - tcp: mechanically substitute call to tfb_tcp_output to new method.

From: Gleb Smirnoff <glebius_at_FreeBSD.org>
Date: Sun, 26 Dec 2021 16:49:28 UTC
The branch main has been updated by glebius:

URL: https://cgit.FreeBSD.org/src/commit/?id=40fa3e40b5849089c5ea1e42c4318f36f227491a

commit 40fa3e40b5849089c5ea1e42c4318f36f227491a
Author:     Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2021-12-26 16:47:59 +0000
Commit:     Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2021-12-26 16:47:59 +0000

    tcp: mechanically substitute call to tfb_tcp_output to new method.
    
    Made with sed(1) execution:
    
    sed -Ef sed -i "" $(grep --exclude tcp_var.h -lr tcp_output sys/)
    
    sed:
    s/tp->t_fb->tfb_tcp_output\(tp\)/tcp_output(tp)/
    s/to tfb_tcp_output\(\)/to tcp_output()/
    
    Reviewed by:            rrs, tuexen
    Differential revision:  https://reviews.freebsd.org/D33366
---
 sys/dev/cxgbe/tom/t4_cpl_io.c            |  2 +-
 sys/netinet/tcp_hpts.c                   |  2 +-
 sys/netinet/tcp_input.c                  | 18 +++++++++---------
 sys/netinet/tcp_sack.c                   |  2 +-
 sys/netinet/tcp_stacks/bbr.c             |  4 ++--
 sys/netinet/tcp_stacks/rack.c            |  4 ++--
 sys/netinet/tcp_stacks/rack_bbr_common.c |  2 +-
 sys/netinet/tcp_subr.c                   |  4 ++--
 sys/netinet/tcp_timer.c                  |  6 +++---
 sys/netinet/tcp_usrreq.c                 | 20 ++++++++++----------
 sys/netinet/toecore.c                    |  2 +-
 11 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/sys/dev/cxgbe/tom/t4_cpl_io.c b/sys/dev/cxgbe/tom/t4_cpl_io.c
index 8635dc3d8922..ae22b3d5c252 100644
--- a/sys/dev/cxgbe/tom/t4_cpl_io.c
+++ b/sys/dev/cxgbe/tom/t4_cpl_io.c
@@ -2299,7 +2299,7 @@ sendanother:
 		tp = intotcpcb(inp);
 		if (moretocome)
 			tp->t_flags |= TF_MORETOCOME;
-		error = tp->t_fb->tfb_tcp_output(tp);
+		error = tcp_output(tp);
 		if (moretocome)
 			tp->t_flags &= ~TF_MORETOCOME;
 	}
diff --git a/sys/netinet/tcp_hpts.c b/sys/netinet/tcp_hpts.c
index 9bf6e6773cca..745ebe9f3aaa 100644
--- a/sys/netinet/tcp_hpts.c
+++ b/sys/netinet/tcp_hpts.c
@@ -1549,7 +1549,7 @@ again:
 				}
 			}
 			inp->inp_hpts_calls = 1;
-			error = tp->t_fb->tfb_tcp_output(tp);
+			error = tcp_output(tp);
 			inp->inp_hpts_calls = 0;
 			if (ninp && ninp->inp_ppcb) {
 				/*
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 9332bf16235f..110cb99df7bb 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -1889,7 +1889,7 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so,
 						      tp->t_rxtcur);
 				sowwakeup(so);
 				if (sbavail(&so->so_snd))
-					(void) tp->t_fb->tfb_tcp_output(tp);
+					(void) tcp_output(tp);
 				goto check_delack;
 			}
 		} else if (th->th_ack == tp->snd_una &&
@@ -1958,7 +1958,7 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so,
 				tp->t_flags |= TF_DELACK;
 			} else {
 				tp->t_flags |= TF_ACKNOW;
-				tp->t_fb->tfb_tcp_output(tp);
+				tcp_output(tp);
 			}
 			goto check_delack;
 		}
@@ -2629,7 +2629,7 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so,
 						}
 					} else
 						tp->snd_cwnd += maxseg;
-					(void) tp->t_fb->tfb_tcp_output(tp);
+					(void) tcp_output(tp);
 					goto drop;
 				} else if (tp->t_dupacks == tcprexmtthresh ||
 					    (tp->t_flags & TF_SACK_PERMIT &&
@@ -2698,14 +2698,14 @@ enter_recovery:
 						    tcps_sack_recovery_episode);
 						tp->snd_recover = tp->snd_nxt;
 						tp->snd_cwnd = maxseg;
-						(void) tp->t_fb->tfb_tcp_output(tp);
+						(void) tcp_output(tp);
 						if (SEQ_GT(th->th_ack, tp->snd_una))
 							goto resume_partialack;
 						goto drop;
 					}
 					tp->snd_nxt = th->th_ack;
 					tp->snd_cwnd = maxseg;
-					(void) tp->t_fb->tfb_tcp_output(tp);
+					(void) tcp_output(tp);
 					KASSERT(tp->snd_limited <= 2,
 					    ("%s: tp->snd_limited too big",
 					    __func__));
@@ -2753,7 +2753,7 @@ enter_recovery:
 					    (tp->snd_nxt - tp->snd_una);
 					SOCKBUF_UNLOCK(&so->so_snd);
 					if (avail > 0)
-						(void) tp->t_fb->tfb_tcp_output(tp);
+						(void) tcp_output(tp);
 					sent = tp->snd_max - oldsndmax;
 					if (sent > maxseg) {
 						KASSERT((tp->t_dupacks == 2 &&
@@ -3305,7 +3305,7 @@ dodata:							/* XXX */
 	 * Return any desired output.
 	 */
 	if (needoutput || (tp->t_flags & TF_ACKNOW))
-		(void) tp->t_fb->tfb_tcp_output(tp);
+		(void) tcp_output(tp);
 
 check_delack:
 	INP_WLOCK_ASSERT(tp->t_inpcb);
@@ -3346,7 +3346,7 @@ dropafterack:
 #endif
 	TCP_PROBE3(debug__input, tp, th, m);
 	tp->t_flags |= TF_ACKNOW;
-	(void) tp->t_fb->tfb_tcp_output(tp);
+	(void) tcp_output(tp);
 	INP_WUNLOCK(tp->t_inpcb);
 	m_freem(m);
 	return;
@@ -4049,7 +4049,7 @@ tcp_newreno_partial_ack(struct tcpcb *tp, struct tcphdr *th)
 	 */
 	tp->snd_cwnd = maxseg + BYTES_THIS_ACK(tp, th);
 	tp->t_flags |= TF_ACKNOW;
-	(void) tp->t_fb->tfb_tcp_output(tp);
+	(void) tcp_output(tp);
 	tp->snd_cwnd = ocwnd;
 	if (SEQ_GT(onxt, tp->snd_nxt))
 		tp->snd_nxt = onxt;
diff --git a/sys/netinet/tcp_sack.c b/sys/netinet/tcp_sack.c
index 25eb633fbbd4..11a3eb5c68a5 100644
--- a/sys/netinet/tcp_sack.c
+++ b/sys/netinet/tcp_sack.c
@@ -902,7 +902,7 @@ tcp_sack_partialack(struct tcpcb *tp, struct tcphdr *th)
 			    highdata - maxseg), highdata, NULL);
 		}
 	}
-	(void) tp->t_fb->tfb_tcp_output(tp);
+	(void) tcp_output(tp);
 }
 
 #if 0
diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c
index 24d238bbd04e..f79933d54f24 100644
--- a/sys/netinet/tcp_stacks/bbr.c
+++ b/sys/netinet/tcp_stacks/bbr.c
@@ -11637,7 +11637,7 @@ bbr_do_segment_nounlock(struct mbuf *m, struct tcphdr *th, struct socket *so,
 			if (bbr->r_wanted_output != 0) {
 				bbr->rc_output_starts_timer = 0;
 				did_out = 1;
-				(void)tp->t_fb->tfb_tcp_output(tp);
+				(void)tcp_output(tp);
 			} else
 				bbr_start_hpts_timer(bbr, tp, cts, 6, 0, 0);
 		}
@@ -11676,7 +11676,7 @@ bbr_do_segment_nounlock(struct mbuf *m, struct tcphdr *th, struct socket *so,
 							/* We are late */
 							bbr->r_ctl.rc_last_delay_val = 0;
 							BBR_STAT_INC(bbr_force_output);
-							(void)tp->t_fb->tfb_tcp_output(tp);
+							(void)tcp_output(tp);
 						}
 					}
 				}
diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c
index 202829f12b7c..765b023e9658 100644
--- a/sys/netinet/tcp_stacks/rack.c
+++ b/sys/netinet/tcp_stacks/rack.c
@@ -14171,7 +14171,7 @@ rack_do_compressed_ack_processing(struct tcpcb *tp, struct socket *so, struct mb
 	ctf_calc_rwin(so, tp);
 	if ((rack->r_wanted_output != 0) || (rack->r_fast_output != 0)) {
 	send_out_a_rst:
-		(void)tp->t_fb->tfb_tcp_output(tp);
+		(void)tcp_output(tp);
 		did_out = 1;
 	}
 	rack_free_trim(rack);
@@ -14657,7 +14657,7 @@ rack_do_segment_nounlock(struct mbuf *m, struct tcphdr *th, struct socket *so,
 			if ((rack->r_wanted_output != 0) || (rack->r_fast_output != 0)) {
 do_output_now:
 				did_out = 1;
-				(void)tp->t_fb->tfb_tcp_output(tp);
+				(void)tcp_output(tp);
 			}
 			rack_start_hpts_timer(rack, tp, cts, 0, 0, 0);
 			rack_free_trim(rack);
diff --git a/sys/netinet/tcp_stacks/rack_bbr_common.c b/sys/netinet/tcp_stacks/rack_bbr_common.c
index 88e028109c95..42225dfced2f 100644
--- a/sys/netinet/tcp_stacks/rack_bbr_common.c
+++ b/sys/netinet/tcp_stacks/rack_bbr_common.c
@@ -381,7 +381,7 @@ ctf_process_inbound_raw(struct tcpcb *tp, struct socket *so, struct mbuf *m, int
 	 * 1) It returns 0 if all went well and you (the caller) need
 	 *    to release the lock.
 	 * 2) If nxt_pkt is set, then the function will surpress calls
-	 *    to tfb_tcp_output() since you are promising to call again
+	 *    to tcp_output() since you are promising to call again
 	 *    with another packet.
 	 * 3) If it returns 1, then you must free all the packets being
 	 *    shipped in, the tcb has been destroyed (or about to be destroyed).
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index 7a0d5ee52ad9..15faca076001 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -2398,7 +2398,7 @@ tcp_drop(struct tcpcb *tp, int errno)
 
 	if (TCPS_HAVERCVDSYN(tp->t_state)) {
 		tcp_state_change(tp, TCPS_CLOSED);
-		(void) tp->t_fb->tfb_tcp_output(tp);
+		(void) tcp_output(tp);
 		TCPSTAT_INC(tcps_drops);
 	} else
 		TCPSTAT_INC(tcps_conndrops);
@@ -3517,7 +3517,7 @@ tcp_mtudisc(struct inpcb *inp, int mtuoffer)
 		 */
 		tp->t_fb->tfb_tcp_mtu_chg(tp);
 	}
-	tp->t_fb->tfb_tcp_output(tp);
+	tcp_output(tp);
 }
 
 #ifdef INET
diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c
index 54ac67867fcb..d41bd9465a08 100644
--- a/sys/netinet/tcp_timer.c
+++ b/sys/netinet/tcp_timer.c
@@ -292,7 +292,7 @@ tcp_timer_delack(void *xtp)
 	tp->t_flags |= TF_ACKNOW;
 	TCPSTAT_INC(tcps_delack);
 	NET_EPOCH_ENTER(et);
-	(void) tp->t_fb->tfb_tcp_output(tp);
+	(void) tcp_output(tp);
 	INP_WUNLOCK(inp);
 	NET_EPOCH_EXIT(et);
 	CURVNET_RESTORE();
@@ -563,7 +563,7 @@ tcp_timer_persist(void *xtp)
 	tcp_setpersist(tp);
 	tp->t_flags |= TF_FORCEDATA;
 	NET_EPOCH_ENTER(et);
-	(void) tp->t_fb->tfb_tcp_output(tp);
+	(void) tcp_output(tp);
 	NET_EPOCH_EXIT(et);
 	tp->t_flags &= ~TF_FORCEDATA;
 
@@ -843,7 +843,7 @@ tcp_timer_rexmt(void * xtp)
 
 	cc_cong_signal(tp, NULL, CC_RTO);
 	NET_EPOCH_ENTER(et);
-	(void) tp->t_fb->tfb_tcp_output(tp);
+	(void) tcp_output(tp);
 	NET_EPOCH_EXIT(et);
 #ifdef TCPDEBUG
 	if (tp != NULL && (tp->t_inpcb->inp_socket->so_options & SO_DEBUG))
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index 198852cc8fac..39705c3a9b54 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -593,7 +593,7 @@ tcp_usr_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
 		goto out_in_epoch;
 #endif
 	tcp_timer_activate(tp, TT_KEEP, TP_KEEPINIT(tp));
-	error = tp->t_fb->tfb_tcp_output(tp);
+	error = tcp_output(tp);
 out_in_epoch:
 	NET_EPOCH_EXIT(et);
 out:
@@ -690,7 +690,7 @@ tcp6_usr_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
 		    (error = tcp_offload_connect(so, nam)) == 0)
 			goto out_in_epoch;
 #endif
-		error = tp->t_fb->tfb_tcp_output(tp);
+		error = tcp_output(tp);
 		goto out_in_epoch;
 	} else {
 		if ((inp->inp_vflag & INP_IPV6) == 0) {
@@ -714,7 +714,7 @@ tcp6_usr_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
 #endif
 	tcp_timer_activate(tp, TT_KEEP, TP_KEEPINIT(tp));
 	NET_EPOCH_ENTER(et);
-	error = tp->t_fb->tfb_tcp_output(tp);
+	error = tcp_output(tp);
 #ifdef INET
 out_in_epoch:
 #endif
@@ -905,7 +905,7 @@ tcp_usr_shutdown(struct socket *so)
 	socantsendmore(so);
 	tcp_usrclosed(tp);
 	if (!(inp->inp_flags & INP_DROPPED))
-		error = tp->t_fb->tfb_tcp_output(tp);
+		error = tcp_output(tp);
 
 out:
 	TCPDEBUG2(PRU_SHUTDOWN);
@@ -953,7 +953,7 @@ tcp_usr_rcvd(struct socket *so, int flags)
 		tcp_offload_rcvd(tp);
 	else
 #endif
-	tp->t_fb->tfb_tcp_output(tp);
+	tcp_output(tp);
 	NET_EPOCH_EXIT(et);
 out:
 	TCPDEBUG2(PRU_RCVD);
@@ -1188,7 +1188,7 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf *m,
 		    !(flags & PRUS_NOTREADY)) {
 			if (flags & PRUS_MORETOCOME)
 				tp->t_flags |= TF_MORETOCOME;
-			error = tp->t_fb->tfb_tcp_output(tp);
+			error = tcp_output(tp);
 			if (flags & PRUS_MORETOCOME)
 				tp->t_flags &= ~TF_MORETOCOME;
 		}
@@ -1255,7 +1255,7 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf *m,
 		tp->snd_up = tp->snd_una + sbavail(&so->so_snd);
 		if ((flags & PRUS_NOTREADY) == 0) {
 			tp->t_flags |= TF_FORCEDATA;
-			error = tp->t_fb->tfb_tcp_output(tp);
+			error = tcp_output(tp);
 			tp->t_flags &= ~TF_FORCEDATA;
 		}
 	}
@@ -1312,7 +1312,7 @@ tcp_usr_ready(struct socket *so, struct mbuf *m, int count)
 	SOCKBUF_UNLOCK(&so->so_snd);
 	if (error == 0) {
 		NET_EPOCH_ENTER(et);
-		error = tp->t_fb->tfb_tcp_output(tp);
+		error = tcp_output(tp);
 		NET_EPOCH_EXIT(et);
 	}
 	INP_WUNLOCK(inp);
@@ -2238,7 +2238,7 @@ unlock_and_done:
 					struct epoch_tracker et;
 
 					NET_EPOCH_ENTER(et);
-					error = tp->t_fb->tfb_tcp_output(tp);
+					error = tcp_output(tp);
 					NET_EPOCH_EXIT(et);
 				}
 			}
@@ -2767,7 +2767,7 @@ tcp_disconnect(struct tcpcb *tp)
 		sbflush(&so->so_rcv);
 		tcp_usrclosed(tp);
 		if (!(inp->inp_flags & INP_DROPPED))
-			tp->t_fb->tfb_tcp_output(tp);
+			tcp_output(tp);
 	}
 }
 
diff --git a/sys/netinet/toecore.c b/sys/netinet/toecore.c
index 0bf55958c618..17900a047559 100644
--- a/sys/netinet/toecore.c
+++ b/sys/netinet/toecore.c
@@ -532,7 +532,7 @@ toe_connect_failed(struct toedev *tod, struct inpcb *inp, int err)
 			KASSERT(!(tp->t_flags & TF_TOE),
 			    ("%s: tp %p still offloaded.", __func__, tp));
 			tcp_timer_activate(tp, TT_KEEP, TP_KEEPINIT(tp));
-			(void) tp->t_fb->tfb_tcp_output(tp);
+			(void) tcp_output(tp);
 		} else {
 			tp = tcp_drop(tp, err);
 			if (tp == NULL)