No meter what option for traffic metering algorithm was given
on the testpmd command line value 0 (RTE_MTR_NONE) was set
and passed to the driver.

Fix that by setting traffic metering algorithm to the proper value.

Fixes: 30ffb4e67ee3 ("app/testpmd: add commands traffic metering and policing")
Cc: cristian.dumitre...@intel.com

Signed-off-by: Tomasz Duszynski <t...@semihalf.com>
---
 app/test-pmd/cmdline_mtr.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/app/test-pmd/cmdline_mtr.c b/app/test-pmd/cmdline_mtr.c
index d8d806d..8dad8f8 100644
--- a/app/test-pmd/cmdline_mtr.c
+++ b/app/test-pmd/cmdline_mtr.c
@@ -171,7 +171,7 @@ static void cmd_add_port_meter_profile_srtcm_parsed(void 
*parsed_result,
 
        /* Private shaper profile params */
        memset(&mp, 0, sizeof(struct rte_mtr_meter_profile));
-       mp.alg = 0;
+       mp.alg = RTE_MTR_SRTCM_RFC2697;
        mp.srtcm_rfc2697.cir = res->cir;
        mp.srtcm_rfc2697.cbs = res->cbs;
        mp.srtcm_rfc2697.ebs = res->ebs;
@@ -277,7 +277,7 @@ static void cmd_add_port_meter_profile_trtcm_parsed(void 
*parsed_result,
 
        /* Private shaper profile params */
        memset(&mp, 0, sizeof(struct rte_mtr_meter_profile));
-       mp.alg = 0;
+       mp.alg = RTE_MTR_TRTCM_RFC2698;
        mp.trtcm_rfc2698.cir = res->cir;
        mp.trtcm_rfc2698.pir = res->pir;
        mp.trtcm_rfc2698.cbs = res->cbs;
@@ -389,7 +389,7 @@ static void cmd_add_port_meter_profile_trtcm_rfc4115_parsed(
 
        /* Private shaper profile params */
        memset(&mp, 0, sizeof(struct rte_mtr_meter_profile));
-       mp.alg = 0;
+       mp.alg = RTE_MTR_TRTCM_RFC4115;
        mp.trtcm_rfc4115.cir = res->cir;
        mp.trtcm_rfc4115.eir = res->eir;
        mp.trtcm_rfc4115.cbs = res->cbs;
-- 
2.7.4

Reply via email to