From: Yuanhan Liu Date: Fri, 7 Jul 2017 06:02:13 +0000 (+0800) Subject: app/testpmd: give more hint on invalid RETA size X-Git-Tag: spdx-start~1583 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=a42d6c6cf20dccfffa8bd9d803c9fe98a327dbd0;p=dpdk.git app/testpmd: give more hint on invalid RETA size Print the valid RTE size range so that user knows what goes wrong. Signed-off-by: Yuanhan Liu --- diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 828d6977f1..20e04f7272 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -2196,12 +2196,14 @@ cmd_showport_reta_parsed(void *parsed_result, struct cmd_showport_reta *res = parsed_result; struct rte_eth_rss_reta_entry64 reta_conf[8]; struct rte_eth_dev_info dev_info; + uint16_t max_reta_size; memset(&dev_info, 0, sizeof(dev_info)); rte_eth_dev_info_get(res->port_id, &dev_info); - if (dev_info.reta_size == 0 || res->size > dev_info.reta_size || - res->size > ETH_RSS_RETA_SIZE_512) { - printf("Invalid redirection table size: %u\n", res->size); + max_reta_size = RTE_MIN(dev_info.reta_size, ETH_RSS_RETA_SIZE_512); + if (res->size == 0 || res->size > max_reta_size) { + printf("Invalid redirection table size: %u (1-%u)\n", + res->size, max_reta_size); return; }