From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by dpdk.org (Postfix) with ESMTP id 7570B5B2A for ; Fri, 21 Sep 2018 18:13:51 +0200 (CEST) Received: by mail-wm1-f65.google.com with SMTP id r1-v6so4584608wmh.0 for ; Fri, 21 Sep 2018 09:13:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=IfFYkohE2gkBriw0QghFVn+/1n3H5nSU04BEeNBm4qU=; b=OSlff74/rLhuOSKGjduHmmjoxqhBzgZVG/+TeKtmLvNK7wMPV7YwQmJ5mbOhR/HvHp 6kg/HJg7MLlc4TQEUCJ2m6K6HUDqsUo6qRjlts2IMrSD5VEfbSLiKOjrRYOqTZyYKI0h HQqdp+SbgAEmZt5uXWuW1dC8amNsD2hnCi3mWF47yz+6Q/F/lNXtOYR1ynzlxuXCdpkv 5uSetwoewW5o3qd36TLubFawf12nEFELH6GEqjwx0TBICqCsHkQkK6YthIqi9FH6xsB+ WGcRB1NAqKhvOcAgPZ4ITZUM/8ybL6HFRgeuTaIATYd7eyW3NIqxfdu0jIb0PmBC1vNV pJPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=IfFYkohE2gkBriw0QghFVn+/1n3H5nSU04BEeNBm4qU=; b=UAPir0xCp0gM0Bz2BptlvPol2KcqLTazDftXdIX8TppluSJRG1Ui4RVQ5wvKH2sD0P B2o64CpQlb1kehkb285sCNzLtxPE5dQe1YmBmgZcmqnLZBBnXG9pUz1TmlwmYll4iLsf h+EfxsTBILup/2OdZW9aFFDmp5l6Z1Wuz1uzBAGVus2ChxTNZQb3fUrwKyUW3922zTsO i5iQyxlEAmFanemZDtVrW6Nyn01ZLqlPySJghfK8G9jvAiTMYzigc2GXuQbJzVQDBAjW JU4J6RxDkESg0vlnKlbLT835TabYqtuDqcuysK/PZWTBbS/AX3odblereX50ev4mNfW7 fZ/A== X-Gm-Message-State: APzg51ByUQ4i9UgDYIGzctXhYo5fjOuZyb60NTs+caUCfNMLf5g0IWYz 8Z5raLLgGR7yLqhoIELzjFb2GUh3dlI= X-Google-Smtp-Source: ANB0VdaptApmCcp7Fmud8iqVexYWq750rVdmqrA53V5PiLBI5ug/EZD3F/zYXEs8pox30PauFC/R/g== X-Received: by 2002:a1c:3a08:: with SMTP id h8-v6mr7607412wma.126.1537546426154; Fri, 21 Sep 2018 09:13:46 -0700 (PDT) Received: from bidouze.vm.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id r140-v6sm5170088wmd.7.2018.09.21.09.13.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 21 Sep 2018 09:13:44 -0700 (PDT) Date: Fri, 21 Sep 2018 18:13:27 +0200 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet To: Ferruh Yigit Cc: dev@dpdk.org Message-ID: <20180921161327.q54z27v2wrt27q4f@bidouze.vm.6wind.com> References: <01e0e0ffd6a796a73150588823cf3434aafa7c50.1537261084.git.gaetan.rivet@6wind.com> <582815f0-926e-8977-c8d1-3d4e1c5e2fd4@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <582815f0-926e-8977-c8d1-3d4e1c5e2fd4@intel.com> User-Agent: NeoMutt/20170113 (1.7.2) 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 16:13:51 -0000 On Fri, Sep 21, 2018 at 04:41:10PM +0100, Ferruh Yigit wrote: > 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 You're right, no need for %hhu. I'd prefer myself using PRIu8 only by principle, but I think consistency is better, and testpmd uses %u more often. On another note, I think this command was misnamed anyway. > show port sfp_eeprom 0 is more correct, because we won't get the actual port EEPROM. I will send a v2, thanks for reading Ferruh. -- Gaëtan Rivet 6WIND