Lines Matching refs:flow
76 struct atm_flow_data *flow; in lookup_flow() local
78 list_for_each_entry(flow, &p->flows, list) { in lookup_flow()
79 if (flow->common.classid == classid) in lookup_flow()
80 return flow; in lookup_flow()
90 struct atm_flow_data *flow = (struct atm_flow_data *)arg; in atm_tc_graft() local
93 sch, p, flow, new, old); in atm_tc_graft()
94 if (list_empty(&flow->list)) in atm_tc_graft()
98 *old = flow->q; in atm_tc_graft()
99 flow->q = new; in atm_tc_graft()
107 struct atm_flow_data *flow = (struct atm_flow_data *)cl; in atm_tc_leaf() local
109 pr_debug("atm_tc_leaf(sch %p,flow %p)\n", sch, flow); in atm_tc_leaf()
110 return flow ? flow->q : NULL; in atm_tc_leaf()
116 struct atm_flow_data *flow; in atm_tc_find() local
119 flow = lookup_flow(sch, classid); in atm_tc_find()
120 pr_debug("%s: flow %p\n", __func__, flow); in atm_tc_find()
121 return (unsigned long)flow; in atm_tc_find()
128 struct atm_flow_data *flow; in atm_tc_bind_filter() local
131 flow = lookup_flow(sch, classid); in atm_tc_bind_filter()
132 if (flow) in atm_tc_bind_filter()
133 flow->ref++; in atm_tc_bind_filter()
134 pr_debug("%s: flow %p\n", __func__, flow); in atm_tc_bind_filter()
135 return (unsigned long)flow; in atm_tc_bind_filter()
146 struct atm_flow_data *flow = (struct atm_flow_data *)cl; in atm_tc_put() local
148 pr_debug("atm_tc_put(sch %p,[qdisc %p],flow %p)\n", sch, p, flow); in atm_tc_put()
149 if (--flow->ref) in atm_tc_put()
152 list_del_init(&flow->list); in atm_tc_put()
153 pr_debug("atm_tc_put: qdisc %p\n", flow->q); in atm_tc_put()
154 qdisc_put(flow->q); in atm_tc_put()
155 tcf_block_put(flow->block); in atm_tc_put()
156 if (flow->sock) { in atm_tc_put()
158 file_count(flow->sock->file)); in atm_tc_put()
159 flow->vcc->pop = flow->old_pop; in atm_tc_put()
160 sockfd_put(flow->sock); in atm_tc_put()
162 if (flow->excess) in atm_tc_put()
163 atm_tc_put(sch, (unsigned long)flow->excess); in atm_tc_put()
164 if (flow != &p->link) in atm_tc_put()
165 kfree(flow); in atm_tc_put()
200 struct atm_flow_data *flow = (struct atm_flow_data *)*arg; in atm_tc_change() local
209 "flow %p,opt %p)\n", sch, p, classid, parent, flow, opt); in atm_tc_change()
222 if (flow) in atm_tc_change()
281 flow = kzalloc(sizeof(struct atm_flow_data) + hdr_len, GFP_KERNEL); in atm_tc_change()
282 pr_debug("atm_tc_change: flow %p\n", flow); in atm_tc_change()
283 if (!flow) { in atm_tc_change()
288 error = tcf_block_get(&flow->block, &flow->filter_list, sch, in atm_tc_change()
291 kfree(flow); in atm_tc_change()
295 flow->q = qdisc_create_dflt(sch->dev_queue, &pfifo_qdisc_ops, classid, in atm_tc_change()
297 if (!flow->q) in atm_tc_change()
298 flow->q = &noop_qdisc; in atm_tc_change()
299 pr_debug("atm_tc_change: qdisc %p\n", flow->q); in atm_tc_change()
300 flow->sock = sock; in atm_tc_change()
301 flow->vcc = ATM_SD(sock); /* speedup */ in atm_tc_change()
302 flow->vcc->user_back = flow; in atm_tc_change()
303 pr_debug("atm_tc_change: vcc %p\n", flow->vcc); in atm_tc_change()
304 flow->old_pop = flow->vcc->pop; in atm_tc_change()
305 flow->parent = p; in atm_tc_change()
306 flow->vcc->pop = sch_atm_pop; in atm_tc_change()
307 flow->common.classid = classid; in atm_tc_change()
308 flow->ref = 1; in atm_tc_change()
309 flow->excess = excess; in atm_tc_change()
310 list_add(&flow->list, &p->link.list); in atm_tc_change()
311 flow->hdr_len = hdr_len; in atm_tc_change()
313 memcpy(flow->hdr, hdr, hdr_len); in atm_tc_change()
315 memcpy(flow->hdr, llc_oui_ip, sizeof(llc_oui_ip)); in atm_tc_change()
316 *arg = (unsigned long)flow; in atm_tc_change()
326 struct atm_flow_data *flow = (struct atm_flow_data *)arg; in atm_tc_delete() local
328 pr_debug("atm_tc_delete(sch %p,[qdisc %p],flow %p)\n", sch, p, flow); in atm_tc_delete()
329 if (list_empty(&flow->list)) in atm_tc_delete()
331 if (rcu_access_pointer(flow->filter_list) || flow == &p->link) in atm_tc_delete()
337 if (flow->ref < 2) { in atm_tc_delete()
338 pr_err("atm_tc_delete: flow->ref == %d\n", flow->ref); in atm_tc_delete()
341 if (flow->ref > 2) in atm_tc_delete()
350 struct atm_flow_data *flow; in atm_tc_walk() local
355 list_for_each_entry(flow, &p->flows, list) { in atm_tc_walk()
357 walker->fn(sch, (unsigned long)flow, walker) < 0) { in atm_tc_walk()
369 struct atm_flow_data *flow = (struct atm_flow_data *)cl; in atm_tc_tcf_block() local
371 pr_debug("atm_tc_find_tcf(sch %p,[qdisc %p],flow %p)\n", sch, p, flow); in atm_tc_tcf_block()
372 return flow ? flow->block : p->link.block; in atm_tc_tcf_block()
381 struct atm_flow_data *flow; in atm_tc_enqueue() local
388 flow = NULL; in atm_tc_enqueue()
390 !(flow = (struct atm_flow_data *)atm_tc_find(sch, skb->priority))) { in atm_tc_enqueue()
393 list_for_each_entry(flow, &p->flows, list) { in atm_tc_enqueue()
394 fl = rcu_dereference_bh(flow->filter_list); in atm_tc_enqueue()
402 flow = (struct atm_flow_data *)res.class; in atm_tc_enqueue()
403 if (!flow) in atm_tc_enqueue()
404 flow = lookup_flow(sch, res.classid); in atm_tc_enqueue()
408 flow = NULL; in atm_tc_enqueue()
412 if (!flow) { in atm_tc_enqueue()
413 flow = &p->link; in atm_tc_enqueue()
415 if (flow->vcc) in atm_tc_enqueue()
416 ATM_SKB(skb)->atm_options = flow->vcc->atm_options; in atm_tc_enqueue()
429 if (flow->excess) in atm_tc_enqueue()
430 flow = flow->excess; in atm_tc_enqueue()
438 ret = qdisc_enqueue(skb, flow->q, to_free); in atm_tc_enqueue()
443 if (flow) in atm_tc_enqueue()
444 flow->qstats.drops++; in atm_tc_enqueue()
457 if (flow == &p->link) { in atm_tc_enqueue()
476 struct atm_flow_data *flow; in sch_atm_dequeue() local
480 list_for_each_entry(flow, &p->flows, list) { in sch_atm_dequeue()
481 if (flow == &p->link) in sch_atm_dequeue()
487 while ((skb = flow->q->ops->peek(flow->q))) { in sch_atm_dequeue()
488 if (!atm_may_send(flow->vcc, skb->truesize)) in sch_atm_dequeue()
491 skb = qdisc_dequeue_peeked(flow->q); in sch_atm_dequeue()
496 bstats_update(&flow->bstats, skb); in sch_atm_dequeue()
497 pr_debug("atm_tc_dequeue: sending on class %p\n", flow); in sch_atm_dequeue()
500 if (skb_headroom(skb) < flow->hdr_len) { in sch_atm_dequeue()
503 new = skb_realloc_headroom(skb, flow->hdr_len); in sch_atm_dequeue()
511 ATM_SKB(skb)->vcc = flow->vcc; in sch_atm_dequeue()
512 memcpy(skb_push(skb, flow->hdr_len), flow->hdr, in sch_atm_dequeue()
513 flow->hdr_len); in sch_atm_dequeue()
515 &sk_atm(flow->vcc)->sk_wmem_alloc); in sch_atm_dequeue()
517 flow->vcc->send(flow->vcc, skb); in sch_atm_dequeue()
576 struct atm_flow_data *flow; in atm_tc_reset() local
579 list_for_each_entry(flow, &p->flows, list) in atm_tc_reset()
580 qdisc_reset(flow->q); in atm_tc_reset()
587 struct atm_flow_data *flow, *tmp; in atm_tc_destroy() local
590 list_for_each_entry(flow, &p->flows, list) { in atm_tc_destroy()
591 tcf_block_put(flow->block); in atm_tc_destroy()
592 flow->block = NULL; in atm_tc_destroy()
595 list_for_each_entry_safe(flow, tmp, &p->flows, list) { in atm_tc_destroy()
596 if (flow->ref > 1) in atm_tc_destroy()
597 pr_err("atm_destroy: %p->ref = %d\n", flow, flow->ref); in atm_tc_destroy()
598 atm_tc_put(sch, (unsigned long)flow); in atm_tc_destroy()
607 struct atm_flow_data *flow = (struct atm_flow_data *)cl; in atm_tc_dump_class() local
611 sch, p, flow, skb, tcm); in atm_tc_dump_class()
612 if (list_empty(&flow->list)) in atm_tc_dump_class()
614 tcm->tcm_handle = flow->common.classid; in atm_tc_dump_class()
615 tcm->tcm_info = flow->q->handle; in atm_tc_dump_class()
621 if (nla_put(skb, TCA_ATM_HDR, flow->hdr_len, flow->hdr)) in atm_tc_dump_class()
623 if (flow->vcc) { in atm_tc_dump_class()
629 pvc.sap_addr.itf = flow->vcc->dev ? flow->vcc->dev->number : -1; in atm_tc_dump_class()
630 pvc.sap_addr.vpi = flow->vcc->vpi; in atm_tc_dump_class()
631 pvc.sap_addr.vci = flow->vcc->vci; in atm_tc_dump_class()
634 state = ATM_VF2VS(flow->vcc->flags); in atm_tc_dump_class()
638 if (flow->excess) { in atm_tc_dump_class()
639 if (nla_put_u32(skb, TCA_ATM_EXCESS, flow->common.classid)) in atm_tc_dump_class()
655 struct atm_flow_data *flow = (struct atm_flow_data *)arg; in atm_tc_dump_class_stats() local
658 d, NULL, &flow->bstats) < 0 || in atm_tc_dump_class_stats()
659 gnet_stats_copy_queue(d, NULL, &flow->qstats, flow->q->q.qlen) < 0) in atm_tc_dump_class_stats()