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()
327 struct atm_flow_data *flow = (struct atm_flow_data *)arg; in atm_tc_delete() local
329 pr_debug("atm_tc_delete(sch %p,[qdisc %p],flow %p)\n", sch, p, flow); in atm_tc_delete()
330 if (list_empty(&flow->list)) in atm_tc_delete()
332 if (rcu_access_pointer(flow->filter_list) || flow == &p->link) in atm_tc_delete()
338 if (flow->ref < 2) { in atm_tc_delete()
339 pr_err("atm_tc_delete: flow->ref == %d\n", flow->ref); in atm_tc_delete()
342 if (flow->ref > 2) in atm_tc_delete()
351 struct atm_flow_data *flow; in atm_tc_walk() local
356 list_for_each_entry(flow, &p->flows, list) { in atm_tc_walk()
358 walker->fn(sch, (unsigned long)flow, walker) < 0) { in atm_tc_walk()
370 struct atm_flow_data *flow = (struct atm_flow_data *)cl; in atm_tc_tcf_block() local
372 pr_debug("atm_tc_find_tcf(sch %p,[qdisc %p],flow %p)\n", sch, p, flow); in atm_tc_tcf_block()
373 return flow ? flow->block : p->link.block; in atm_tc_tcf_block()
382 struct atm_flow_data *flow; in atm_tc_enqueue() local
389 flow = NULL; in atm_tc_enqueue()
391 !(flow = (struct atm_flow_data *)atm_tc_find(sch, skb->priority))) { in atm_tc_enqueue()
394 list_for_each_entry(flow, &p->flows, list) { in atm_tc_enqueue()
395 fl = rcu_dereference_bh(flow->filter_list); in atm_tc_enqueue()
400 flow = (struct atm_flow_data *)res.class; in atm_tc_enqueue()
401 if (!flow) in atm_tc_enqueue()
402 flow = lookup_flow(sch, res.classid); in atm_tc_enqueue()
406 flow = NULL; in atm_tc_enqueue()
410 if (!flow) { in atm_tc_enqueue()
411 flow = &p->link; in atm_tc_enqueue()
413 if (flow->vcc) in atm_tc_enqueue()
414 ATM_SKB(skb)->atm_options = flow->vcc->atm_options; in atm_tc_enqueue()
427 if (flow->excess) in atm_tc_enqueue()
428 flow = flow->excess; in atm_tc_enqueue()
436 ret = qdisc_enqueue(skb, flow->q, to_free); in atm_tc_enqueue()
441 if (flow) in atm_tc_enqueue()
442 flow->qstats.drops++; in atm_tc_enqueue()
455 if (flow == &p->link) { in atm_tc_enqueue()
474 struct atm_flow_data *flow; in sch_atm_dequeue() local
478 list_for_each_entry(flow, &p->flows, list) { in sch_atm_dequeue()
479 if (flow == &p->link) in sch_atm_dequeue()
485 while ((skb = flow->q->ops->peek(flow->q))) { in sch_atm_dequeue()
486 if (!atm_may_send(flow->vcc, skb->truesize)) in sch_atm_dequeue()
489 skb = qdisc_dequeue_peeked(flow->q); in sch_atm_dequeue()
494 bstats_update(&flow->bstats, skb); in sch_atm_dequeue()
495 pr_debug("atm_tc_dequeue: sending on class %p\n", flow); in sch_atm_dequeue()
498 if (skb_headroom(skb) < flow->hdr_len) { in sch_atm_dequeue()
501 new = skb_realloc_headroom(skb, flow->hdr_len); in sch_atm_dequeue()
509 ATM_SKB(skb)->vcc = flow->vcc; in sch_atm_dequeue()
510 memcpy(skb_push(skb, flow->hdr_len), flow->hdr, in sch_atm_dequeue()
511 flow->hdr_len); in sch_atm_dequeue()
513 &sk_atm(flow->vcc)->sk_wmem_alloc); in sch_atm_dequeue()
515 flow->vcc->send(flow->vcc, skb); in sch_atm_dequeue()
575 struct atm_flow_data *flow; in atm_tc_reset() local
578 list_for_each_entry(flow, &p->flows, list) in atm_tc_reset()
579 qdisc_reset(flow->q); in atm_tc_reset()
586 struct atm_flow_data *flow, *tmp; in atm_tc_destroy() local
589 list_for_each_entry(flow, &p->flows, list) { in atm_tc_destroy()
590 tcf_block_put(flow->block); in atm_tc_destroy()
591 flow->block = NULL; in atm_tc_destroy()
594 list_for_each_entry_safe(flow, tmp, &p->flows, list) { in atm_tc_destroy()
595 if (flow->ref > 1) in atm_tc_destroy()
596 pr_err("atm_destroy: %p->ref = %d\n", flow, flow->ref); in atm_tc_destroy()
597 atm_tc_put(sch, (unsigned long)flow); in atm_tc_destroy()
606 struct atm_flow_data *flow = (struct atm_flow_data *)cl; in atm_tc_dump_class() local
610 sch, p, flow, skb, tcm); in atm_tc_dump_class()
611 if (list_empty(&flow->list)) in atm_tc_dump_class()
613 tcm->tcm_handle = flow->common.classid; in atm_tc_dump_class()
614 tcm->tcm_info = flow->q->handle; in atm_tc_dump_class()
620 if (nla_put(skb, TCA_ATM_HDR, flow->hdr_len, flow->hdr)) in atm_tc_dump_class()
622 if (flow->vcc) { in atm_tc_dump_class()
628 pvc.sap_addr.itf = flow->vcc->dev ? flow->vcc->dev->number : -1; in atm_tc_dump_class()
629 pvc.sap_addr.vpi = flow->vcc->vpi; in atm_tc_dump_class()
630 pvc.sap_addr.vci = flow->vcc->vci; in atm_tc_dump_class()
633 state = ATM_VF2VS(flow->vcc->flags); in atm_tc_dump_class()
637 if (flow->excess) { in atm_tc_dump_class()
638 if (nla_put_u32(skb, TCA_ATM_EXCESS, flow->common.classid)) in atm_tc_dump_class()
654 struct atm_flow_data *flow = (struct atm_flow_data *)arg; in atm_tc_dump_class_stats() local
656 if (gnet_stats_copy_basic(d, NULL, &flow->bstats, true) < 0 || in atm_tc_dump_class_stats()
657 gnet_stats_copy_queue(d, NULL, &flow->qstats, flow->q->q.qlen) < 0) in atm_tc_dump_class_stats()