[dpdk-dev] [PATCH v4 4/9] app/procinfo: add support for show port

Stephen Hemminger stephen at networkplumber.org
Wed Nov 21 21:22:00 CET 2018


On Tue,  6 Nov 2018 18:19:07 +0530
Vipin Varghese <vipin.varghese at intel.com> 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.


More information about the dev mailing list