MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ktls_modify_txrtlmt

Function ktls_modify_txrtlmt

freebsd/kern/uipc_ktls.c:1410–1442  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1408
1409#ifdef RATELIMIT
1410int
1411ktls_modify_txrtlmt(struct ktls_session *tls, uint64_t max_pacing_rate)
1412{
1413 union if_snd_tag_modify_params params = {
1414 .rate_limit.max_rate = max_pacing_rate,
1415 .rate_limit.flags = M_NOWAIT,
1416 };
1417 struct m_snd_tag *mst;
1418 struct ifnet *ifp;
1419 int error;
1420
1421 /* Can't get to the inp, but it should be locked. */
1422 /* INP_LOCK_ASSERT(inp); */
1423
1424 MPASS(tls->mode == TCP_TLS_MODE_IFNET);
1425
1426 if (tls->snd_tag == NULL) {
1427 /*
1428 * Resetting send tag, ignore this change. The
1429 * pending reset may or may not see this updated rate
1430 * in the tcpcb. If it doesn't, we will just lose
1431 * this rate change.
1432 */
1433 return (0);
1434 }
1435
1436 MPASS(tls->snd_tag != NULL);
1437 MPASS(tls->snd_tag->type == IF_SND_TAG_TYPE_TLS_RATE_LIMIT);
1438
1439 mst = tls->snd_tag;
1440 ifp = mst->ifp;
1441 return (ifp->if_snd_tag_modify(mst, &params));
1442}
1443#endif
1444#endif
1445

Callers 1

tcp_chg_pacing_rateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected