From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id C1BEC2BA3 for ; Fri, 21 Sep 2018 17:41:12 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Sep 2018 08:41:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,285,1534834800"; d="scan'208";a="71863174" Received: from fyigit-mobl.ger.corp.intel.com (HELO [10.237.221.39]) ([10.237.221.39]) by fmsmga007.fm.intel.com with ESMTP; 21 Sep 2018 08:41:09 -0700 To: Gaetan Rivet , dev@dpdk.org References: <01e0e0ffd6a796a73150588823cf3434aafa7c50.1537261084.git.gaetan.rivet@6wind.com> From: Ferruh Yigit Openpgp: preference=signencrypt Message-ID: <582815f0-926e-8977-c8d1-3d4e1c5e2fd4@intel.com> Date: Fri, 21 Sep 2018 16:41:10 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <01e0e0ffd6a796a73150588823cf3434aafa7c50.1537261084.git.gaetan.rivet@6wind.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v1] testpmd: eeprom display X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Sep 2018 15:41:14 -0000 On 9/18/2018 9:59 AM, Gaetan Rivet wrote: > The interactive command > > show port eeprom > > will dump the content of the EEPROM for the selected port. > Dumping eeprom of all ports at once is not supported. > > Signed-off-by: Gaetan Rivet <...> > +void > +port_eeprom_display(portid_t port_id) > +{ > + struct rte_eth_dev_module_info minfo; > + struct rte_dev_eeprom_info einfo; > + char buf[1024]; > + int ret; > + > + if (port_id == (portid_t)RTE_PORT_ALL) > + return; > + > + ret = rte_eth_dev_get_module_info(port_id, &minfo); > + if (ret) { > + printf("Unable to get module info: %d\n", ret); > + return; > + } > + > + einfo.offset = 0; > + einfo.length = minfo.eeprom_len; > + einfo.data = buf; > + > + ret = rte_eth_dev_get_module_eeprom(port_id, &einfo); > + if (ret) { > + printf("Unable to get module EEPROM: %d\n", ret); > + return; > + } > + > + printf("Port %hhu EEPROM:\n", port_id); Causing build error [1], there are various formatting used for printing port_id [2], do we need this %hhu accuracy, I am for %u since port_id is an unsigned value result should be same. [1] printf("Port %hhu EEPROM:\n", port_id); ~~~~ ^~~~~~~ %hu [2] %d, %u, %PRIu8 [wrong], %PRIu16