From: Huisong Li Date: Sun, 27 Sep 2020 03:16:36 +0000 (+0800) Subject: ethdev: fix data type in TC queues X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=9f6dc8592d54aa2ec1800c53977a31bd7922147b;p=dpdk.git ethdev: fix data type in TC queues Currently, base and nb_queue in the tc_rxq and tc_txq information of queue and TC mapping on both TX and RX paths are uint8_t. However, these data will be truncated when queue number under a TC is greater than 256. So it is necessary for base and nb_queue to change from uint8_t to uint16_t. Fixes: 89d6728c7837 ("ethdev: get DCB information") Cc: stable@dpdk.org Signed-off-by: Huisong Li Signed-off-by: Min Hu (Connor) Reviewed-by: Wei Hu (Xavier) Reviewed-by: Dongdong Liu Acked-by: Thomas Monjalon Reviewed-by: Ferruh Yigit --- diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst index 6df6e999e2..02f0eb005d 100644 --- a/doc/guides/rel_notes/release_20_11.rst +++ b/doc/guides/rel_notes/release_20_11.rst @@ -227,6 +227,11 @@ API Changes * ``_rte_eth_dev_callback_process()`` -> ``rte_eth_dev_callback_process()`` * ``_rte_eth_dev_reset`` -> ``rte_eth_dev_internal_reset()`` +* ethdev: Modified field type of ``base`` and ``nb_queue`` in struct + ``rte_eth_dcb_tc_queue_mapping`` from ``uint8_t`` to ``uint16_t``. + As the data of ``uint8_t`` will be truncated when queue number under + a TC is greater than 256. + * vhost: Moved vDPA APIs from experimental to stable. * rawdev: Added a structure size parameter to the functions diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index d2bf74f128..15b2f6de5a 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -1522,13 +1522,13 @@ struct rte_eth_xstat_name { struct rte_eth_dcb_tc_queue_mapping { /** rx queues assigned to tc per Pool */ struct { - uint8_t base; - uint8_t nb_queue; + uint16_t base; + uint16_t nb_queue; } tc_rxq[ETH_MAX_VMDQ_POOL][ETH_DCB_NUM_TCS]; /** rx queues assigned to tc per Pool */ struct { - uint8_t base; - uint8_t nb_queue; + uint16_t base; + uint16_t nb_queue; } tc_txq[ETH_MAX_VMDQ_POOL][ETH_DCB_NUM_TCS]; };