Lines Matching refs:ets

40 static int bnxt_hwrm_queue_pri2cos_cfg(struct bnxt *bp, struct ieee_ets *ets)  in bnxt_hwrm_queue_pri2cos_cfg()  argument
60 qidx = bp->tc_to_qidx[ets->prio_tc[i]]; in bnxt_hwrm_queue_pri2cos_cfg()
66 static int bnxt_hwrm_queue_pri2cos_qcfg(struct bnxt *bp, struct ieee_ets *ets) in bnxt_hwrm_queue_pri2cos_qcfg() argument
89 ets->prio_tc[i] = tc; in bnxt_hwrm_queue_pri2cos_qcfg()
96 static int bnxt_hwrm_queue_cos2bw_cfg(struct bnxt *bp, struct ieee_ets *ets, in bnxt_hwrm_queue_cos2bw_cfg() argument
117 if (ets->tc_tsa[i] == IEEE_8021QAZ_TSA_STRICT) { in bnxt_hwrm_queue_cos2bw_cfg()
124 cos2bw.bw_weight = ets->tc_tx_bw[i]; in bnxt_hwrm_queue_cos2bw_cfg()
129 cpu_to_le32((ets->tc_tx_bw[i] * 100) | in bnxt_hwrm_queue_cos2bw_cfg()
142 static int bnxt_hwrm_queue_cos2bw_qcfg(struct bnxt *bp, struct ieee_ets *ets) in bnxt_hwrm_queue_cos2bw_qcfg() argument
175 ets->tc_tsa[tc] = IEEE_8021QAZ_TSA_STRICT; in bnxt_hwrm_queue_cos2bw_qcfg()
177 ets->tc_tsa[tc] = IEEE_8021QAZ_TSA_ETS; in bnxt_hwrm_queue_cos2bw_qcfg()
178 ets->tc_tx_bw[tc] = cos2bw.bw_weight; in bnxt_hwrm_queue_cos2bw_qcfg()
464 static int bnxt_ets_validate(struct bnxt *bp, struct ieee_ets *ets, u8 *tc) in bnxt_ets_validate() argument
472 if (ets->prio_tc[i] > bp->max_tc) { in bnxt_ets_validate()
474 ets->prio_tc[i]); in bnxt_ets_validate()
477 if (ets->prio_tc[i] > max_tc) in bnxt_ets_validate()
478 max_tc = ets->prio_tc[i]; in bnxt_ets_validate()
480 if ((ets->tc_tx_bw[i] || ets->tc_tsa[i]) && i > bp->max_tc) in bnxt_ets_validate()
483 switch (ets->tc_tsa[i]) { in bnxt_ets_validate()
487 total_ets_bw += ets->tc_tx_bw[i]; in bnxt_ets_validate()
488 zero = zero || !ets->tc_tx_bw[i]; in bnxt_ets_validate()
510 static int bnxt_dcbnl_ieee_getets(struct net_device *dev, struct ieee_ets *ets) in bnxt_dcbnl_ieee_getets() argument
516 ets->ets_cap = bp->max_tc; in bnxt_dcbnl_ieee_getets()
536 ets->cbs = my_ets->cbs; in bnxt_dcbnl_ieee_getets()
537 memcpy(ets->tc_tx_bw, my_ets->tc_tx_bw, sizeof(ets->tc_tx_bw)); in bnxt_dcbnl_ieee_getets()
538 memcpy(ets->tc_rx_bw, my_ets->tc_rx_bw, sizeof(ets->tc_rx_bw)); in bnxt_dcbnl_ieee_getets()
539 memcpy(ets->tc_tsa, my_ets->tc_tsa, sizeof(ets->tc_tsa)); in bnxt_dcbnl_ieee_getets()
540 memcpy(ets->prio_tc, my_ets->prio_tc, sizeof(ets->prio_tc)); in bnxt_dcbnl_ieee_getets()
547 static int bnxt_dcbnl_ieee_setets(struct net_device *dev, struct ieee_ets *ets) in bnxt_dcbnl_ieee_setets() argument
558 rc = bnxt_ets_validate(bp, ets, &max_tc); in bnxt_dcbnl_ieee_setets()
572 rc = bnxt_hwrm_queue_cos2bw_cfg(bp, ets, max_tc); in bnxt_dcbnl_ieee_setets()
575 rc = bnxt_hwrm_queue_pri2cos_cfg(bp, ets); in bnxt_dcbnl_ieee_setets()
578 memcpy(my_ets, ets, sizeof(*my_ets)); in bnxt_dcbnl_ieee_setets()