From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuanhan Liu Subject: Re: [PATCH 2/2] testpmd: give more hint on invalid RETA size Date: Mon, 10 Jul 2017 09:24:23 +0800 Message-ID: <20170710012421.GD11626@yliu-home> References: <1499407333-1682-1-git-send-email-yliu@fridaylinux.org> <1499407333-1682-2-git-send-email-yliu@fridaylinux.org> <9BB6961774997848B5B42BEC655768F810DC0E08@SHSMSX103.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "dev@dpdk.org" To: "Wu, Jingjing" Return-path: Received: from mail-pg0-f68.google.com (mail-pg0-f68.google.com [74.125.83.68]) by dpdk.org (Postfix) with ESMTP id 9BD74532D for ; Mon, 10 Jul 2017 03:24:30 +0200 (CEST) Received: by mail-pg0-f68.google.com with SMTP id u62so10769828pgb.0 for ; Sun, 09 Jul 2017 18:24:30 -0700 (PDT) Content-Disposition: inline In-Reply-To: <9BB6961774997848B5B42BEC655768F810DC0E08@SHSMSX103.ccr.corp.intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Mon, Jul 10, 2017 at 01:19:06AM +0000, Wu, Jingjing wrote: > > -----Original Message----- > > From: Yuanhan Liu [mailto:yliu@fridaylinux.org] > > Subject: [PATCH 2/2] 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 > > --- > > app/test-pmd/cmdline.c | 8 +++++--- > > 1 file changed, 5 insertions(+), 3 deletions(-) > > > > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c > > index c8faef9..d32a1df 100644 > > --- a/app/test-pmd/cmdline.c > > +++ b/app/test-pmd/cmdline.c > > @@ -2140,12 +2140,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; > > } > > > Why not merge this with previous one? Because they are two differnt things, even though each of them is really tiny. --yliu