| 449 | #endif |
| 450 | |
| 451 | static int |
| 452 | rl_attach_txrtlmt(struct ifnet *ifp, |
| 453 | uint32_t flowtype, |
| 454 | int flowid, |
| 455 | uint64_t cfg_rate, |
| 456 | struct m_snd_tag **tag) |
| 457 | { |
| 458 | int error; |
| 459 | union if_snd_tag_alloc_params params = { |
| 460 | .rate_limit.hdr.type = IF_SND_TAG_TYPE_RATE_LIMIT, |
| 461 | .rate_limit.hdr.flowid = flowid, |
| 462 | .rate_limit.hdr.flowtype = flowtype, |
| 463 | .rate_limit.max_rate = cfg_rate, |
| 464 | .rate_limit.flags = M_NOWAIT, |
| 465 | }; |
| 466 | |
| 467 | error = m_snd_tag_alloc(ifp, ¶ms, tag); |
| 468 | #ifdef INET |
| 469 | if (error == 0) { |
| 470 | counter_u64_add(rate_limit_set_ok, 1); |
| 471 | counter_u64_add(rate_limit_active, 1); |
| 472 | } else if (error != EOPNOTSUPP) |
| 473 | counter_u64_add(rate_limit_alloc_fail, 1); |
| 474 | #endif |
| 475 | return (error); |
| 476 | } |
| 477 | |
| 478 | static void |
| 479 | populate_canned_table(struct tcp_rate_set *rs, const uint64_t *rate_table_act) |
no test coverage detected