Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_var.h
Show All 35 Lines | |||||
#define _NETINET_TCP_VAR_H_ | #define _NETINET_TCP_VAR_H_ | ||||
#include <netinet/tcp.h> | #include <netinet/tcp.h> | ||||
#include <netinet/tcp_fsm.h> | #include <netinet/tcp_fsm.h> | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
#include <net/vnet.h> | #include <net/vnet.h> | ||||
#include <sys/mbuf.h> | #include <sys/mbuf.h> | ||||
#include "opt_kern_tls.h" | |||||
markj: opt_* includes should be sorted before the others. | |||||
#include <sys/ktls.h> | |||||
#endif | #endif | ||||
#define TCP_END_BYTE_INFO 8 /* Bytes that makeup the "end information array" */ | #define TCP_END_BYTE_INFO 8 /* Bytes that makeup the "end information array" */ | ||||
/* Types of ending byte info */ | /* Types of ending byte info */ | ||||
#define TCP_EI_EMPTY_SLOT 0 | #define TCP_EI_EMPTY_SLOT 0 | ||||
#define TCP_EI_STATUS_CLIENT_FIN 0x1 | #define TCP_EI_STATUS_CLIENT_FIN 0x1 | ||||
#define TCP_EI_STATUS_CLIENT_RST 0x2 | #define TCP_EI_STATUS_CLIENT_RST 0x2 | ||||
#define TCP_EI_STATUS_SERVER_FIN 0x3 | #define TCP_EI_STATUS_SERVER_FIN 0x3 | ||||
▲ Show 20 Lines • Show All 1,082 Lines • ▼ Show 20 Lines | tcp_fields_to_net(struct tcphdr *th) | ||||
th->th_seq = htonl(th->th_seq); | th->th_seq = htonl(th->th_seq); | ||||
th->th_ack = htonl(th->th_ack); | th->th_ack = htonl(th->th_ack); | ||||
th->th_win = htons(th->th_win); | th->th_win = htons(th->th_win); | ||||
th->th_urp = htons(th->th_urp); | th->th_urp = htons(th->th_urp); | ||||
} | } | ||||
static inline void | static inline void | ||||
tcp_account_for_send(struct tcpcb *tp, uint32_t len, uint8_t is_rxt, | tcp_account_for_send(struct tcpcb *tp, uint32_t len, uint8_t is_rxt, | ||||
uint8_t is_tlp, int hw_tls __unused) | uint8_t is_tlp, int hw_tls) | ||||
{ | { | ||||
uint64_t rexmit_percent; | |||||
if (is_tlp) { | if (is_tlp) { | ||||
tp->t_sndtlppack++; | tp->t_sndtlppack++; | ||||
tp->t_sndtlpbyte += len; | tp->t_sndtlpbyte += len; | ||||
} | } | ||||
/* To get total bytes sent you must add t_snd_rxt_bytes to t_sndbytes */ | /* To get total bytes sent you must add t_snd_rxt_bytes to t_sndbytes */ | ||||
if (is_rxt) | if (is_rxt) | ||||
tp->t_snd_rxt_bytes += len; | tp->t_snd_rxt_bytes += len; | ||||
else | else | ||||
tp->t_sndbytes += len; | tp->t_sndbytes += len; | ||||
Done Inline ActionsExtra newline. markj: Extra newline. | |||||
if (hw_tls && is_rxt) { | |||||
rexmit_percent = (1000ULL * tp->t_snd_rxt_bytes) / (10ULL * (tp->t_snd_rxt_bytes + tp->t_sndbytes)); | |||||
hselaskyUnsubmitted Not Done Inline ActionsI think you should have a check for division by zero?? hselasky: I think you should have a check for division by zero?? | |||||
gallatinAuthorUnsubmitted Done Inline ActionsI don't think thats needed. The denominator is tp->t_snd_rxt_bytes + tp->t_sndbytes; and this is only called when rxt bytes is updated, so I don't see how the sum could be zero. gallatin: I don't think thats needed. The denominator is tp->t_snd_rxt_bytes + tp->t_sndbytes; and this… | |||||
if (rexmit_percent > ktls_ifnet_max_rexmit_pct) | |||||
hselaskyUnsubmitted Done Inline ActionsIs signed with unsigned comparison OK here? Or should ktls_ifnet_max_rexmit_pct be made unsigned aswell? hselasky: Is signed with unsigned comparison OK here? Or should ktls_ifnet_max_rexmit_pct be made… | |||||
ktls_disable_ifnet(tp); | |||||
} | |||||
} | } | ||||
#endif /* _KERNEL */ | #endif /* _KERNEL */ | ||||
#endif /* _NETINET_TCP_VAR_H_ */ | #endif /* _NETINET_TCP_VAR_H_ */ |
opt_* includes should be sorted before the others.