| 1408 | |
| 1409 | #ifdef RATELIMIT |
| 1410 | int |
| 1411 | ktls_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, ¶ms)); |
| 1442 | } |
| 1443 | #endif |
| 1444 | #endif |
| 1445 |
no outgoing calls
no test coverage detected