From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH v4 4/9] app/procinfo: add support for show port Date: Wed, 21 Nov 2018 12:22:00 -0800 Message-ID: <20181121122200.786ffcd8@xeon-e3> References: <20181106124912.40700-1-vipin.varghese@intel.com> <20181106124912.40700-4-vipin.varghese@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, thomas@monjalon.net, reshma.pattan@intel.com, john.mcnamara@intel.com, stephen1.byrne@intel.com, michael.j.glynn@intel.com, amol.patel@intel.com To: Vipin Varghese Return-path: Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by dpdk.org (Postfix) with ESMTP id E4E6A1B137 for ; Wed, 21 Nov 2018 21:22:03 +0100 (CET) Received: by mail-pl1-f196.google.com with SMTP id z23so7050594plo.0 for ; Wed, 21 Nov 2018 12:22:03 -0800 (PST) In-Reply-To: <20181106124912.40700-4-vipin.varghese@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 Tue, 6 Nov 2018 18:19:07 +0530 Vipin Varghese wrote: Minor observations which are things that checkpatch etc won't see but make the code easier to read/maintain. > +/* border variable to hold for show */ > +char bdr_str[MAX_STRING_LEN]; Does this have to be global, could it just be static? > + memset(&link, 0, sizeof(link)); > + memset(&dev_info, 0, sizeof(dev_info)); > + memset(&queue_info, 0, sizeof(queue_info)); > + memset(&stats, 0, sizeof(stats)); > + memset(&rss_conf, 0, sizeof(rss_conf)); These memset's should be unnecessary. For example, dev_info is always cleared already inside rte_eth_dev_info_get(). > + if ((ret) || (rss_conf.rss_key == NULL)) > + continue; Unnecessary parenthesis hurt readability in this if statement.