Lines Matching refs:pi

41 static int t4_sched_class_fw_cmd(struct port_info *pi,  in t4_sched_class_fw_cmd()  argument
45 struct adapter *adap = pi->adapter; in t4_sched_class_fw_cmd()
46 struct sched_table *s = pi->sched_tbl; in t4_sched_class_fw_cmd()
71 static int t4_sched_bind_unbind_op(struct port_info *pi, void *arg, in t4_sched_bind_unbind_op() argument
74 struct adapter *adap = pi->adapter; in t4_sched_bind_unbind_op()
108 err = cxgb4_ethofld_send_flowc(adap->port[pi->port_id], in t4_sched_bind_unbind_op()
120 static void *t4_sched_entry_lookup(struct port_info *pi, in t4_sched_entry_lookup() argument
124 struct sched_table *s = pi->sched_tbl; in t4_sched_entry_lookup()
172 struct port_info *pi = netdev2pinfo(dev); in cxgb4_sched_queue_lookup() local
174 struct adapter *adap = pi->adapter; in cxgb4_sched_queue_lookup()
177 if (p->queue < 0 || p->queue >= pi->nqsets) in cxgb4_sched_queue_lookup()
180 txq = &adap->sge.ethtxq[pi->first_qset + p->queue]; in cxgb4_sched_queue_lookup()
181 qe = t4_sched_entry_lookup(pi, SCHED_QUEUE, txq->q.cntxt_id); in cxgb4_sched_queue_lookup()
182 return qe ? &pi->sched_tbl->tab[qe->param.class] : NULL; in cxgb4_sched_queue_lookup()
185 static int t4_sched_queue_unbind(struct port_info *pi, struct ch_sched_queue *p) in t4_sched_queue_unbind() argument
188 struct adapter *adap = pi->adapter; in t4_sched_queue_unbind()
193 if (p->queue < 0 || p->queue >= pi->nqsets) in t4_sched_queue_unbind()
196 txq = &adap->sge.ethtxq[pi->first_qset + p->queue]; in t4_sched_queue_unbind()
199 qe = t4_sched_entry_lookup(pi, SCHED_QUEUE, txq->q.cntxt_id); in t4_sched_queue_unbind()
201 err = t4_sched_bind_unbind_op(pi, (void *)qe, SCHED_QUEUE, in t4_sched_queue_unbind()
206 e = &pi->sched_tbl->tab[qe->param.class]; in t4_sched_queue_unbind()
210 cxgb4_sched_class_free(adap->port[pi->port_id], e->idx); in t4_sched_queue_unbind()
215 static int t4_sched_queue_bind(struct port_info *pi, struct ch_sched_queue *p) in t4_sched_queue_bind() argument
217 struct sched_table *s = pi->sched_tbl; in t4_sched_queue_bind()
219 struct adapter *adap = pi->adapter; in t4_sched_queue_bind()
225 if (p->queue < 0 || p->queue >= pi->nqsets) in t4_sched_queue_bind()
232 txq = &adap->sge.ethtxq[pi->first_qset + p->queue]; in t4_sched_queue_bind()
236 err = t4_sched_queue_unbind(pi, p); in t4_sched_queue_bind()
245 err = t4_sched_bind_unbind_op(pi, (void *)qe, SCHED_QUEUE, true); in t4_sched_queue_bind()
259 static int t4_sched_flowc_unbind(struct port_info *pi, struct ch_sched_flowc *p) in t4_sched_flowc_unbind() argument
262 struct adapter *adap = pi->adapter; in t4_sched_flowc_unbind()
270 fe = t4_sched_entry_lookup(pi, SCHED_FLOWC, p->tid); in t4_sched_flowc_unbind()
272 err = t4_sched_bind_unbind_op(pi, (void *)fe, SCHED_FLOWC, in t4_sched_flowc_unbind()
277 e = &pi->sched_tbl->tab[fe->param.class]; in t4_sched_flowc_unbind()
281 cxgb4_sched_class_free(adap->port[pi->port_id], e->idx); in t4_sched_flowc_unbind()
286 static int t4_sched_flowc_bind(struct port_info *pi, struct ch_sched_flowc *p) in t4_sched_flowc_bind() argument
288 struct sched_table *s = pi->sched_tbl; in t4_sched_flowc_bind()
290 struct adapter *adap = pi->adapter; in t4_sched_flowc_bind()
302 err = t4_sched_flowc_unbind(pi, p); in t4_sched_flowc_bind()
310 err = t4_sched_bind_unbind_op(pi, (void *)fe, SCHED_FLOWC, true); in t4_sched_flowc_bind()
324 static void t4_sched_class_unbind_all(struct port_info *pi, in t4_sched_class_unbind_all() argument
336 t4_sched_queue_unbind(pi, &qe->param); in t4_sched_class_unbind_all()
343 t4_sched_flowc_unbind(pi, &fe->param); in t4_sched_class_unbind_all()
351 static int t4_sched_class_bind_unbind_op(struct port_info *pi, void *arg, in t4_sched_class_bind_unbind_op() argument
364 err = t4_sched_queue_bind(pi, qe); in t4_sched_class_bind_unbind_op()
366 err = t4_sched_queue_unbind(pi, qe); in t4_sched_class_bind_unbind_op()
373 err = t4_sched_flowc_bind(pi, fe); in t4_sched_class_bind_unbind_op()
375 err = t4_sched_flowc_unbind(pi, fe); in t4_sched_class_bind_unbind_op()
399 struct port_info *pi = netdev2pinfo(dev); in cxgb4_sched_class_bind() local
431 return t4_sched_class_bind_unbind_op(pi, arg, type, true); in cxgb4_sched_class_bind()
446 struct port_info *pi = netdev2pinfo(dev); in cxgb4_sched_class_unbind() local
475 return t4_sched_class_bind_unbind_op(pi, arg, type, false); in cxgb4_sched_class_unbind()
479 static struct sched_class *t4_sched_class_lookup(struct port_info *pi, in t4_sched_class_lookup() argument
482 struct sched_table *s = pi->sched_tbl; in t4_sched_class_lookup()
525 static struct sched_class *t4_sched_class_alloc(struct port_info *pi, in t4_sched_class_alloc() argument
548 e = t4_sched_class_lookup(pi, p); in t4_sched_class_alloc()
554 e = t4_sched_class_lookup(pi, NULL); in t4_sched_class_alloc()
561 err = t4_sched_class_fw_cmd(pi, &np, SCHED_FW_OP_ADD); in t4_sched_class_alloc()
585 struct port_info *pi = netdev2pinfo(dev); in cxgb4_sched_class_alloc() local
595 return t4_sched_class_alloc(pi, p); in cxgb4_sched_class_alloc()
607 struct port_info *pi = netdev2pinfo(dev); in cxgb4_sched_class_free() local
608 struct sched_table *s = pi->sched_tbl; in cxgb4_sched_class_free()
630 ret = t4_get_link_params(pi, NULL, &speed, NULL); in cxgb4_sched_class_free()
636 t4_sched_class_fw_cmd(pi, &p, SCHED_FW_OP_DEL); in cxgb4_sched_class_free()
645 struct port_info *pi = netdev2pinfo(dev); in t4_sched_class_free() local
647 t4_sched_class_unbind_all(pi, e, e->bind_type); in t4_sched_class_free()
678 struct port_info *pi = netdev2pinfo(adap->port[j]); in t4_cleanup_sched() local
680 s = pi->sched_tbl; in t4_cleanup_sched()