| 2118 | * by linking the entry in the proper hash bucket. |
| 2119 | */ |
| 2120 | static void |
| 2121 | schedule_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 "<=" |
no outgoing calls
no test coverage detected