* [dts] [PATCH V2 0/1] framework/pktgen: fix rfc2544 zero loss rate return value error.
@ 2020-08-11 3:21 yufengmx
2020-08-11 3:21 ` [dts] [PATCH V2 1/1] framework/pktgen: fix rfc2544 zero loss rate return value yufengmx
0 siblings, 1 reply; 3+ messages in thread
From: yufengmx @ 2020-08-11 3:21 UTC (permalink / raw)
To: dts; +Cc: yufengmx
v2:
- fix zero loss rate display error.
v1:
- fix rfc2544 zero loss rate return value error when rfc2544 loss rate not hit condition.
yufengmx (1):
framework/pktgen: fix rfc2544 zero loss rate return value error.
framework/pktgen_base.py | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
--
2.21.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [dts] [PATCH V2 1/1] framework/pktgen: fix rfc2544 zero loss rate return value
2020-08-11 3:21 [dts] [PATCH V2 0/1] framework/pktgen: fix rfc2544 zero loss rate return value error yufengmx
@ 2020-08-11 3:21 ` yufengmx
2020-08-12 8:09 ` Tu, Lijuan
0 siblings, 1 reply; 3+ messages in thread
From: yufengmx @ 2020-08-11 3:21 UTC (permalink / raw)
To: dts; +Cc: yufengmx
error.
fix rfc2544 zero loss rate return value error when rfc2544 loss rate not hit condition.
Signed-off-by: yufengmx <yufengx.mo@intel.com>
---
framework/pktgen_base.py | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/framework/pktgen_base.py b/framework/pktgen_base.py
index 049142f..8003e01 100644
--- a/framework/pktgen_base.py
+++ b/framework/pktgen_base.py
@@ -508,6 +508,7 @@ class PacketGenerator(object):
# traffic parameters for dichotomy algorithm
loss_rate_table = []
hit_result = None
+ hit_rate = 0
rate = traffic_rate_max = max_rate
traffic_rate_min = min_rate
while True:
@@ -523,6 +524,7 @@ class PacketGenerator(object):
# if upper bound rate percent hit, quit the left flow
if rate == max_rate and status:
hit_result = result
+ hit_rate = rate
break
# if lower bound rate percent not hit, quit the left flow
if rate == min_rate and not status:
@@ -530,6 +532,7 @@ class PacketGenerator(object):
if status:
traffic_rate_min = rate
hit_result = result
+ hit_rate = rate
else:
traffic_rate_max = rate
if traffic_rate_max - traffic_rate_min < accuracy:
@@ -549,7 +552,7 @@ class PacketGenerator(object):
ret_value = 0, result[0][0][1], result[0][0][2], 0
else:
self.logger.debug(pformat(loss_rate_table))
- ret_value = rate, hit_result[0][0][1], hit_result[0][0][2], hit_result[1][1]
+ ret_value = hit_rate, hit_result[0][0][1], hit_result[0][0][2], hit_result[1][1]
else:
if not hit_result:
msg = ('expected permit loss rate <{0}> '
@@ -560,8 +563,8 @@ class PacketGenerator(object):
ret_value = 0, result[0][1], result[0][2]
else:
self.logger.debug(pformat(loss_rate_table))
- ret_value = rate, hit_result[0][1], hit_result[0][2]
- self.logger.info("zero loss rate is %f" % rate)
+ ret_value = hit_rate, hit_result[0][1], hit_result[0][2]
+ self.logger.info("zero loss rate is %f" % hit_rate)
return ret_value
--
2.21.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dts] [PATCH V2 1/1] framework/pktgen: fix rfc2544 zero loss rate return value
2020-08-11 3:21 ` [dts] [PATCH V2 1/1] framework/pktgen: fix rfc2544 zero loss rate return value yufengmx
@ 2020-08-12 8:09 ` Tu, Lijuan
0 siblings, 0 replies; 3+ messages in thread
From: Tu, Lijuan @ 2020-08-12 8:09 UTC (permalink / raw)
To: Mo, YufengX, dts; +Cc: Mo, YufengX
> Subject: [dts] [PATCH V2 1/1] framework/pktgen: fix rfc2544 zero loss rate
> return value
>
> error.
>
> fix rfc2544 zero loss rate return value error when rfc2544 loss rate not hit
> condition.
>
> Signed-off-by: yufengmx <yufengx.mo@intel.com>
> ---
> framework/pktgen_base.py | 9 ++++++---
Applied
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-08-12 8:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-11 3:21 [dts] [PATCH V2 0/1] framework/pktgen: fix rfc2544 zero loss rate return value error yufengmx
2020-08-11 3:21 ` [dts] [PATCH V2 1/1] framework/pktgen: fix rfc2544 zero loss rate return value yufengmx
2020-08-12 8:09 ` Tu, Lijuan
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).