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

Function rl_attach_txrtlmt

freebsd/netinet/tcp_ratelimit.c:451–476  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

449#endif
450
451static int
452rl_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, &params, 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
478static void
479populate_canned_table(struct tcp_rate_set *rs, const uint64_t *rate_table_act)

Callers 1

rt_setup_new_rsFunction · 0.85

Calls 2

m_snd_tag_allocFunction · 0.85
counter_u64_addFunction · 0.50

Tested by

no test coverage detected