From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9E152A00C2; Thu, 5 Jan 2023 07:57:31 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3ECC3400EF; Thu, 5 Jan 2023 07:57:31 +0100 (CET) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id B5A2840041; Thu, 5 Jan 2023 07:57:29 +0100 (CET) Content-class: urn:content-classes:message Subject: RE: [PATCH] net/ixgbe: fix ixgbe firmware version get MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Thu, 5 Jan 2023 07:57:28 +0100 X-MimeOLE: Produced By Microsoft Exchange V6.5 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D87623@smartserver.smartshare.dk> In-Reply-To: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH] net/ixgbe: fix ixgbe firmware version get Thread-Index: AQHZICOB9j/c3N1LF061vYwvdpegjK6OC6IAgAETXKCAAEaJQA== References: <20230104095142.86796-1-shiyangx.he@intel.com> <98CBD80474FA8B44BF855DF32C47DC35D87620@smartserver.smartshare.dk> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "He, ShiyangX" , Cc: "Zhou, YidingX" , , "Yang, Qiming" , "Wu, Wenjun1" , "Remy Horton" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org > From: He, ShiyangX [mailto:shiyangx.he@intel.com] > Sent: Thursday, 5 January 2023 03.52 >=20 > >From: Morten Br=F8rup > >Sent: Wednesday, January 4, 2023 6:19 PM > > > >> From: Shiyang He [mailto:shiyangx.he@intel.com] > >> Sent: Wednesday, 4 January 2023 10.52 > >> > >> The firmware version obtained by dpdk-ethtool is inconsistent with > >> that obtained by linux-ethtool. > >> > >> This commit fixes the issue. > >> > >> Fixes: 8b0b56574269 ("net/ixgbe: add firmware version get") > >> Cc: stable@dpdk.org > >> > >> Signed-off-by: Shiyang He > >> --- > >> drivers/net/ixgbe/ixgbe_ethdev.c | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > >> > >> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c > >> b/drivers/net/ixgbe/ixgbe_ethdev.c > >> index ae9f65b334..012096021e 100644 > >> --- a/drivers/net/ixgbe/ixgbe_ethdev.c > >> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c > >> @@ -3859,7 +3859,7 @@ ixgbe_fw_version_get(struct rte_eth_dev *dev, > >> char *fw_version, size_t fw_size) > >> ixgbe_read_eeprom(hw, 0x2e, &eeprom_verh); > >> ixgbe_read_eeprom(hw, 0x2d, &eeprom_verl); > >> > >> - etrack_id =3D (eeprom_verh << 16) | eeprom_verl; > >> + etrack_id =3D (eeprom_verl << 16) | eeprom_verh; > >> ret =3D snprintf(fw_version, fw_size, "0x%08x", etrack_id); > > > >This looks wrong, assuming the high-word in 0x2e and the low-word in > 0x2d. > > > >Perhaps the linux ethtool needs to be fixed instead? > > > >I don't think DPDK should aim for "bug compatibility" with Linux. :-( >=20 > After following your suggestions, I read the driver source code again, > which is implemented as the solution. I will send out V2 patch soon. I suppose what you are looking for is here: https://elixir.bootlin.com/linux/v6.1.3/source/drivers/net/ethernet/intel= /ixgbe/ixgbe_common.c#L4106