tcp: don't store VNET in every tcpcb, take it from the inpcbinfo
Reviewed by: rscheff Differential revision: https://reviews.freebsd.org/D37125
This commit is contained in:
parent
ab0ef9455f
commit
8840ae2288
@ -1748,7 +1748,7 @@ ktls_reset_send_tag(void *context, int pending)
|
|||||||
if (!in_pcbrele_wlocked(inp)) {
|
if (!in_pcbrele_wlocked(inp)) {
|
||||||
if (!(inp->inp_flags & INP_DROPPED)) {
|
if (!(inp->inp_flags & INP_DROPPED)) {
|
||||||
tp = intotcpcb(inp);
|
tp = intotcpcb(inp);
|
||||||
CURVNET_SET(tp->t_vnet);
|
CURVNET_SET(inp->inp_vnet);
|
||||||
tp = tcp_drop(tp, ECONNABORTED);
|
tp = tcp_drop(tp, ECONNABORTED);
|
||||||
CURVNET_RESTORE();
|
CURVNET_RESTORE();
|
||||||
if (tp != NULL)
|
if (tp != NULL)
|
||||||
|
@ -2260,9 +2260,6 @@ tcp_newtcpcb(struct inpcb *inp)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef VIMAGE
|
|
||||||
tp->t_vnet = inp->inp_vnet;
|
|
||||||
#endif
|
|
||||||
tp->t_timers = &tm->tt;
|
tp->t_timers = &tm->tt;
|
||||||
TAILQ_INIT(&tp->t_segq);
|
TAILQ_INIT(&tp->t_segq);
|
||||||
tp->t_maxseg =
|
tp->t_maxseg =
|
||||||
|
@ -254,9 +254,9 @@ tcp_timer_delack(void *xtp)
|
|||||||
struct inpcb *inp = tptoinpcb(tp);
|
struct inpcb *inp = tptoinpcb(tp);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
CURVNET_SET(tp->t_vnet);
|
|
||||||
|
|
||||||
INP_WLOCK(inp);
|
INP_WLOCK(inp);
|
||||||
|
CURVNET_SET(inp->inp_vnet);
|
||||||
|
|
||||||
if (callout_pending(&tp->t_timers->tt_delack) ||
|
if (callout_pending(&tp->t_timers->tt_delack) ||
|
||||||
!callout_active(&tp->t_timers->tt_delack)) {
|
!callout_active(&tp->t_timers->tt_delack)) {
|
||||||
INP_WUNLOCK(inp);
|
INP_WUNLOCK(inp);
|
||||||
@ -318,7 +318,6 @@ tcp_timer_2msl(void *xtp)
|
|||||||
{
|
{
|
||||||
struct tcpcb *tp = xtp;
|
struct tcpcb *tp = xtp;
|
||||||
struct inpcb *inp = tptoinpcb(tp);
|
struct inpcb *inp = tptoinpcb(tp);
|
||||||
CURVNET_SET(tp->t_vnet);
|
|
||||||
#ifdef TCPDEBUG
|
#ifdef TCPDEBUG
|
||||||
int ostate;
|
int ostate;
|
||||||
|
|
||||||
@ -326,6 +325,8 @@ tcp_timer_2msl(void *xtp)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
INP_WLOCK(inp);
|
INP_WLOCK(inp);
|
||||||
|
CURVNET_SET(inp->inp_vnet);
|
||||||
|
|
||||||
tcp_log_end_status(tp, TCP_EI_STATUS_2MSL);
|
tcp_log_end_status(tp, TCP_EI_STATUS_2MSL);
|
||||||
tcp_free_sackholes(tp);
|
tcp_free_sackholes(tp);
|
||||||
if (callout_pending(&tp->t_timers->tt_2msl) ||
|
if (callout_pending(&tp->t_timers->tt_2msl) ||
|
||||||
@ -394,7 +395,6 @@ tcp_timer_keep(void *xtp)
|
|||||||
struct tcpcb *tp = xtp;
|
struct tcpcb *tp = xtp;
|
||||||
struct inpcb *inp = tptoinpcb(tp);
|
struct inpcb *inp = tptoinpcb(tp);
|
||||||
struct tcptemp *t_template;
|
struct tcptemp *t_template;
|
||||||
CURVNET_SET(tp->t_vnet);
|
|
||||||
#ifdef TCPDEBUG
|
#ifdef TCPDEBUG
|
||||||
int ostate;
|
int ostate;
|
||||||
|
|
||||||
@ -402,6 +402,8 @@ tcp_timer_keep(void *xtp)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
INP_WLOCK(inp);
|
INP_WLOCK(inp);
|
||||||
|
CURVNET_SET(inp->inp_vnet);
|
||||||
|
|
||||||
if (callout_pending(&tp->t_timers->tt_keep) ||
|
if (callout_pending(&tp->t_timers->tt_keep) ||
|
||||||
!callout_active(&tp->t_timers->tt_keep)) {
|
!callout_active(&tp->t_timers->tt_keep)) {
|
||||||
INP_WUNLOCK(inp);
|
INP_WUNLOCK(inp);
|
||||||
@ -539,7 +541,6 @@ tcp_timer_persist(void *xtp)
|
|||||||
#endif
|
#endif
|
||||||
bool progdrop;
|
bool progdrop;
|
||||||
int outrv;
|
int outrv;
|
||||||
CURVNET_SET(tp->t_vnet);
|
|
||||||
#ifdef TCPDEBUG
|
#ifdef TCPDEBUG
|
||||||
int ostate;
|
int ostate;
|
||||||
|
|
||||||
@ -547,6 +548,8 @@ tcp_timer_persist(void *xtp)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
INP_WLOCK(inp);
|
INP_WLOCK(inp);
|
||||||
|
CURVNET_SET(inp->inp_vnet);
|
||||||
|
|
||||||
if (callout_pending(&tp->t_timers->tt_persist) ||
|
if (callout_pending(&tp->t_timers->tt_persist) ||
|
||||||
!callout_active(&tp->t_timers->tt_persist)) {
|
!callout_active(&tp->t_timers->tt_persist)) {
|
||||||
INP_WUNLOCK(inp);
|
INP_WUNLOCK(inp);
|
||||||
@ -619,7 +622,6 @@ tcp_timer_rexmt(void * xtp)
|
|||||||
{
|
{
|
||||||
struct epoch_tracker et;
|
struct epoch_tracker et;
|
||||||
struct tcpcb *tp = xtp;
|
struct tcpcb *tp = xtp;
|
||||||
CURVNET_SET(tp->t_vnet);
|
|
||||||
struct inpcb *inp = tptoinpcb(tp);
|
struct inpcb *inp = tptoinpcb(tp);
|
||||||
int rexmt, outrv;
|
int rexmt, outrv;
|
||||||
bool isipv6;
|
bool isipv6;
|
||||||
@ -630,6 +632,8 @@ tcp_timer_rexmt(void * xtp)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
INP_WLOCK(inp);
|
INP_WLOCK(inp);
|
||||||
|
CURVNET_SET(inp->inp_vnet);
|
||||||
|
|
||||||
if (callout_pending(&tp->t_timers->tt_rexmt) ||
|
if (callout_pending(&tp->t_timers->tt_rexmt) ||
|
||||||
!callout_active(&tp->t_timers->tt_rexmt)) {
|
!callout_active(&tp->t_timers->tt_rexmt)) {
|
||||||
INP_WUNLOCK(inp);
|
INP_WUNLOCK(inp);
|
||||||
@ -1090,8 +1094,8 @@ tcp_timer_discard(void *ptp)
|
|||||||
struct tcpcb *tp = (struct tcpcb *)ptp;
|
struct tcpcb *tp = (struct tcpcb *)ptp;
|
||||||
struct inpcb *inp = tptoinpcb(tp);
|
struct inpcb *inp = tptoinpcb(tp);
|
||||||
|
|
||||||
CURVNET_SET(tp->t_vnet);
|
|
||||||
INP_WLOCK(inp);
|
INP_WLOCK(inp);
|
||||||
|
CURVNET_SET(inp->inp_vnet);
|
||||||
NET_EPOCH_ENTER(et);
|
NET_EPOCH_ENTER(et);
|
||||||
|
|
||||||
KASSERT((tp->t_timers->tt_flags & TT_STOPPED) != 0,
|
KASSERT((tp->t_timers->tt_flags & TT_STOPPED) != 0,
|
||||||
|
@ -181,7 +181,6 @@ struct tcpcb {
|
|||||||
struct mbuf *t_in_pkt;
|
struct mbuf *t_in_pkt;
|
||||||
struct mbuf *t_tail_pkt;
|
struct mbuf *t_tail_pkt;
|
||||||
struct tcp_timer *t_timers; /* All the TCP timers in one struct */
|
struct tcp_timer *t_timers; /* All the TCP timers in one struct */
|
||||||
struct vnet *t_vnet; /* back pointer to parent vnet */
|
|
||||||
uint32_t snd_ssthresh; /* snd_cwnd size threshold for
|
uint32_t snd_ssthresh; /* snd_cwnd size threshold for
|
||||||
* for slow start exponential to
|
* for slow start exponential to
|
||||||
* linear switch
|
* linear switch
|
||||||
|
Loading…
Reference in New Issue
Block a user