Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/uipc_ktls.c
Show First 20 Lines • Show All 1,450 Lines • ▼ Show 20 Lines | |||||
int | int | ||||
ktls_modify_txrtlmt(struct ktls_session *tls, uint64_t max_pacing_rate) | ktls_modify_txrtlmt(struct ktls_session *tls, uint64_t max_pacing_rate) | ||||
{ | { | ||||
union if_snd_tag_modify_params params = { | union if_snd_tag_modify_params params = { | ||||
.rate_limit.max_rate = max_pacing_rate, | .rate_limit.max_rate = max_pacing_rate, | ||||
.rate_limit.flags = M_NOWAIT, | .rate_limit.flags = M_NOWAIT, | ||||
}; | }; | ||||
struct m_snd_tag *mst; | struct m_snd_tag *mst; | ||||
struct ifnet *ifp; | |||||
/* Can't get to the inp, but it should be locked. */ | /* Can't get to the inp, but it should be locked. */ | ||||
/* INP_LOCK_ASSERT(inp); */ | /* INP_LOCK_ASSERT(inp); */ | ||||
MPASS(tls->mode == TCP_TLS_MODE_IFNET); | MPASS(tls->mode == TCP_TLS_MODE_IFNET); | ||||
if (tls->snd_tag == NULL) { | if (tls->snd_tag == NULL) { | ||||
/* | /* | ||||
* Resetting send tag, ignore this change. The | * Resetting send tag, ignore this change. The | ||||
* pending reset may or may not see this updated rate | * pending reset may or may not see this updated rate | ||||
* in the tcpcb. If it doesn't, we will just lose | * in the tcpcb. If it doesn't, we will just lose | ||||
* this rate change. | * this rate change. | ||||
*/ | */ | ||||
return (0); | return (0); | ||||
} | } | ||||
MPASS(tls->snd_tag != NULL); | MPASS(tls->snd_tag != NULL); | ||||
MPASS(tls->snd_tag->type == IF_SND_TAG_TYPE_TLS_RATE_LIMIT); | MPASS(tls->snd_tag->type == IF_SND_TAG_TYPE_TLS_RATE_LIMIT); | ||||
mst = tls->snd_tag; | mst = tls->snd_tag; | ||||
ifp = mst->ifp; | return (mst->sw->snd_tag_modify(mst, ¶ms)); | ||||
return (ifp->if_snd_tag_modify(mst, ¶ms)); | |||||
} | } | ||||
#endif | #endif | ||||
#endif | #endif | ||||
void | void | ||||
ktls_destroy(struct ktls_session *tls) | ktls_destroy(struct ktls_session *tls) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 928 Lines • Show Last 20 Lines |