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

Function tcp_rl_ifnet_link

freebsd/netinet/tcp_ratelimit.c:1123–1148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1121}
1122
1123static void
1124tcp_rl_ifnet_link(void *arg __unused, struct ifnet *ifp, int link_state)
1125{
1126 int error;
1127 struct tcp_rate_set *rs;
1128
1129 if (((ifp->if_capenable & IFCAP_TXRTLMT) == 0) ||
1130 (link_state != LINK_STATE_UP)) {
1131 /*
1132 * We only care on an interface going up that is rate-limit
1133 * capable.
1134 */
1135 return;
1136 }
1137 mtx_lock(&rs_mtx);
1138 CK_LIST_FOREACH(rs, &int_rs, next) {
1139 if ((rs->rs_ifp == ifp) &&
1140 (rs->rs_if_dunit == ifp->if_dunit)) {
1141 /* We already have initialized this guy */
1142 mtx_unlock(&rs_mtx);
1143 return;
1144 }
1145 }
1146 mtx_unlock(&rs_mtx);
1147 rt_setup_new_rs(ifp, &error);
1148}
1149
1150static void
1151tcp_rl_ifnet_departure(void *arg __unused, struct ifnet *ifp)

Callers

nothing calls this directly

Calls 3

rt_setup_new_rsFunction · 0.85
mtx_lockFunction · 0.50
mtx_unlockFunction · 0.50

Tested by

no test coverage detected