mirror of
https://git.FreeBSD.org/src.git
synced 2026-06-02 11:24:32 +00:00
inpcb: retire inp_vnet
Now that a functional inpcb can not outlive its socket, just use socket's vnet pointer.
This commit is contained in:
@@ -1797,7 +1797,7 @@ ktls_reset_send_tag(void *context, int pending)
|
||||
INP_WLOCK(inp);
|
||||
tp = intotcpcb(inp);
|
||||
if (!(tp->t_flags & TF_DISCONNECTED)) {
|
||||
CURVNET_SET(inp->inp_vnet);
|
||||
CURVNET_SET(inp->inp_socket->so_vnet);
|
||||
tp = tcp_drop(tp, ECONNABORTED);
|
||||
CURVNET_RESTORE();
|
||||
if (tp != NULL) {
|
||||
@@ -2475,7 +2475,7 @@ ktls_drop(struct socket *so, int error)
|
||||
NET_EPOCH_ENTER(et);
|
||||
INP_WLOCK(inp);
|
||||
if (!(tp->t_flags & TF_DISCONNECTED)) {
|
||||
CURVNET_SET(inp->inp_vnet);
|
||||
CURVNET_SET(inp->inp_socket->so_vnet);
|
||||
tp = tcp_drop(tp, error);
|
||||
CURVNET_RESTORE();
|
||||
if (tp != NULL)
|
||||
|
||||
@@ -558,9 +558,6 @@ in_pcbinfo_init(struct inpcbinfo *pcbinfo, struct inpcbstorage *pcbstor,
|
||||
|
||||
mtx_init(&pcbinfo->ipi_hash_lock, pcbstor->ips_hashlock_name,
|
||||
NULL, MTX_DEF);
|
||||
#ifdef VIMAGE
|
||||
pcbinfo->ipi_vnet = curvnet;
|
||||
#endif
|
||||
CK_LIST_INIT(&pcbinfo->ipi_list_unconn);
|
||||
pcbinfo->ipi_count = 0;
|
||||
|
||||
|
||||
@@ -299,7 +299,6 @@ struct xktls_session {
|
||||
#include <net/route.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/sysctl.h>
|
||||
#include <net/vnet.h>
|
||||
#include <vm/uma.h>
|
||||
#include <sys/ck.h>
|
||||
|
||||
@@ -418,8 +417,6 @@ struct inpcb {
|
||||
};
|
||||
};
|
||||
|
||||
#define inp_vnet inp_pcbinfo->ipi_vnet
|
||||
|
||||
/*
|
||||
* Per-VNET pcb database for each high-level protocol (UDP, TCP, ...) in both
|
||||
* IPv4 and IPv6.
|
||||
@@ -478,11 +475,6 @@ struct inpcbinfo {
|
||||
* hashed by local port.
|
||||
*/
|
||||
struct inpcblbgrouphead *ipi_lbgrouphashbase; /* (r:e/w:h) */
|
||||
|
||||
/*
|
||||
* Pointer to network stack instance
|
||||
*/
|
||||
struct vnet *ipi_vnet; /* (c) */
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -1359,7 +1359,7 @@ again:
|
||||
*/
|
||||
__tcp_set_hpts(pace, tp);
|
||||
}
|
||||
CURVNET_SET(inp->inp_vnet);
|
||||
CURVNET_SET(inp->inp_socket->so_vnet);
|
||||
/* Lets do any logging that we might want to */
|
||||
tcp_hpts_log(hpts, tp, &tv, slots_to_run, i, from_callout);
|
||||
|
||||
|
||||
@@ -315,7 +315,7 @@ tcp_timer_delack(struct tcpcb *tp)
|
||||
|
||||
INP_WLOCK_ASSERT(inp);
|
||||
|
||||
CURVNET_SET(inp->inp_vnet);
|
||||
CURVNET_SET(inp->inp_socket->so_vnet);
|
||||
tp->t_flags |= TF_ACKNOW;
|
||||
TCPSTAT_INC(tcps_delack);
|
||||
NET_EPOCH_ENTER(et);
|
||||
@@ -335,7 +335,7 @@ tcp_timer_2msl(struct tcpcb *tp)
|
||||
INP_WLOCK_ASSERT(inp);
|
||||
|
||||
TCP_PROBE2(debug__user, tp, PRU_SLOWTIMO);
|
||||
CURVNET_SET(inp->inp_vnet);
|
||||
CURVNET_SET(inp->inp_socket->so_vnet);
|
||||
tcp_log_end_status(tp, TCP_EI_STATUS_2MSL);
|
||||
tcp_free_sackholes(tp);
|
||||
/*
|
||||
@@ -385,7 +385,7 @@ tcp_timer_keep(struct tcpcb *tp)
|
||||
INP_WLOCK_ASSERT(inp);
|
||||
|
||||
TCP_PROBE2(debug__user, tp, PRU_SLOWTIMO);
|
||||
CURVNET_SET(inp->inp_vnet);
|
||||
CURVNET_SET(inp->inp_socket->so_vnet);
|
||||
/*
|
||||
* Because we don't regularly reset the keepalive callout in
|
||||
* the ESTABLISHED state, it may be that we don't actually need
|
||||
@@ -493,7 +493,7 @@ tcp_timer_persist(struct tcpcb *tp)
|
||||
INP_WLOCK_ASSERT(inp);
|
||||
|
||||
TCP_PROBE2(debug__user, tp, PRU_SLOWTIMO);
|
||||
CURVNET_SET(inp->inp_vnet);
|
||||
CURVNET_SET(inp->inp_socket->so_vnet);
|
||||
/*
|
||||
* Persistence timer into zero window.
|
||||
* Force a byte to be output, if possible.
|
||||
@@ -560,7 +560,7 @@ tcp_timer_rexmt(struct tcpcb *tp)
|
||||
INP_WLOCK_ASSERT(inp);
|
||||
|
||||
TCP_PROBE2(debug__user, tp, PRU_SLOWTIMO);
|
||||
CURVNET_SET(inp->inp_vnet);
|
||||
CURVNET_SET(inp->inp_socket->so_vnet);
|
||||
if (tp->t_fb->tfb_tcp_rexmit_tmr) {
|
||||
/* The stack has a timer action too. */
|
||||
(*tp->t_fb->tfb_tcp_rexmit_tmr)(tp);
|
||||
|
||||
Reference in New Issue
Block a user