Lines Matching refs:adap
13 struct adapter *adap = netdev2adap(dev); in cxgb4_mqprio_validate() local
31 } else if (mqprio->qopt.num_tc > adap->params.nsched_cls) { in cxgb4_mqprio_validate()
34 adap->params.nsched_cls); in cxgb4_mqprio_validate()
81 if (qoffset >= adap->tids.neotids || qcount > adap->tids.neotids) in cxgb4_mqprio_validate()
98 struct adapter *adap = netdev2adap(dev); in cxgb4_init_eosw_txq() local
113 eosw_txq->hwtid = adap->tids.eotid_base + eosw_txq->eotid; in cxgb4_init_eosw_txq()
114 eosw_txq->cred = adap->params.ofldq_wr_cred; in cxgb4_init_eosw_txq()
124 struct adapter *adap = netdev2adap(dev); in cxgb4_clean_eosw_txq() local
126 cxgb4_eosw_txq_free_desc(adap, eosw_txq, eosw_txq->ndesc); in cxgb4_clean_eosw_txq()
133 eosw_txq->cred = adap->params.ofldq_wr_cred; in cxgb4_clean_eosw_txq()
152 struct adapter *adap = netdev2adap(dev); in cxgb4_mqprio_alloc_hw_resources() local
159 if (!refcount_read(&adap->tc_mqprio->refcnt)) { in cxgb4_mqprio_alloc_hw_resources()
160 adap->sge.eohw_rxq = kcalloc(adap->sge.eoqsets, in cxgb4_mqprio_alloc_hw_resources()
163 if (!adap->sge.eohw_rxq) in cxgb4_mqprio_alloc_hw_resources()
166 adap->sge.eohw_txq = kcalloc(adap->sge.eoqsets, in cxgb4_mqprio_alloc_hw_resources()
169 if (!adap->sge.eohw_txq) { in cxgb4_mqprio_alloc_hw_resources()
170 kfree(adap->sge.eohw_rxq); in cxgb4_mqprio_alloc_hw_resources()
174 refcount_set(&adap->tc_mqprio->refcnt, 1); in cxgb4_mqprio_alloc_hw_resources()
176 refcount_inc(&adap->tc_mqprio->refcnt); in cxgb4_mqprio_alloc_hw_resources()
179 if (!(adap->flags & CXGB4_USING_MSIX)) in cxgb4_mqprio_alloc_hw_resources()
180 msix = -((int)adap->sge.intrq.abs_id + 1); in cxgb4_mqprio_alloc_hw_resources()
183 eorxq = &adap->sge.eohw_rxq[pi->first_qset + i]; in cxgb4_mqprio_alloc_hw_resources()
184 eotxq = &adap->sge.eohw_txq[pi->first_qset + i]; in cxgb4_mqprio_alloc_hw_resources()
188 msix = cxgb4_get_msix_idx_from_bmap(adap); in cxgb4_mqprio_alloc_hw_resources()
194 eorxq->msix = &adap->msix_info[msix]; in cxgb4_mqprio_alloc_hw_resources()
200 init_rspq(adap, &eorxq->rspq, in cxgb4_mqprio_alloc_hw_resources()
208 ret = t4_sge_alloc_rxq(adap, &eorxq->rspq, false, in cxgb4_mqprio_alloc_hw_resources()
217 ret = t4_sge_alloc_ethofld_txq(adap, eotxq, dev, in cxgb4_mqprio_alloc_hw_resources()
223 if (adap->flags & CXGB4_USING_MSIX) { in cxgb4_mqprio_alloc_hw_resources()
229 cxgb4_set_msix_aff(adap, eorxq->msix->vec, in cxgb4_mqprio_alloc_hw_resources()
233 if (adap->flags & CXGB4_FULL_INIT_DONE) in cxgb4_mqprio_alloc_hw_resources()
234 cxgb4_enable_rx(adap, &eorxq->rspq); in cxgb4_mqprio_alloc_hw_resources()
241 eorxq = &adap->sge.eohw_rxq[pi->first_qset + i]; in cxgb4_mqprio_alloc_hw_resources()
243 if (adap->flags & CXGB4_FULL_INIT_DONE) in cxgb4_mqprio_alloc_hw_resources()
246 if (adap->flags & CXGB4_USING_MSIX) { in cxgb4_mqprio_alloc_hw_resources()
255 eorxq = &adap->sge.eohw_rxq[pi->first_qset + i]; in cxgb4_mqprio_alloc_hw_resources()
256 eotxq = &adap->sge.eohw_txq[pi->first_qset + i]; in cxgb4_mqprio_alloc_hw_resources()
259 free_rspq_fl(adap, &eorxq->rspq, &eorxq->fl); in cxgb4_mqprio_alloc_hw_resources()
261 cxgb4_free_msix_idx_in_bmap(adap, eorxq->msix->idx); in cxgb4_mqprio_alloc_hw_resources()
262 t4_sge_free_ethofld_txq(adap, eotxq); in cxgb4_mqprio_alloc_hw_resources()
265 if (refcount_dec_and_test(&adap->tc_mqprio->refcnt)) { in cxgb4_mqprio_alloc_hw_resources()
266 kfree(adap->sge.eohw_txq); in cxgb4_mqprio_alloc_hw_resources()
267 kfree(adap->sge.eohw_rxq); in cxgb4_mqprio_alloc_hw_resources()
275 struct adapter *adap = netdev2adap(dev); in cxgb4_mqprio_free_hw_resources() local
281 if (!refcount_read(&adap->tc_mqprio->refcnt)) in cxgb4_mqprio_free_hw_resources()
285 if (!adap->sge.eohw_rxq[pi->first_qset].rspq.desc) in cxgb4_mqprio_free_hw_resources()
289 eorxq = &adap->sge.eohw_rxq[pi->first_qset + i]; in cxgb4_mqprio_free_hw_resources()
290 eotxq = &adap->sge.eohw_txq[pi->first_qset + i]; in cxgb4_mqprio_free_hw_resources()
296 if (!(adap->flags & CXGB4_SHUTTING_DOWN)) in cxgb4_mqprio_free_hw_resources()
299 if (adap->flags & CXGB4_USING_MSIX) { in cxgb4_mqprio_free_hw_resources()
303 cxgb4_free_msix_idx_in_bmap(adap, eorxq->msix->idx); in cxgb4_mqprio_free_hw_resources()
306 free_rspq_fl(adap, &eorxq->rspq, &eorxq->fl); in cxgb4_mqprio_free_hw_resources()
307 t4_sge_free_ethofld_txq(adap, eotxq); in cxgb4_mqprio_free_hw_resources()
311 if (refcount_dec_and_test(&adap->tc_mqprio->refcnt)) { in cxgb4_mqprio_free_hw_resources()
312 kfree(adap->sge.eohw_txq); in cxgb4_mqprio_free_hw_resources()
313 kfree(adap->sge.eohw_rxq); in cxgb4_mqprio_free_hw_resources()
332 struct adapter *adap = netdev2adap(dev); in cxgb4_mqprio_alloc_tc() local
337 tc_port_mqprio = &adap->tc_mqprio->port_mqprio[pi->port_id]; in cxgb4_mqprio_alloc_tc()
373 struct adapter *adap = netdev2adap(dev); in cxgb4_mqprio_free_tc() local
376 tc_port_mqprio = &adap->tc_mqprio->port_mqprio[pi->port_id]; in cxgb4_mqprio_free_tc()
409 struct adapter *adap = netdev2adap(dev); in cxgb4_mqprio_class_unbind() local
415 if (!(adap->flags & CXGB4_SHUTTING_DOWN)) in cxgb4_mqprio_class_unbind()
422 if (!(adap->flags & CXGB4_SHUTTING_DOWN)) in cxgb4_mqprio_class_unbind()
433 struct adapter *adap = netdev2adap(dev); in cxgb4_mqprio_enable_offload() local
443 tc_port_mqprio = &adap->tc_mqprio->port_mqprio[pi->port_id]; in cxgb4_mqprio_enable_offload()
448 eotid = cxgb4_get_free_eotid(&adap->tids); in cxgb4_mqprio_enable_offload()
462 cxgb4_alloc_eotid(&adap->tids, eotid, eosw_txq); in cxgb4_mqprio_enable_offload()
522 cxgb4_free_eotid(&adap->tids, eosw_txq->eotid); in cxgb4_mqprio_enable_offload()
535 struct adapter *adap = netdev2adap(dev); in cxgb4_mqprio_disable_offload() local
541 tc_port_mqprio = &adap->tc_mqprio->port_mqprio[pi->port_id]; in cxgb4_mqprio_disable_offload()
557 cxgb4_free_eotid(&adap->tids, eosw_txq->eotid); in cxgb4_mqprio_disable_offload()
576 struct adapter *adap = netdev2adap(dev); in cxgb4_setup_tc_mqprio() local
584 mutex_lock(&adap->tc_mqprio->mqprio_mutex); in cxgb4_setup_tc_mqprio()
624 mutex_unlock(&adap->tc_mqprio->mqprio_mutex); in cxgb4_setup_tc_mqprio()
628 void cxgb4_mqprio_stop_offload(struct adapter *adap) in cxgb4_mqprio_stop_offload() argument
634 if (!adap->tc_mqprio || !adap->tc_mqprio->port_mqprio) in cxgb4_mqprio_stop_offload()
637 mutex_lock(&adap->tc_mqprio->mqprio_mutex); in cxgb4_mqprio_stop_offload()
638 for_each_port(adap, i) { in cxgb4_mqprio_stop_offload()
639 dev = adap->port[i]; in cxgb4_mqprio_stop_offload()
643 tc_port_mqprio = &adap->tc_mqprio->port_mqprio[i]; in cxgb4_mqprio_stop_offload()
649 mutex_unlock(&adap->tc_mqprio->mqprio_mutex); in cxgb4_mqprio_stop_offload()
652 int cxgb4_init_tc_mqprio(struct adapter *adap) in cxgb4_init_tc_mqprio() argument
664 tc_port_mqprio = kcalloc(adap->params.nports, sizeof(*tc_port_mqprio), in cxgb4_init_tc_mqprio()
674 for (i = 0; i < adap->params.nports; i++) { in cxgb4_init_tc_mqprio()
676 eosw_txq = kcalloc(adap->tids.neotids, sizeof(*eosw_txq), in cxgb4_init_tc_mqprio()
685 adap->tc_mqprio = tc_mqprio; in cxgb4_init_tc_mqprio()
686 refcount_set(&adap->tc_mqprio->refcnt, 0); in cxgb4_init_tc_mqprio()
690 for (i = 0; i < adap->params.nports; i++) { in cxgb4_init_tc_mqprio()
701 void cxgb4_cleanup_tc_mqprio(struct adapter *adap) in cxgb4_cleanup_tc_mqprio() argument
706 if (adap->tc_mqprio) { in cxgb4_cleanup_tc_mqprio()
707 mutex_lock(&adap->tc_mqprio->mqprio_mutex); in cxgb4_cleanup_tc_mqprio()
708 if (adap->tc_mqprio->port_mqprio) { in cxgb4_cleanup_tc_mqprio()
709 for (i = 0; i < adap->params.nports; i++) { in cxgb4_cleanup_tc_mqprio()
710 struct net_device *dev = adap->port[i]; in cxgb4_cleanup_tc_mqprio()
714 port_mqprio = &adap->tc_mqprio->port_mqprio[i]; in cxgb4_cleanup_tc_mqprio()
717 kfree(adap->tc_mqprio->port_mqprio); in cxgb4_cleanup_tc_mqprio()
719 mutex_unlock(&adap->tc_mqprio->mqprio_mutex); in cxgb4_cleanup_tc_mqprio()
720 kfree(adap->tc_mqprio); in cxgb4_cleanup_tc_mqprio()