Lines Matching refs:flow
32 * Each flow has a CoDel managed queue.
36 * For a given flow, packets are not reordered (CoDel uses a FIFO)
39 * Low memory footprint (64 bytes per flow)
116 static inline struct sk_buff *dequeue_head(struct fq_codel_flow *flow)
118 struct sk_buff *skb = flow->head;
120 flow->head = skb->next;
125 /* add skb to flow queue (tail add) */
126 static inline void flow_queue_add(struct fq_codel_flow *flow,
129 if (flow->head == NULL)
130 flow->head = skb;
132 flow->tail->next = skb;
133 flow->tail = skb;
143 struct fq_codel_flow *flow;
147 /* Queue is full! Find the fat flow and drop packet(s) from it.
151 * In stress mode, we'll try to drop 64 packets from the flow,
161 /* Our goal is to drop half of this fat flow backlog */
164 flow = &q->flows[idx];
168 skb = dequeue_head(flow);
176 flow->cvars.count += i;
190 struct fq_codel_flow *flow;
205 flow = &q->flows[idx];
206 flow_queue_add(flow, skb);
210 if (list_empty(&flow->flowchain)) {
211 list_add_tail(&flow->flowchain, &q->new_flows);
213 flow->deficit = q->quantum;
227 * in q->backlogs[] to find a fat flow.
240 * If we dropped a packet for this flow, return NET_XMIT_CN,
260 struct fq_codel_flow *flow;
263 flow = container_of(vars, struct fq_codel_flow, cvars);
264 if (flow->head) {
265 skb = dequeue_head(flow);
266 q->backlogs[flow - q->flows] -= qdisc_pkt_len(skb);
286 struct fq_codel_flow *flow;
296 flow = list_first_entry(head, struct fq_codel_flow, flowchain);
298 if (flow->deficit <= 0) {
299 flow->deficit += q->quantum;
300 list_move_tail(&flow->flowchain, &q->old_flows);
305 &flow->cvars, &q->cstats, qdisc_pkt_len,
311 list_move_tail(&flow->flowchain, &q->old_flows);
313 list_del_init(&flow->flowchain);
317 flow->deficit -= qdisc_pkt_len(skb);
328 static void fq_codel_flow_purge(struct fq_codel_flow *flow)
330 rtnl_kfree_skbs(flow->head, flow->tail);
331 flow->head = NULL;
342 struct fq_codel_flow *flow = q->flows + i;
344 fq_codel_flow_purge(flow);
345 INIT_LIST_HEAD(&flow->flowchain);
346 codel_vars_init(&flow->cvars);
512 struct fq_codel_flow *flow = q->flows + i;
514 INIT_LIST_HEAD(&flow->flowchain);
515 codel_vars_init(&flow->cvars);
655 const struct fq_codel_flow *flow = &q->flows[idx];
660 xstats.class_stats.deficit = flow->deficit;
662 codel_time_to_us(flow->cvars.ldelay);
663 xstats.class_stats.count = flow->cvars.count;
664 xstats.class_stats.lastcount = flow->cvars.lastcount;
665 xstats.class_stats.dropping = flow->cvars.dropping;
666 if (flow->cvars.dropping) {
667 codel_tdiff_t delta = flow->cvars.drop_next -
674 if (flow->head) {
676 skb = flow->head;