* [dpdk-stable] [PATCH v1] net/iavf: fix wrong bandwidth unit in TM capability querying
@ 2021-07-15 2:08 Ting Xu
2021-07-15 10:32 ` [dpdk-stable] [PATCH v2] " Ting Xu
2021-07-15 10:36 ` Ting Xu
0 siblings, 2 replies; 4+ messages in thread
From: Ting Xu @ 2021-07-15 2:08 UTC (permalink / raw)
To: dev; +Cc: qi.z.zhang, jingjing.wu, beilei.xing, Ting Xu, stable
In IAVF node TM capability querying, the unit of bandwidth is Kbps,
which is not correct according to TM specification. Change the unit to
Byte per second. Refine some unclear comments as well.
Fixes: 44d0a720a538 ("net/iavf: query QoS capabilities and set queue TC mapping")
Cc: stable@dpdk.org
Signed-off-by: Ting Xu <ting.xu@intel.com>
---
drivers/net/iavf/iavf_tm.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/net/iavf/iavf_tm.c b/drivers/net/iavf/iavf_tm.c
index 558021014e..c2908986b9 100644
--- a/drivers/net/iavf/iavf_tm.c
+++ b/drivers/net/iavf/iavf_tm.c
@@ -469,7 +469,7 @@ iavf_tm_capabilities_get(struct rte_eth_dev *dev,
cap->shaper_private_n_max = cap->n_nodes_max;
cap->shaper_private_dual_rate_n_max = 0;
cap->shaper_private_rate_min = 0;
- /* GBps */
+ /* Bytes per second */
cap->shaper_private_rate_max =
vf->link_speed * 1000 / IAVF_BITS_PER_BYTE;
cap->shaper_private_packet_mode_supported = 0;
@@ -544,7 +544,7 @@ iavf_level_capabilities_get(struct rte_eth_dev *dev,
cap->nonleaf.shaper_private_supported = true;
cap->nonleaf.shaper_private_dual_rate_supported = false;
cap->nonleaf.shaper_private_rate_min = 0;
- /* GBps */
+ /* Bytes per second */
cap->nonleaf.shaper_private_rate_max =
vf->link_speed * 1000 / IAVF_BITS_PER_BYTE;
cap->nonleaf.shaper_private_packet_mode_supported = 0;
@@ -632,8 +632,11 @@ iavf_node_capabilities_get(struct rte_eth_dev *dev,
cap->shaper_private_supported = true;
cap->shaper_private_dual_rate_supported = false;
- cap->shaper_private_rate_min = tc_cap.shaper.committed;
- cap->shaper_private_rate_max = tc_cap.shaper.peak;
+ /* Bytes per second */
+ cap->shaper_private_rate_min =
+ tc_cap.shaper.committed * 1000 / IAVF_BITS_PER_BYTE;
+ cap->shaper_private_rate_max =
+ tc_cap.shaper.peak * 1000 / IAVF_BITS_PER_BYTE;
cap->shaper_shared_n_max = 0;
cap->nonleaf.sched_n_children_max = vf->num_queue_pairs;
cap->nonleaf.sched_sp_n_priorities_max = 1;
--
2.17.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [dpdk-stable] [PATCH v2] net/iavf: fix wrong bandwidth unit in TM capability querying
2021-07-15 2:08 [dpdk-stable] [PATCH v1] net/iavf: fix wrong bandwidth unit in TM capability querying Ting Xu
@ 2021-07-15 10:32 ` Ting Xu
2021-07-15 10:36 ` Ting Xu
1 sibling, 0 replies; 4+ messages in thread
From: Ting Xu @ 2021-07-15 10:32 UTC (permalink / raw)
To: dev; +Cc: qi.z.zhang, jingjing.wu, beilei.xing, Ting Xu, stable
In IAVF node TM capability querying, the unit of bandwidth is Kbps,
which is not correct according to TM specification. Change the unit to
Byte per second. Refine some unclear comments as well.
Fixes: 44d0a720a538 ("net/iavf: query QoS capabilities and set queue TC mapping")
Cc: stable@dpdk.org
Signed-off-by: Ting Xu <ting.xu@intel.com>
---
drivers/net/iavf/iavf_tm.c | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/drivers/net/iavf/iavf_tm.c b/drivers/net/iavf/iavf_tm.c
index 558021014e..613c472619 100644
--- a/drivers/net/iavf/iavf_tm.c
+++ b/drivers/net/iavf/iavf_tm.c
@@ -469,9 +469,9 @@ iavf_tm_capabilities_get(struct rte_eth_dev *dev,
cap->shaper_private_n_max = cap->n_nodes_max;
cap->shaper_private_dual_rate_n_max = 0;
cap->shaper_private_rate_min = 0;
- /* GBps */
+ /* Bytes per second */
cap->shaper_private_rate_max =
- vf->link_speed * 1000 / IAVF_BITS_PER_BYTE;
+ (uint64_t)vf->link_speed * 1000 / IAVF_BITS_PER_BYTE;
cap->shaper_private_packet_mode_supported = 0;
cap->shaper_private_byte_mode_supported = 1;
cap->shaper_shared_n_max = 0;
@@ -544,9 +544,9 @@ iavf_level_capabilities_get(struct rte_eth_dev *dev,
cap->nonleaf.shaper_private_supported = true;
cap->nonleaf.shaper_private_dual_rate_supported = false;
cap->nonleaf.shaper_private_rate_min = 0;
- /* GBps */
+ /* Bytes per second */
cap->nonleaf.shaper_private_rate_max =
- vf->link_speed * 1000 / IAVF_BITS_PER_BYTE;
+ (uint64_t)vf->link_speed * 1000 / IAVF_BITS_PER_BYTE;
cap->nonleaf.shaper_private_packet_mode_supported = 0;
cap->nonleaf.shaper_private_byte_mode_supported = 1;
cap->nonleaf.shaper_shared_n_max = 0;
@@ -573,9 +573,9 @@ iavf_level_capabilities_get(struct rte_eth_dev *dev,
cap->leaf.shaper_private_supported = false;
cap->leaf.shaper_private_dual_rate_supported = false;
cap->leaf.shaper_private_rate_min = 0;
- /* GBps */
+ /* Bytes per second */
cap->leaf.shaper_private_rate_max =
- vf->link_speed * 1000 / IAVF_BITS_PER_BYTE;
+ (uint64_t)vf->link_speed * 1000 / IAVF_BITS_PER_BYTE;
cap->leaf.shaper_private_packet_mode_supported = 0;
cap->leaf.shaper_private_byte_mode_supported = 1;
cap->leaf.shaper_shared_n_max = 0;
@@ -632,8 +632,11 @@ iavf_node_capabilities_get(struct rte_eth_dev *dev,
cap->shaper_private_supported = true;
cap->shaper_private_dual_rate_supported = false;
- cap->shaper_private_rate_min = tc_cap.shaper.committed;
- cap->shaper_private_rate_max = tc_cap.shaper.peak;
+ /* Bytes per second */
+ cap->shaper_private_rate_min =
+ (uint64_t)tc_cap.shaper.committed * 1000 / IAVF_BITS_PER_BYTE;
+ cap->shaper_private_rate_max =
+ (uint64_t)tc_cap.shaper.peak * 1000 / IAVF_BITS_PER_BYTE;
cap->shaper_shared_n_max = 0;
cap->nonleaf.sched_n_children_max = vf->num_queue_pairs;
cap->nonleaf.sched_sp_n_priorities_max = 1;
--
2.17.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [dpdk-stable] [PATCH v2] net/iavf: fix wrong bandwidth unit in TM capability querying
2021-07-15 2:08 [dpdk-stable] [PATCH v1] net/iavf: fix wrong bandwidth unit in TM capability querying Ting Xu
2021-07-15 10:32 ` [dpdk-stable] [PATCH v2] " Ting Xu
@ 2021-07-15 10:36 ` Ting Xu
2021-07-16 8:15 ` Zhang, Qi Z
1 sibling, 1 reply; 4+ messages in thread
From: Ting Xu @ 2021-07-15 10:36 UTC (permalink / raw)
To: dev; +Cc: qi.z.zhang, jingjing.wu, beilei.xing, Ting Xu, stable
In IAVF node TM capability querying, the unit of bandwidth is Kbps,
which is not correct according to TM specification. Change the unit to
Byte per second. Refine some unclear comments as well.
Fixes: 44d0a720a538 ("net/iavf: query QoS capabilities and set queue TC mapping")
Cc: stable@dpdk.org
Signed-off-by: Ting Xu <ting.xu@intel.com>
---
drivers/net/iavf/iavf_tm.c | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/drivers/net/iavf/iavf_tm.c b/drivers/net/iavf/iavf_tm.c
index 558021014e..3c80276ff3 100644
--- a/drivers/net/iavf/iavf_tm.c
+++ b/drivers/net/iavf/iavf_tm.c
@@ -469,9 +469,9 @@ iavf_tm_capabilities_get(struct rte_eth_dev *dev,
cap->shaper_private_n_max = cap->n_nodes_max;
cap->shaper_private_dual_rate_n_max = 0;
cap->shaper_private_rate_min = 0;
- /* GBps */
+ /* Bytes per second */
cap->shaper_private_rate_max =
- vf->link_speed * 1000 / IAVF_BITS_PER_BYTE;
+ (uint64_t)vf->link_speed * 1000000 / IAVF_BITS_PER_BYTE;
cap->shaper_private_packet_mode_supported = 0;
cap->shaper_private_byte_mode_supported = 1;
cap->shaper_shared_n_max = 0;
@@ -544,9 +544,9 @@ iavf_level_capabilities_get(struct rte_eth_dev *dev,
cap->nonleaf.shaper_private_supported = true;
cap->nonleaf.shaper_private_dual_rate_supported = false;
cap->nonleaf.shaper_private_rate_min = 0;
- /* GBps */
+ /* Bytes per second */
cap->nonleaf.shaper_private_rate_max =
- vf->link_speed * 1000 / IAVF_BITS_PER_BYTE;
+ (uint64_t)vf->link_speed * 1000000 / IAVF_BITS_PER_BYTE;
cap->nonleaf.shaper_private_packet_mode_supported = 0;
cap->nonleaf.shaper_private_byte_mode_supported = 1;
cap->nonleaf.shaper_shared_n_max = 0;
@@ -573,9 +573,9 @@ iavf_level_capabilities_get(struct rte_eth_dev *dev,
cap->leaf.shaper_private_supported = false;
cap->leaf.shaper_private_dual_rate_supported = false;
cap->leaf.shaper_private_rate_min = 0;
- /* GBps */
+ /* Bytes per second */
cap->leaf.shaper_private_rate_max =
- vf->link_speed * 1000 / IAVF_BITS_PER_BYTE;
+ (uint64_t)vf->link_speed * 1000000 / IAVF_BITS_PER_BYTE;
cap->leaf.shaper_private_packet_mode_supported = 0;
cap->leaf.shaper_private_byte_mode_supported = 1;
cap->leaf.shaper_shared_n_max = 0;
@@ -632,8 +632,11 @@ iavf_node_capabilities_get(struct rte_eth_dev *dev,
cap->shaper_private_supported = true;
cap->shaper_private_dual_rate_supported = false;
- cap->shaper_private_rate_min = tc_cap.shaper.committed;
- cap->shaper_private_rate_max = tc_cap.shaper.peak;
+ /* Bytes per second */
+ cap->shaper_private_rate_min =
+ (uint64_t)tc_cap.shaper.committed * 1000 / IAVF_BITS_PER_BYTE;
+ cap->shaper_private_rate_max =
+ (uint64_t)tc_cap.shaper.peak * 1000 / IAVF_BITS_PER_BYTE;
cap->shaper_shared_n_max = 0;
cap->nonleaf.sched_n_children_max = vf->num_queue_pairs;
cap->nonleaf.sched_sp_n_priorities_max = 1;
--
2.17.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-stable] [PATCH v2] net/iavf: fix wrong bandwidth unit in TM capability querying
2021-07-15 10:36 ` Ting Xu
@ 2021-07-16 8:15 ` Zhang, Qi Z
0 siblings, 0 replies; 4+ messages in thread
From: Zhang, Qi Z @ 2021-07-16 8:15 UTC (permalink / raw)
To: Xu, Ting, dev; +Cc: Wu, Jingjing, Xing, Beilei, stable
> -----Original Message-----
> From: Xu, Ting <ting.xu@intel.com>
> Sent: Thursday, July 15, 2021 6:36 PM
> To: dev@dpdk.org
> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>;
> Xing, Beilei <beilei.xing@intel.com>; Xu, Ting <ting.xu@intel.com>;
> stable@dpdk.org
> Subject: [PATCH v2] net/iavf: fix wrong bandwidth unit in TM capability
> querying
>
> In IAVF node TM capability querying, the unit of bandwidth is Kbps, which is
> not correct according to TM specification. Change the unit to Byte per second.
> Refine some unclear comments as well.
>
> Fixes: 44d0a720a538 ("net/iavf: query QoS capabilities and set queue TC
> mapping")
> Cc: stable@dpdk.org
>
> Signed-off-by: Ting Xu <ting.xu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Applied to dpdk-next-net-intel.
Thanks
Qi
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-07-16 8:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-15 2:08 [dpdk-stable] [PATCH v1] net/iavf: fix wrong bandwidth unit in TM capability querying Ting Xu
2021-07-15 10:32 ` [dpdk-stable] [PATCH v2] " Ting Xu
2021-07-15 10:36 ` Ting Xu
2021-07-16 8:15 ` Zhang, Qi Z
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).