Lines Matching full:flow

20  * buckets. Initially, a new flow starts as non-heavy-hitter. Once classified
37 * - For a heavy-hitter flow: *all* of its k array counters must be large.
38 * - For a non-heavy-hitter flow: some of its k array counters can be large
59 * Once a flow is classified as heavy-hitter, we also save its per-flow state
60 * in an exact-matching flow table so that its subsequent packets can be
66 * - If the flow-id of p (e.g., TCP 5-tuple) is already in the exact-matching
67 * heavy-hitter flow table, denoted table T, then send p to the heavy-hitter
70 * + If F decides that p belongs to a non-heavy-hitter flow, then send p
72 * + Otherwise, if F decides that p belongs to a new heavy-hitter flow,
73 * then set up a new flow entry for the flow-id of p in the table T and
112 /* Heavy-hitter per-flow state */
114 u32 hash_id; /* hash of flow-id (e.g. TCP 5-tuple) */
179 /* Looks up a heavy-hitter flow in a chaining list of table T. */
184 struct hh_flow_state *flow, *next; in seek_list() local
190 list_for_each_entry_safe(flow, next, head, flowchain) { in seek_list()
191 u32 prev = flow->hit_timestamp + q->hhf_evict_timeout; in seek_list()
197 if (list_is_last(&flow->flowchain, head)) in seek_list()
199 list_del(&flow->flowchain); in seek_list()
200 kfree(flow); in seek_list()
202 } else if (flow->hash_id == hash) { in seek_list()
203 return flow; in seek_list()
209 /* Returns a flow state entry for a new heavy-hitter. Either reuses an expired
215 struct hh_flow_state *flow; in alloc_new_hh() local
219 /* Find an expired heavy-hitter flow entry. */ in alloc_new_hh()
220 list_for_each_entry(flow, head, flowchain) { in alloc_new_hh()
221 u32 prev = flow->hit_timestamp + q->hhf_evict_timeout; in alloc_new_hh()
224 return flow; in alloc_new_hh()
233 flow = kzalloc(sizeof(struct hh_flow_state), GFP_ATOMIC); in alloc_new_hh()
234 if (!flow) in alloc_new_hh()
238 INIT_LIST_HEAD(&flow->flowchain); in alloc_new_hh()
239 list_add_tail(&flow->flowchain, head); in alloc_new_hh()
241 return flow; in alloc_new_hh()
252 struct hh_flow_state *flow; in hhf_classify() local
266 /* Get hashed flow-id of the skb. */ in hhf_classify()
269 /* Check if this packet belongs to an already established HH flow. */ in hhf_classify()
271 flow = seek_list(hash, &q->hh_flows[flow_pos], q); in hhf_classify()
272 if (flow) { /* found its HH flow */ in hhf_classify()
273 flow->hit_timestamp = now; in hhf_classify()
307 flow = alloc_new_hh(&q->hh_flows[flow_pos], q); in hhf_classify()
308 if (!flow) /* memory alloc problem */ in hhf_classify()
310 flow->hash_id = hash; in hhf_classify()
311 flow->hit_timestamp = now; in hhf_classify()
485 struct hh_flow_state *flow, *next; in hhf_destroy() local
490 list_for_each_entry_safe(flow, next, head, flowchain) { in hhf_destroy()
491 list_del(&flow->flowchain); in hhf_destroy()
492 kfree(flow); in hhf_destroy()
600 /* Initialize heavy-hitter flow table. */ in hhf_init()