summaryrefslogtreecommitdiff
path: root/sys/netinet/tcp_syncache.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet/tcp_syncache.c')
-rw-r--r--sys/netinet/tcp_syncache.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c
index 9faca9661ab9..18f3fb446620 100644
--- a/sys/netinet/tcp_syncache.c
+++ b/sys/netinet/tcp_syncache.c
@@ -294,7 +294,7 @@ syncache_insert(struct syncache *sc, struct syncache_head *sch)
("sch->sch_length incorrect"));
sc2 = TAILQ_LAST(&sch->sch_bucket, sch_head);
syncache_drop(sc2, sch);
- V_tcpstat.tcps_sc_bucketoverflow++;
+ TCPSTAT_INC(tcps_sc_bucketoverflow);
}
/* Put it into the bucket. */
@@ -309,7 +309,7 @@ syncache_insert(struct syncache *sc, struct syncache_head *sch)
SCH_UNLOCK(sch);
V_tcp_syncache.cache_count++;
- V_tcpstat.tcps_sc_added++;
+ TCPSTAT_INC(tcps_sc_added);
}
/*
@@ -398,7 +398,7 @@ syncache_timer(void *xsch)
free(s, M_TCPLOG);
}
syncache_drop(sc, sch);
- V_tcpstat.tcps_sc_stale++;
+ TCPSTAT_INC(tcps_sc_stale);
continue;
}
if ((s = tcp_log_addrs(&sc->sc_inc, NULL, NULL, NULL))) {
@@ -409,7 +409,7 @@ syncache_timer(void *xsch)
}
(void) syncache_respond(sc);
- V_tcpstat.tcps_sc_retransmitted++;
+ TCPSTAT_INC(tcps_sc_retransmitted);
syncache_timeout(sc, sch, 0);
}
if (!TAILQ_EMPTY(&(sch)->sch_bucket))
@@ -489,7 +489,7 @@ syncache_chkrst(struct in_conninfo *inc, struct tcphdr *th)
if ((s = tcp_log_addrs(inc, th, NULL, NULL)))
log(LOG_DEBUG, "%s; %s: Spurious RST with ACK, SYN or "
"FIN flag set, segment ignored\n", s, __func__);
- V_tcpstat.tcps_badrst++;
+ TCPSTAT_INC(tcps_badrst);
goto done;
}
@@ -506,7 +506,7 @@ syncache_chkrst(struct in_conninfo *inc, struct tcphdr *th)
log(LOG_DEBUG, "%s; %s: Spurious RST without matching "
"syncache entry (possibly syncookie only), "
"segment ignored\n", s, __func__);
- V_tcpstat.tcps_badrst++;
+ TCPSTAT_INC(tcps_badrst);
goto done;
}
@@ -530,13 +530,13 @@ syncache_chkrst(struct in_conninfo *inc, struct tcphdr *th)
log(LOG_DEBUG, "%s; %s: Our SYN|ACK was rejected, "
"connection attempt aborted by remote endpoint\n",
s, __func__);
- V_tcpstat.tcps_sc_reset++;
+ TCPSTAT_INC(tcps_sc_reset);
} else {
if ((s = tcp_log_addrs(inc, th, NULL, NULL)))
log(LOG_DEBUG, "%s; %s: RST with invalid SEQ %u != "
"IRS %u (+WND %u), segment ignored\n",
s, __func__, th->th_seq, sc->sc_irs, sc->sc_wnd);
- V_tcpstat.tcps_badrst++;
+ TCPSTAT_INC(tcps_badrst);
}
done:
@@ -556,7 +556,7 @@ syncache_badack(struct in_conninfo *inc)
SCH_LOCK_ASSERT(sch);
if (sc != NULL) {
syncache_drop(sc, sch);
- V_tcpstat.tcps_sc_badack++;
+ TCPSTAT_INC(tcps_sc_badack);
}
SCH_UNLOCK(sch);
}
@@ -590,7 +590,7 @@ syncache_unreach(struct in_conninfo *inc, struct tcphdr *th)
goto done;
}
syncache_drop(sc, sch);
- V_tcpstat.tcps_sc_unreach++;
+ TCPSTAT_INC(tcps_sc_unreach);
done:
SCH_UNLOCK(sch);
}
@@ -622,7 +622,7 @@ syncache_socket(struct syncache *sc, struct socket *lso, struct mbuf *m)
* have the peer retransmit its SYN again after its
* RTO and try again.
*/
- V_tcpstat.tcps_listendrop++;
+ TCPSTAT_INC(tcps_listendrop);
if ((s = tcp_log_addrs(&sc->sc_inc, NULL, NULL, NULL))) {
log(LOG_DEBUG, "%s; %s: Socket create failed "
"due to limits or memory shortage\n",
@@ -792,7 +792,7 @@ syncache_socket(struct syncache *sc, struct socket *lso, struct mbuf *m)
INP_WUNLOCK(inp);
- V_tcpstat.tcps_accepts++;
+ TCPSTAT_INC(tcps_accepts);
return (so);
abort:
@@ -912,9 +912,9 @@ syncache_expand(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th,
*lsop = syncache_socket(sc, *lsop, m);
if (*lsop == NULL)
- V_tcpstat.tcps_sc_aborted++;
+ TCPSTAT_INC(tcps_sc_aborted);
else
- V_tcpstat.tcps_sc_completed++;
+ TCPSTAT_INC(tcps_sc_completed);
/* how do we find the inp for the new socket? */
if (sc != &scs)
@@ -1046,7 +1046,7 @@ _syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th,
sc->sc_tu->tu_syncache_event(TOE_SC_ENTRY_PRESENT,
sc->sc_toepcb);
#endif
- V_tcpstat.tcps_sc_dupsyn++;
+ TCPSTAT_INC(tcps_sc_dupsyn);
if (ipopts) {
/*
* If we were remembering a previous source route,
@@ -1081,8 +1081,8 @@ _syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th,
if (!TOEPCB_ISSET(sc) && syncache_respond(sc) == 0) {
sc->sc_rxmits = 0;
syncache_timeout(sc, sch, 1);
- V_tcpstat.tcps_sndacks++;
- V_tcpstat.tcps_sndtotal++;
+ TCPSTAT_INC(tcps_sndacks);
+ TCPSTAT_INC(tcps_sndtotal);
}
SCH_UNLOCK(sch);
goto done;
@@ -1095,7 +1095,7 @@ _syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th,
* Treat this as if the cache was full; drop the oldest
* entry and insert the new one.
*/
- V_tcpstat.tcps_sc_zonefail++;
+ TCPSTAT_INC(tcps_sc_zonefail);
if ((sc = TAILQ_LAST(&sch->sch_bucket, sch_head)) != NULL)
syncache_drop(sc, sch);
sc = uma_zalloc(V_tcp_syncache.zone, M_NOWAIT | M_ZERO);
@@ -1233,12 +1233,12 @@ _syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th,
syncache_free(sc);
else if (sc != &scs)
syncache_insert(sc, sch); /* locks and unlocks sch */
- V_tcpstat.tcps_sndacks++;
- V_tcpstat.tcps_sndtotal++;
+ TCPSTAT_INC(tcps_sndacks);
+ TCPSTAT_INC(tcps_sndtotal);
} else {
if (sc != &scs)
syncache_free(sc);
- V_tcpstat.tcps_sc_dropped++;
+ TCPSTAT_INC(tcps_sc_dropped);
}
done:
@@ -1351,7 +1351,7 @@ syncache_respond(struct syncache *sc)
if (sc->sc_flags & SCF_ECN) {
th->th_flags |= TH_ECE;
- V_tcpstat.tcps_ecn_shs++;
+ TCPSTAT_INC(tcps_ecn_shs);
}
/* Tack on the TCP options. */
@@ -1584,7 +1584,7 @@ syncookie_generate(struct syncache_head *sch, struct syncache *sc,
sc->sc_tsoff = data - ticks; /* after XOR */
}
- V_tcpstat.tcps_sc_sendcookie++;
+ TCPSTAT_INC(tcps_sc_sendcookie);
}
static struct syncache *
@@ -1687,7 +1687,7 @@ syncookie_lookup(struct in_conninfo *inc, struct syncache_head *sch,
sc->sc_rxmits = 0;
sc->sc_peer_mss = tcp_sc_msstab[mss];
- V_tcpstat.tcps_sc_recvcookie++;
+ TCPSTAT_INC(tcps_sc_recvcookie);
return (sc);
}