Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F164200500
D58440.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
8 KB
Referenced Files
None
Subscribers
None
D58440.diff
View Options
diff --git a/sys/netinet/tcp_hostcache.c b/sys/netinet/tcp_hostcache.c
--- a/sys/netinet/tcp_hostcache.c
+++ b/sys/netinet/tcp_hostcache.c
@@ -53,7 +53,7 @@
* entry if a hash is full. Value updates for an entry shall be atomic.
*
* TCP stack(s) communication with tcp_hostcache() is done via KBI functions
- * tcp_hc_*() and the hc_metrics_lite structure.
+ * tcp_hc_*() and the tcp_hc_metrics structure.
*
* Since tcp_hostcache is only caching information, there are no fatal
* consequences if we either can't allocate a new entry or have to drop
@@ -371,12 +371,12 @@
*/
void
tcp_hc_get(const struct in_conninfo *inc,
- struct hc_metrics_lite *hc_metrics_lite)
+ struct tcp_hc_metrics *hc_metrics)
{
struct hc_metrics *hc_entry;
if (!V_tcp_use_hostcache) {
- bzero(hc_metrics_lite, sizeof(*hc_metrics_lite));
+ bzero(hc_metrics, sizeof(*hc_metrics));
return;
}
@@ -389,17 +389,17 @@
* If we don't have an existing object.
*/
if (hc_entry == NULL) {
- bzero(hc_metrics_lite, sizeof(*hc_metrics_lite));
+ bzero(hc_metrics, sizeof(*hc_metrics));
return;
}
- hc_metrics_lite->hc_mtu = atomic_load_32(&hc_entry->hc_mtu);
- hc_metrics_lite->hc_ssthresh = atomic_load_32(&hc_entry->hc_ssthresh);
- hc_metrics_lite->hc_rtt = atomic_load_32(&hc_entry->hc_rtt);
- hc_metrics_lite->hc_rttvar = atomic_load_32(&hc_entry->hc_rttvar);
- hc_metrics_lite->hc_cwnd = atomic_load_32(&hc_entry->hc_cwnd);
- hc_metrics_lite->hc_sendpipe = atomic_load_32(&hc_entry->hc_sendpipe);
- hc_metrics_lite->hc_recvpipe = atomic_load_32(&hc_entry->hc_recvpipe);
+ hc_metrics->hc_mtu = atomic_load_32(&hc_entry->hc_mtu);
+ hc_metrics->hc_ssthresh = atomic_load_32(&hc_entry->hc_ssthresh);
+ hc_metrics->hc_rtt = atomic_load_32(&hc_entry->hc_rtt);
+ hc_metrics->hc_rttvar = atomic_load_32(&hc_entry->hc_rttvar);
+ hc_metrics->hc_cwnd = atomic_load_32(&hc_entry->hc_cwnd);
+ hc_metrics->hc_sendpipe = atomic_load_32(&hc_entry->hc_sendpipe);
+ hc_metrics->hc_recvpipe = atomic_load_32(&hc_entry->hc_recvpipe);
smr_exit(V_tcp_hostcache.smr);
}
@@ -436,9 +436,9 @@
void
tcp_hc_updatemtu(const struct in_conninfo *inc, uint32_t mtu)
{
- struct hc_metrics_lite hcml = { .hc_mtu = mtu };
+ struct tcp_hc_metrics hcm = { .hc_mtu = mtu };
- return (tcp_hc_update(inc, &hcml));
+ return (tcp_hc_update(inc, &hcm));
}
/*
@@ -446,7 +446,7 @@
* Creates a new entry if none was found.
*/
void
-tcp_hc_update(const struct in_conninfo *inc, struct hc_metrics_lite *hcml)
+tcp_hc_update(const struct in_conninfo *inc, struct tcp_hc_metrics *hcm)
{
struct hc_head *hc_head;
struct hc_metrics *hc_entry, *hc_prev;
@@ -543,59 +543,60 @@
* Fill in data. Use atomics, since an existing entry is
* accessible by readers in SMR section.
*/
- if (hcml->hc_mtu != 0) {
- atomic_store_32(&hc_entry->hc_mtu, hcml->hc_mtu);
+ if (hcm->hc_mtu != 0) {
+ atomic_store_32(&hc_entry->hc_mtu, hcm->hc_mtu);
}
- if (hcml->hc_rtt != 0) {
+ if (hcm->hc_rtt != 0) {
if (hc_entry->hc_rtt == 0)
- v = hcml->hc_rtt;
+ v = hcm->hc_rtt;
else
v = ((uint64_t)hc_entry->hc_rtt +
- (uint64_t)hcml->hc_rtt) / 2;
+ (uint64_t)hcm->hc_rtt) / 2;
atomic_store_32(&hc_entry->hc_rtt, v);
TCPSTAT_INC(tcps_cachedrtt);
}
- if (hcml->hc_rttvar != 0) {
+ if (hcm->hc_rttvar != 0) {
if (hc_entry->hc_rttvar == 0)
- v = hcml->hc_rttvar;
+ v = hcm->hc_rttvar;
else
v = ((uint64_t)hc_entry->hc_rttvar +
- (uint64_t)hcml->hc_rttvar) / 2;
+ (uint64_t)hcm->hc_rttvar) / 2;
atomic_store_32(&hc_entry->hc_rttvar, v);
TCPSTAT_INC(tcps_cachedrttvar);
}
- if (hcml->hc_ssthresh != 0) {
+ if (hcm->hc_ssthresh != 0) {
if (hc_entry->hc_ssthresh == 0)
- v = hcml->hc_ssthresh;
+ v = hcm->hc_ssthresh;
else
- v = (hc_entry->hc_ssthresh + hcml->hc_ssthresh) / 2;
+ v = (hc_entry->hc_ssthresh +
+ hcm->hc_ssthresh) / 2;
atomic_store_32(&hc_entry->hc_ssthresh, v);
TCPSTAT_INC(tcps_cachedssthresh);
}
- if (hcml->hc_cwnd != 0) {
+ if (hcm->hc_cwnd != 0) {
if (hc_entry->hc_cwnd == 0)
- v = hcml->hc_cwnd;
+ v = hcm->hc_cwnd;
else
v = ((uint64_t)hc_entry->hc_cwnd +
- (uint64_t)hcml->hc_cwnd) / 2;
+ (uint64_t)hcm->hc_cwnd) / 2;
atomic_store_32(&hc_entry->hc_cwnd, v);
/* TCPSTAT_INC(tcps_cachedcwnd); */
}
- if (hcml->hc_sendpipe != 0) {
+ if (hcm->hc_sendpipe != 0) {
if (hc_entry->hc_sendpipe == 0)
- v = hcml->hc_sendpipe;
+ v = hcm->hc_sendpipe;
else
v = ((uint64_t)hc_entry->hc_sendpipe +
- (uint64_t)hcml->hc_sendpipe) /2;
+ (uint64_t)hcm->hc_sendpipe) / 2;
atomic_store_32(&hc_entry->hc_sendpipe, v);
/* TCPSTAT_INC(tcps_cachedsendpipe); */
}
- if (hcml->hc_recvpipe != 0) {
+ if (hcm->hc_recvpipe != 0) {
if (hc_entry->hc_recvpipe == 0)
- v = hcml->hc_recvpipe;
+ v = hcm->hc_recvpipe;
else
v = ((uint64_t)hc_entry->hc_recvpipe +
- (uint64_t)hcml->hc_recvpipe) /2;
+ (uint64_t)hcm->hc_recvpipe) / 2;
atomic_store_32(&hc_entry->hc_recvpipe, v);
/* TCPSTAT_INC(tcps_cachedrecvpipe); */
}
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -359,7 +359,7 @@
void
cc_conn_init(struct tcpcb *tp)
{
- struct hc_metrics_lite metrics;
+ struct tcp_hc_metrics metrics;
struct inpcb *inp = tptoinpcb(tp);
u_int maxseg;
int rtt;
@@ -3714,12 +3714,12 @@
*/
void
tcp_mss_update(struct tcpcb *tp, int offer, int mtuoffer,
- struct hc_metrics_lite *metricptr, struct tcp_ifcap *cap)
+ struct tcp_hc_metrics *metricptr, struct tcp_ifcap *cap)
{
int mss = 0;
uint32_t maxmtu = 0;
struct inpcb *inp = tptoinpcb(tp);
- struct hc_metrics_lite metrics;
+ struct tcp_hc_metrics metrics;
#ifdef INET6
int isipv6 = ((inp->inp_vflag & INP_IPV6) != 0) ? 1 : 0;
size_t min_protoh = isipv6 ?
@@ -3765,7 +3765,7 @@
* if there was no cache hit.
*/
if (metricptr != NULL)
- bzero(metricptr, sizeof(struct hc_metrics_lite));
+ bzero(metricptr, sizeof(struct tcp_hc_metrics));
return;
}
@@ -3876,7 +3876,7 @@
uint32_t bufsize;
struct inpcb *inp = tptoinpcb(tp);
struct socket *so;
- struct hc_metrics_lite metrics;
+ struct tcp_hc_metrics metrics;
struct tcp_ifcap cap;
KASSERT(tp != NULL, ("%s: tp == NULL", __func__));
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -2479,7 +2479,7 @@
* say srtt etc into the general one used by other stacks.
*/
if (tp->t_rttupdated >= 4) {
- struct hc_metrics_lite metrics;
+ struct tcp_hc_metrics metrics;
uint32_t ssthresh;
bzero(&metrics, sizeof(metrics));
diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h
--- a/sys/netinet/tcp_var.h
+++ b/sys/netinet/tcp_var.h
@@ -906,7 +906,8 @@
*/
#define TO_SYN 0x01 /* parse SYN-only options */
-struct hc_metrics_lite { /* must stay in sync with hc_metrics */
+#ifdef _KERNEL
+struct tcp_hc_metrics {
uint32_t hc_mtu; /* MTU for this path */
uint32_t hc_ssthresh; /* outbound gateway buffer limit */
uint32_t hc_rtt; /* estimated round trip time */
@@ -915,6 +916,7 @@
uint32_t hc_sendpipe; /* outbound delay-bandwidth product */
uint32_t hc_recvpipe; /* inbound delay-bandwidth product */
};
+#endif /* _KERNEL */
#ifndef _NETINET_IN_PCB_H_
struct in_conninfo;
@@ -1480,7 +1482,7 @@
void tcp6_use_min_mtu(struct tcpcb *);
u_int tcp_maxseg(const struct tcpcb *);
u_int tcp_fixed_maxseg(const struct tcpcb *);
-void tcp_mss_update(struct tcpcb *, int, int, struct hc_metrics_lite *,
+void tcp_mss_update(struct tcpcb *, int, int, struct tcp_hc_metrics *,
struct tcp_ifcap *);
void tcp_mss(struct tcpcb *, int);
int tcp_mssopt(struct in_conninfo *);
@@ -1510,10 +1512,10 @@
#ifdef VIMAGE
void tcp_hc_destroy(void);
#endif
-void tcp_hc_get(const struct in_conninfo *, struct hc_metrics_lite *);
+void tcp_hc_get(const struct in_conninfo *, struct tcp_hc_metrics *);
uint32_t tcp_hc_getmtu(const struct in_conninfo *);
void tcp_hc_updatemtu(const struct in_conninfo *, uint32_t);
-void tcp_hc_update(const struct in_conninfo *, struct hc_metrics_lite *);
+void tcp_hc_update(const struct in_conninfo *, struct tcp_hc_metrics *);
void cc_after_idle(struct tcpcb *tp);
extern struct protosw tcp_protosw; /* shared for TOE */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jul 30, 2:33 PM (13 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35715651
Default Alt Text
D58440.diff (8 KB)
Attached To
Mode
D58440: tcp_hostcache: limit scope of struct hc_metrics_lite and rename with tcp_ prefix
Attached
Detach File
Event Timeline
Log In to Comment