X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest-pmd%2Fconfig.c;h=90e4f190807770f7d0f7b4d53deb2cb407d5c24b;hb=b7091f1dcfbc62f358b4c1882d51c434471d51da;hp=e8e311cb548befca7a508187cc2c0b20b2ac06f0;hpb=69986a823d789da3745ab6b4ca6d3e84fe76c1b1;p=dpdk.git diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index e8e311cb54..90e4f19080 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -360,7 +360,7 @@ rx_queue_infos_display(portid_t port_id, uint16_t queue_id) rc = rte_eth_rx_queue_info_get(port_id, queue_id, &qinfo); if (rc != 0) { - printf("Failed to retrieve information for port: %hhu, " + printf("Failed to retrieve information for port: %u, " "RX queue: %hu\nerror desc: %s(%d)\n", port_id, queue_id, strerror(-rc), rc); return; @@ -393,7 +393,7 @@ tx_queue_infos_display(portid_t port_id, uint16_t queue_id) rc = rte_eth_tx_queue_info_get(port_id, queue_id, &qinfo); if (rc != 0) { - printf("Failed to retrieve information for port: %hhu, " + printf("Failed to retrieve information for port: %u, " "TX queue: %hu\nerror desc: %s(%d)\n", port_id, queue_id, strerror(-rc), rc); return; @@ -500,12 +500,15 @@ port_infos_display(portid_t port_id) char *p; printf("Supported flow types:\n"); - for (i = RTE_ETH_FLOW_UNKNOWN + 1; i < RTE_ETH_FLOW_MAX; - i++) { + for (i = RTE_ETH_FLOW_UNKNOWN + 1; + i < sizeof(dev_info.flow_type_rss_offloads) * CHAR_BIT; i++) { if (!(dev_info.flow_type_rss_offloads & (1ULL << i))) continue; p = flowtype_to_str(i); - printf(" %s\n", (p ? p : "unknown")); + if (p) + printf(" %s\n", p); + else + printf(" user defined %d\n", i); } } @@ -949,6 +952,9 @@ static const struct { MK_FLOW_ITEM(MPLS, sizeof(struct rte_flow_item_mpls)), MK_FLOW_ITEM(GRE, sizeof(struct rte_flow_item_gre)), MK_FLOW_ITEM(FUZZY, sizeof(struct rte_flow_item_fuzzy)), + MK_FLOW_ITEM(GTP, sizeof(struct rte_flow_item_gtp)), + MK_FLOW_ITEM(GTPC, sizeof(struct rte_flow_item_gtp)), + MK_FLOW_ITEM(GTPU, sizeof(struct rte_flow_item_gtp)), }; /** Compute storage space needed by item specification. */ @@ -2422,7 +2428,7 @@ set_tx_pkt_segments(unsigned *seg_lengths, unsigned nb_segs) } void -setup_gro(const char *mode, uint8_t port_id) +setup_gro(const char *onoff, portid_t port_id) { if (!rte_eth_dev_is_valid_port(port_id)) { printf("invalid port id %u\n", port_id); @@ -2433,29 +2439,77 @@ setup_gro(const char *mode, uint8_t port_id) " please stop forwarding first\n"); return; } - if (strcmp(mode, "on") == 0) { - if (gro_ports[port_id].enable) { - printf("port %u has enabled GRO\n", port_id); + if (strcmp(onoff, "on") == 0) { + if (gro_ports[port_id].enable != 0) { + printf("Port %u has enabled GRO. Please" + " disable GRO first\n", port_id); return; } - gro_ports[port_id].enable = 1; - gro_ports[port_id].param.gro_types = RTE_GRO_TCP_IPV4; - - if (gro_ports[port_id].param.max_flow_num == 0) + if (gro_flush_cycles == GRO_DEFAULT_FLUSH_CYCLES) { + gro_ports[port_id].param.gro_types = RTE_GRO_TCP_IPV4; gro_ports[port_id].param.max_flow_num = GRO_DEFAULT_FLOW_NUM; - if (gro_ports[port_id].param.max_item_per_flow == 0) gro_ports[port_id].param.max_item_per_flow = GRO_DEFAULT_ITEM_NUM_PER_FLOW; + } + gro_ports[port_id].enable = 1; } else { if (gro_ports[port_id].enable == 0) { - printf("port %u has disabled GRO\n", port_id); + printf("Port %u has disabled GRO\n", port_id); return; } gro_ports[port_id].enable = 0; } } +void +setup_gro_flush_cycles(uint8_t cycles) +{ + if (test_done == 0) { + printf("Before change flush interval for GRO," + " please stop forwarding first.\n"); + return; + } + + if (cycles > GRO_MAX_FLUSH_CYCLES || cycles < + GRO_DEFAULT_FLUSH_CYCLES) { + printf("The flushing cycle be in the range" + " of 1 to %u. Revert to the default" + " value %u.\n", + GRO_MAX_FLUSH_CYCLES, + GRO_DEFAULT_FLUSH_CYCLES); + cycles = GRO_DEFAULT_FLUSH_CYCLES; + } + + gro_flush_cycles = cycles; +} + +void +show_gro(portid_t port_id) +{ + struct rte_gro_param *param; + uint32_t max_pkts_num; + + param = &gro_ports[port_id].param; + + if (!rte_eth_dev_is_valid_port(port_id)) { + printf("Invalid port id %u.\n", port_id); + return; + } + if (gro_ports[port_id].enable) { + printf("GRO type: TCP/IPv4\n"); + if (gro_flush_cycles == GRO_DEFAULT_FLUSH_CYCLES) { + max_pkts_num = param->max_flow_num * + param->max_item_per_flow; + } else + max_pkts_num = MAX_PKT_BURST * GRO_MAX_FLUSH_CYCLES; + printf("Max number of packets to perform GRO: %u\n", + max_pkts_num); + printf("Flushing cycles: %u\n", gro_flush_cycles); + } else + printf("Port %u doesn't enable GRO.\n", port_id); +} + char* list_pkt_forwarding_modes(void) {