Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/uipc_ktls.c
Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | |||||
#if defined(__aarch64__) || defined(__amd64__) || defined(__i386__) | #if defined(__aarch64__) || defined(__amd64__) || defined(__i386__) | ||||
#include <machine/pcb.h> | #include <machine/pcb.h> | ||||
#endif | #endif | ||||
#include <machine/vmparam.h> | #include <machine/vmparam.h> | ||||
#include <net/if.h> | #include <net/if.h> | ||||
#include <net/if_var.h> | #include <net/if_var.h> | ||||
#ifdef RSS | #ifdef RSS | ||||
#include <net/netisr.h> | #include <net/netisr.h> | ||||
#include <net/nhop.h> | |||||
#include <net/rss_config.h> | #include <net/rss_config.h> | ||||
#endif | #endif | ||||
#if defined(INET) || defined(INET6) | #if defined(INET) || defined(INET6) | ||||
#include <netinet/in.h> | #include <netinet/in.h> | ||||
#include <netinet/in_pcb.h> | #include <netinet/in_pcb.h> | ||||
#endif | #endif | ||||
#include <netinet/tcp_var.h> | #include <netinet/tcp_var.h> | ||||
#ifdef TCP_OFFLOAD | #ifdef TCP_OFFLOAD | ||||
▲ Show 20 Lines • Show All 680 Lines • ▼ Show 20 Lines | |||||
* the connection is currently routed over. | * the connection is currently routed over. | ||||
*/ | */ | ||||
static int | static int | ||||
ktls_alloc_snd_tag(struct inpcb *inp, struct ktls_session *tls, bool force, | ktls_alloc_snd_tag(struct inpcb *inp, struct ktls_session *tls, bool force, | ||||
struct m_snd_tag **mstp) | struct m_snd_tag **mstp) | ||||
{ | { | ||||
union if_snd_tag_alloc_params params; | union if_snd_tag_alloc_params params; | ||||
struct ifnet *ifp; | struct ifnet *ifp; | ||||
struct rtentry *rt; | struct nhop_object *nh; | ||||
struct tcpcb *tp; | struct tcpcb *tp; | ||||
int error; | int error; | ||||
INP_RLOCK(inp); | INP_RLOCK(inp); | ||||
if (inp->inp_flags2 & INP_FREED) { | if (inp->inp_flags2 & INP_FREED) { | ||||
INP_RUNLOCK(inp); | INP_RUNLOCK(inp); | ||||
return (ECONNRESET); | return (ECONNRESET); | ||||
} | } | ||||
Show All 21 Lines | ktls_alloc_snd_tag(struct inpcb *inp, struct ktls_session *tls, bool force, | ||||
/* | /* | ||||
* XXX: Use the cached route in the inpcb to find the | * XXX: Use the cached route in the inpcb to find the | ||||
* interface. This should perhaps instead use | * interface. This should perhaps instead use | ||||
* rtalloc1_fib(dst, 0, 0, fibnum). Since KTLS is only | * rtalloc1_fib(dst, 0, 0, fibnum). Since KTLS is only | ||||
* enabled after a connection has completed key negotiation in | * enabled after a connection has completed key negotiation in | ||||
* userland, the cached route will be present in practice. | * userland, the cached route will be present in practice. | ||||
*/ | */ | ||||
rt = inp->inp_route.ro_rt; | nh = inp->inp_route.ro_nh; | ||||
if (rt == NULL || rt->rt_ifp == NULL) { | if (nh == NULL) { | ||||
INP_RUNLOCK(inp); | INP_RUNLOCK(inp); | ||||
return (ENXIO); | return (ENXIO); | ||||
} | } | ||||
ifp = rt->rt_ifp; | ifp = nh->nh_ifp; | ||||
if_ref(ifp); | if_ref(ifp); | ||||
params.hdr.type = IF_SND_TAG_TYPE_TLS; | params.hdr.type = IF_SND_TAG_TYPE_TLS; | ||||
params.hdr.flowid = inp->inp_flowid; | params.hdr.flowid = inp->inp_flowid; | ||||
params.hdr.flowtype = inp->inp_flowtype; | params.hdr.flowtype = inp->inp_flowtype; | ||||
params.hdr.numa_domain = inp->inp_numa_domain; | params.hdr.numa_domain = inp->inp_numa_domain; | ||||
params.tls.inp = inp; | params.tls.inp = inp; | ||||
params.tls.tls = tls; | params.tls.tls = tls; | ||||
▲ Show 20 Lines • Show All 779 Lines • Show Last 20 Lines |