git: 1790549d801f - main - tcp: use TCPSTAT_INC in kernel ecn functions

From: Richard Scheffenegger <rscheff_at_FreeBSD.org>
Date: Sat, 05 Feb 2022 15:55:32 UTC
The branch main has been updated by rscheff:

URL: https://cgit.FreeBSD.org/src/commit/?id=1790549d801f65266811c49c0741ffedf722170e

commit 1790549d801f65266811c49c0741ffedf722170e
Author:     Richard Scheffenegger <rscheff@FreeBSD.org>
AuthorDate: 2022-02-05 15:50:21 +0000
Commit:     Richard Scheffenegger <rscheff@FreeBSD.org>
CommitDate: 2022-02-05 15:55:22 +0000

    tcp: use TCPSTAT_INC in kernel ecn functions
    
    Incorrectly used KMOD_ marco in static kernel ECN functions.
    
    Both eventually resolve to counter_s64_add(), but better
    use the correct macros.
    
    Reviewed By: tuexen, #transport
    Sponsored by:        NetApp, Inc.
    Differential Revision: https://reviews.freebsd.org/D34181
---
 sys/netinet/tcp_ecn.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/sys/netinet/tcp_ecn.c b/sys/netinet/tcp_ecn.c
index 2ef552af93bf..43870b0801c3 100644
--- a/sys/netinet/tcp_ecn.c
+++ b/sys/netinet/tcp_ecn.c
@@ -114,7 +114,7 @@ tcp_ecn_input_syn_sent(struct tcpcb *tp, uint16_t thflags, int iptos)
 	if (((thflags & (TH_CWR | TH_ECE)) == TH_ECE) &&
 	    V_tcp_do_ecn) {
 		tp->t_flags2 |= TF2_ECN_PERMIT;
-		KMOD_TCPSTAT_INC(tcps_ecn_shs);
+		TCPSTAT_INC(tcps_ecn_shs);
 	}
 }
 
@@ -133,7 +133,7 @@ tcp_ecn_input_parallel_syn(struct tcpcb *tp, uint16_t thflags, int iptos)
 		if ((thflags & (TH_CWR | TH_ECE)) == (TH_CWR | TH_ECE)) {
 			tp->t_flags2 |= TF2_ECN_PERMIT;
 			tp->t_flags2 |= TF2_ECN_SND_ECE;
-			KMOD_TCPSTAT_INC(tcps_ecn_shs);
+			TCPSTAT_INC(tcps_ecn_shs);
 		}
 	}
 }
@@ -149,13 +149,13 @@ tcp_ecn_input_segment(struct tcpcb *tp, uint16_t thflags, int iptos)
 	if (tp->t_flags2 & TF2_ECN_PERMIT) {
 		switch (iptos & IPTOS_ECN_MASK) {
 		case IPTOS_ECN_CE:
-			KMOD_TCPSTAT_INC(tcps_ecn_ce);
+			TCPSTAT_INC(tcps_ecn_ce);
 			break;
 		case IPTOS_ECN_ECT0:
-			KMOD_TCPSTAT_INC(tcps_ecn_ect0);
+			TCPSTAT_INC(tcps_ecn_ect0);
 			break;
 		case IPTOS_ECN_ECT1:
-			KMOD_TCPSTAT_INC(tcps_ecn_ect1);
+			TCPSTAT_INC(tcps_ecn_ect1);
 			break;
 		}
 
@@ -216,7 +216,7 @@ tcp_ecn_output_established(struct tcpcb *tp, uint16_t *thflags, int len)
 		    !((tp->t_flags & TF_FORCEDATA) && len == 1));
 	if (newdata) {
 		ipecn = IPTOS_ECN_ECT0;
-		KMOD_TCPSTAT_INC(tcps_ecn_ect0);
+		TCPSTAT_INC(tcps_ecn_ect0);
 	}
 	/*
 	 * Reply with proper ECN notifications.
@@ -286,7 +286,7 @@ tcp_ecn_syncache_respond(uint16_t thflags, struct syncache *sc)
 		switch (sc->sc_flags & SCF_ECN) {
 		case SCF_ECN:
 			thflags |= (0 | TH_ECE);
-			KMOD_TCPSTAT_INC(tcps_ecn_shs);
+			TCPSTAT_INC(tcps_ecn_shs);
 			break;
 		/* undefined SCF codepoint */
 		default: