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

Function schedule_bw_meter

freebsd/netinet/ip_mroute.c:2120–2145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2118 * by linking the entry in the proper hash bucket.
2119 */
2120static void
2121schedule_bw_meter(struct bw_meter *x, struct timeval *nowp)
2122{
2123 int time_hash;
2124
2125 MFC_LOCK_ASSERT();
2126
2127 if (!(x->bm_flags & BW_METER_LEQ))
2128 return; /* XXX: we schedule timers only for "<=" entries */
2129
2130 /*
2131 * Reset the bw_meter entry
2132 */
2133 x->bm_start_time = *nowp;
2134 x->bm_measured.b_packets = 0;
2135 x->bm_measured.b_bytes = 0;
2136 x->bm_flags &= ~BW_METER_UPCALL_DELIVERED;
2137
2138 /*
2139 * Compute the timeout hash value and insert the entry
2140 */
2141 BW_METER_TIMEHASH(x, time_hash);
2142 x->bm_time_next = V_bw_meter_timers[time_hash];
2143 V_bw_meter_timers[time_hash] = x;
2144 x->bm_time_hash = time_hash;
2145}
2146
2147/*
2148 * Unschedule the periodic timer that processes bw_meter entry of type "<="

Callers 3

add_bw_upcallFunction · 0.85
bw_meter_receive_packetFunction · 0.85
bw_meter_processFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected