Lines Matching refs:ets
39 static int bnxt_hwrm_queue_pri2cos_cfg(struct bnxt *bp, struct ieee_ets *ets) in bnxt_hwrm_queue_pri2cos_cfg() argument
56 qidx = bp->tc_to_qidx[ets->prio_tc[i]]; in bnxt_hwrm_queue_pri2cos_cfg()
63 static int bnxt_hwrm_queue_pri2cos_qcfg(struct bnxt *bp, struct ieee_ets *ets) in bnxt_hwrm_queue_pri2cos_qcfg() argument
84 ets->prio_tc[i] = tc; in bnxt_hwrm_queue_pri2cos_qcfg()
91 static int bnxt_hwrm_queue_cos2bw_cfg(struct bnxt *bp, struct ieee_ets *ets, in bnxt_hwrm_queue_cos2bw_cfg() argument
109 if (ets->tc_tsa[i] == IEEE_8021QAZ_TSA_STRICT) { in bnxt_hwrm_queue_cos2bw_cfg()
116 cos2bw.bw_weight = ets->tc_tx_bw[i]; in bnxt_hwrm_queue_cos2bw_cfg()
121 cpu_to_le32((ets->tc_tx_bw[i] * 100) | in bnxt_hwrm_queue_cos2bw_cfg()
135 static int bnxt_hwrm_queue_cos2bw_qcfg(struct bnxt *bp, struct ieee_ets *ets) in bnxt_hwrm_queue_cos2bw_qcfg() argument
166 ets->tc_tsa[tc] = IEEE_8021QAZ_TSA_STRICT; in bnxt_hwrm_queue_cos2bw_qcfg()
168 ets->tc_tsa[tc] = IEEE_8021QAZ_TSA_ETS; in bnxt_hwrm_queue_cos2bw_qcfg()
169 ets->tc_tx_bw[tc] = cos2bw.bw_weight; in bnxt_hwrm_queue_cos2bw_qcfg()
443 static int bnxt_ets_validate(struct bnxt *bp, struct ieee_ets *ets, u8 *tc) in bnxt_ets_validate() argument
450 if (ets->prio_tc[i] > bp->max_tc) { in bnxt_ets_validate()
452 ets->prio_tc[i]); in bnxt_ets_validate()
455 if (ets->prio_tc[i] > max_tc) in bnxt_ets_validate()
456 max_tc = ets->prio_tc[i]; in bnxt_ets_validate()
458 if ((ets->tc_tx_bw[i] || ets->tc_tsa[i]) && i > bp->max_tc) in bnxt_ets_validate()
461 switch (ets->tc_tsa[i]) { in bnxt_ets_validate()
465 total_ets_bw += ets->tc_tx_bw[i]; in bnxt_ets_validate()
478 static int bnxt_dcbnl_ieee_getets(struct net_device *dev, struct ieee_ets *ets) in bnxt_dcbnl_ieee_getets() argument
483 ets->ets_cap = bp->max_tc; in bnxt_dcbnl_ieee_getets()
502 ets->cbs = my_ets->cbs; in bnxt_dcbnl_ieee_getets()
503 memcpy(ets->tc_tx_bw, my_ets->tc_tx_bw, sizeof(ets->tc_tx_bw)); in bnxt_dcbnl_ieee_getets()
504 memcpy(ets->tc_rx_bw, my_ets->tc_rx_bw, sizeof(ets->tc_rx_bw)); in bnxt_dcbnl_ieee_getets()
505 memcpy(ets->tc_tsa, my_ets->tc_tsa, sizeof(ets->tc_tsa)); in bnxt_dcbnl_ieee_getets()
506 memcpy(ets->prio_tc, my_ets->prio_tc, sizeof(ets->prio_tc)); in bnxt_dcbnl_ieee_getets()
510 static int bnxt_dcbnl_ieee_setets(struct net_device *dev, struct ieee_ets *ets) in bnxt_dcbnl_ieee_setets() argument
521 rc = bnxt_ets_validate(bp, ets, &max_tc); in bnxt_dcbnl_ieee_setets()
535 rc = bnxt_hwrm_queue_cos2bw_cfg(bp, ets, max_tc); in bnxt_dcbnl_ieee_setets()
538 rc = bnxt_hwrm_queue_pri2cos_cfg(bp, ets); in bnxt_dcbnl_ieee_setets()
541 memcpy(my_ets, ets, sizeof(*my_ets)); in bnxt_dcbnl_ieee_setets()