]> git.droids-corp.org - dpdk.git/commitdiff
app/flow-perf: add packet metering mode
authorRongwei Liu <rongweil@nvidia.com>
Thu, 11 Nov 2021 14:23:39 +0000 (16:23 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 16 Nov 2021 11:34:06 +0000 (12:34 +0100)
The flow perf application uses the srtcm_rfc2697 as meter profile
while doing the meter testing.

This patch adds new configuration parameter '--packet-mode' to
generate the meter flows with packet cir instead of byte cir.

Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
Acked-by: Wisam Jaddo <wisamm@nvidia.com>
app/test-flow-perf/main.c
doc/guides/tools/flow-perf.rst

index 01bfa20db7c68663d35de86cedd05d24f94c42c4..2b612aa32cd9af0e8650b220eafad1992c937013 100644 (file)
@@ -68,6 +68,7 @@ static bool dump_socket_mem_flag;
 static bool enable_fwd;
 static bool unique_data;
 static bool policy_mtr;
+static bool packet_mode;
 
 static uint8_t rx_queues_count;
 static uint8_t tx_queues_count;
@@ -488,6 +489,7 @@ usage(char *progname)
        printf("  --meter-profile=cir,cbs,ebs: set CIR CBS EBS parameters in meter"
                " profile, default values are %d,%d,%d\n", METER_CIR,
                METER_CIR / 8, 0);
+       printf("  --packet-mode: to enable packet mode for meter profile\n");
 
        printf("To set flow attributes:\n");
        printf("  --ingress: set ingress attribute in flows\n");
@@ -712,6 +714,7 @@ args_parse(int argc, char **argv)
                { "vxlan-decap",                0, 0, 0 },
                { "policy-mtr",                 1, 0, 0 },
                { "meter-profile",              1, 0, 0 },
+               { "packet-mode",                0, 0, 0 },
        };
 
        RTE_ETH_FOREACH_DEV(i)
@@ -942,6 +945,8 @@ args_parse(int argc, char **argv)
                                        token = strsep(&optarg, ",\0");
                                }
                        }
+                       if (strcmp(lgopts[opt_idx].name, "packet-mode") == 0)
+                               packet_mode = true;
                        break;
                default:
                        usage(argv[0]);
@@ -1272,6 +1277,7 @@ create_meter_profile(void)
                mp.srtcm_rfc2697.cbs = meter_profile_values[1] ?
                        meter_profile_values[1] : METER_CIR / 8;
                mp.srtcm_rfc2697.ebs = meter_profile_values[2];
+               mp.packet_mode = packet_mode;
                ret = rte_mtr_meter_profile_add
                        (port_id, DEFAULT_METER_PROF_ID, &mp, &error);
                if (ret != 0) {
index 24f0fefcd8d068b9306f354d8f2983a08b2f2a66..0176e9c5cb43da7599a7db90cbde6476943ef789 100644 (file)
@@ -137,6 +137,9 @@ The command line options are:
 *      ``--meter-profile=N1,N2,N3``
        Set the CIR, CBS and EBS parameters, default values are 1250000, 156250 and 0.
 
+*      ``--packet-mode``
+       Enable packet mode for meter profile.
+
 Attributes:
 
 *      ``--ingress``