X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest-flow-perf%2Fmain.c;h=56d43734e35a23b883f1e81bdc4232c9337daa7e;hb=6e858b4d9244cf53505589673755ab18ac2a4a83;hp=89596eb3f651a0a4cc4b164bd9729cc4bed2ffd6;hpb=7f37f0936a1992b2d5b4babd650a63f11587bea4;p=dpdk.git diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c index 89596eb3f6..56d43734e3 100644 --- a/app/test-flow-perf/main.c +++ b/app/test-flow-perf/main.c @@ -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; @@ -85,6 +86,7 @@ static uint32_t hairpin_queues_num; /* total hairpin q number - default: 0 */ static uint32_t nb_lcores; static uint8_t max_priority; static uint32_t rand_seed; +static uint64_t meter_profile_values[3]; /* CIR CBS EBS values. */ #define MAX_PKT_BURST 32 #define LCORE_MODE_PKT 1 @@ -484,6 +486,10 @@ usage(char *progname) "and S as seed for pseudo-random number generator\n"); printf(" --unique-data: flag to set using unique data for all" " actions that support data, such as header modify and encap actions\n"); + 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"); @@ -707,6 +713,9 @@ args_parse(int argc, char **argv) { "vxlan-encap", 0, 0, 0 }, { "vxlan-decap", 0, 0, 0 }, { "policy-mtr", 1, 0, 0 }, + { "meter-profile", 1, 0, 0 }, + { "packet-mode", 0, 0, 0 }, + { 0, 0, 0, 0 }, }; RTE_ETH_FOREACH_DEV(i) @@ -926,11 +935,24 @@ args_parse(int argc, char **argv) } if (strcmp(lgopts[opt_idx].name, "policy-mtr") == 0) read_meter_policy(argv[0], optarg); + if (strcmp(lgopts[opt_idx].name, + "meter-profile") == 0) { + i = 0; + token = strsep(&optarg, ",\0"); + while (token != NULL && i < sizeof( + meter_profile_values) / + sizeof(uint64_t)) { + meter_profile_values[i++] = atol(token); + token = strsep(&optarg, ",\0"); + } + } + if (strcmp(lgopts[opt_idx].name, "packet-mode") == 0) + packet_mode = true; break; default: usage(argv[0]); rte_exit(EXIT_FAILURE, "Invalid option: %s\n", - argv[optind]); + argv[optind - 1]); break; } } @@ -1251,9 +1273,12 @@ create_meter_profile(void) if (!((ports_mask >> port_id) & 0x1)) continue; mp.alg = RTE_MTR_SRTCM_RFC2697; - mp.srtcm_rfc2697.cir = METER_CIR; - mp.srtcm_rfc2697.cbs = METER_CIR / 8; - mp.srtcm_rfc2697.ebs = 0; + mp.srtcm_rfc2697.cir = meter_profile_values[0] ? + meter_profile_values[0] : METER_CIR; + 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) { @@ -1494,7 +1519,7 @@ dump_used_cpu_time(const char *item, * threads time. * * Throughput: total count of rte rules divided - * over the average of the time cosumed by all + * over the average of the time consumed by all * threads time. */ double insertion_latency_time;