X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest-pmd%2Fconfig.c;h=df6cd9e21542ca686859853c313ec714a66e3738;hb=79bec05b32b7;hp=eb59d4876441e22b83fca9422cd65500f021e654;hpb=a4aca79ba4d866627383efa5967a4540a67ccffa;p=dpdk.git diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index eb59d48764..df6cd9e215 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -97,6 +97,24 @@ static char *flowtype_to_str(uint16_t flow_type); +static const struct { + enum tx_pkt_split split; + const char *name; +} tx_split_name[] = { + { + .split = TX_PKT_SPLIT_OFF, + .name = "off", + }, + { + .split = TX_PKT_SPLIT_ON, + .name = "on", + }, + { + .split = TX_PKT_SPLIT_RND, + .name = "rand", + }, +}; + struct rss_type_info { char str[32]; uint64_t rss_type; @@ -1582,6 +1600,49 @@ set_nb_pkt_per_burst(uint16_t nb) (unsigned int) nb_pkt_per_burst); } +static const char * +tx_split_get_name(enum tx_pkt_split split) +{ + uint32_t i; + + for (i = 0; i != RTE_DIM(tx_split_name); i++) { + if (tx_split_name[i].split == split) + return tx_split_name[i].name; + } + return NULL; +} + +void +set_tx_pkt_split(const char *name) +{ + uint32_t i; + + for (i = 0; i != RTE_DIM(tx_split_name); i++) { + if (strcmp(tx_split_name[i].name, name) == 0) { + tx_pkt_split = tx_split_name[i].split; + return; + } + } + printf("unknown value: \"%s\"\n", name); +} + +void +show_tx_pkt_segments(void) +{ + uint32_t i, n; + const char *split; + + n = tx_pkt_nb_segs; + split = tx_split_get_name(tx_pkt_split); + + printf("Number of segments: %u\n", n); + printf("Segment sizes: "); + for (i = 0; i != n - 1; i++) + printf("%hu,", tx_pkt_seg_lengths[i]); + printf("%hu\n", tx_pkt_seg_lengths[i]); + printf("Split packet: %s\n", split); +} + void set_tx_pkt_segments(unsigned *seg_lengths, unsigned nb_segs) {