net/hns3: extract common function to obtain revision ID
[dpdk.git] / drivers / net / hns3 / hns3_dcb.c
index 3d0159d..7369378 100644 (file)
@@ -25,7 +25,7 @@
  * IR(Mbps) = -------------------------  *  CLOCK(1000Mbps)
  *             Tick * (2 ^ IR_s)
  *
- * @return: 0: calculate sucessful, negative: fail
+ * @return: 0: calculate successful, negative: fail
  */
 static int
 hns3_shaper_para_calc(struct hns3_hw *hw, uint32_t ir, uint8_t shaper_level,
@@ -36,8 +36,8 @@ hns3_shaper_para_calc(struct hns3_hw *hw, uint32_t ir, uint8_t shaper_level,
 #define DIVISOR_IR_B_126       (126 * DIVISOR_CLK)
 
        const uint16_t tick_array[HNS3_SHAPER_LVL_CNT] = {
-               6 * 256,    /* Prioriy level */
-               6 * 32,     /* Prioriy group level */
+               6 * 256,    /* Priority level */
+               6 * 32,     /* Priority group level */
                6 * 8,      /* Port level */
                6 * 256     /* Qset level */
        };
@@ -750,19 +750,9 @@ static int
 hns3_dcb_update_tc_queue_mapping(struct hns3_hw *hw, uint16_t nb_rx_q,
                                 uint16_t nb_tx_q)
 {
-       struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);
-       struct hns3_pf *pf = &hns->pf;
-       int ret;
-
        hw->num_tc = hw->dcb_info.num_tc;
-       ret = hns3_queue_to_tc_mapping(hw, nb_rx_q, nb_tx_q);
-       if (ret)
-               return ret;
 
-       if (!hns->is_vf)
-               memcpy(pf->prio_tc, hw->dcb_info.prio_tc, HNS3_MAX_USER_PRIO);
-
-       return 0;
+       return hns3_queue_to_tc_mapping(hw, nb_rx_q, nb_tx_q);
 }
 
 int
@@ -1532,7 +1522,7 @@ hns3_dcb_hw_configure(struct hns3_adapter *hns)
 
        ret = hns3_dcb_schd_setup_hw(hw);
        if (ret) {
-               hns3_err(hw, "dcb schdule configure failed! ret = %d", ret);
+               hns3_err(hw, "dcb schedule configure failed! ret = %d", ret);
                return ret;
        }
 
@@ -1737,7 +1727,7 @@ hns3_get_fc_mode(struct hns3_hw *hw, enum rte_eth_fc_mode mode)
  * hns3_dcb_pfc_enable - Enable priority flow control
  * @dev: pointer to ethernet device
  *
- * Configures the pfc settings for one porority.
+ * Configures the pfc settings for one priority.
  */
 int
 hns3_dcb_pfc_enable(struct rte_eth_dev *dev, struct rte_eth_pfc_conf *pfc_conf)