From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C29E2A057B for ; Thu, 2 Apr 2020 02:51:58 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ACC501BEC6; Thu, 2 Apr 2020 02:51:50 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 975881BEAA; Thu, 2 Apr 2020 02:51:46 +0200 (CEST) IronPort-SDR: VG7iykBN6V21CazEgqEg6HBcdzfDoOJOi41xv2IRR8T8z9W70SbQABoReVleITnEitNSM7fIzY mna7wZAkQYog== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Apr 2020 17:51:44 -0700 IronPort-SDR: 4R1i2+gcFUrJbeK1ZiPCEgCjCrFNC4XWD5k0A+Y6YZWqDfkCjjiukn2ZJLoYKksxBv3HgONUsk 9/nCHZ3xXPFg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,333,1580803200"; d="scan'208,217";a="249649979" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga003.jf.intel.com with ESMTP; 01 Apr 2020 17:51:44 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 1 Apr 2020 17:51:43 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 1 Apr 2020 17:51:42 -0700 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Wed, 1 Apr 2020 17:51:42 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.106) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 1 Apr 2020 17:51:42 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oLNUZmRr9tAiDjGWqwKGtL19TaLvWKxnE3DSj2AJfWSLiHNAKJeHJaQT/L7dzKVZyW7PpjkrPl0q9zmPEDqnxMydlBEKHJ8wnJlhGL1h9zb8lE31bjqZCk1eo5gTGrewGdtAUA6UN9wIcrbu+1bAx6yuaB4t8Bg6LQOeXj9KW2T62xivylrO3nKopsVJAyujIsZL9nom6Pt5VcT1wuP8d6W0ZF+/88uY+J8ZdgKJfhNdNhZ4km2/6RSJCNpEbScYHmwstEkdoDyV7rdV1ewmhbFTgNvfgfI9HW8Zs/0KrgdtVHASBzgflrYp5+S0xFjJAWx999Qn8BgKJRsmMs5NLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=53oj0zjbU8xgHOhF7YnzItZSl3rQF98Rt0A4NWvsI2o=; b=GWKvdkWil+7Lp4VPwUtjFIB62voaiUHyQwURTpL6WhfmBXWkf+vrG4vVHkvdLBuCuyfZruvi762bmsacFlvNX6e1siGLs8x3+RWeYsU5SO8IsrkgnvXvRVczYoPU0pt4XozMbLZ8z94XpWqSLKyrSqcnFw8WNNyTVHI8BnicVcA+TftBwq0utGpj75Px8265naLxn3KfQB1+bxlS7iJVDcladw/88QqGUZKcncmHYNkU/sepaYmIitFxCzBRMzUH8YF8V/OuCpYFmnZ0xuGe4EC8QKiqeEkX0UGgphKQd8H1rJLawrBVDvAFrFmSHSA993ESQj8WR3/0IsaH3b+jNA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=53oj0zjbU8xgHOhF7YnzItZSl3rQF98Rt0A4NWvsI2o=; b=bIQqOTg3+ONaHuHFPtP6wt+8CI5PTcuDs6amr0VpN37tORhALbkcw+ZuyQow3Iqpk8rT1x9ZaWqmngNBGrLOw0UMkKMEBZZF9zaRrXvRB9EgYZcmGZg2Tu9pAh+ySdeGIdHNhn2cQ6NbfNH9nCdl0mlmH8ZODYM9EH/1Ur6GvH4= Received: from BYAPR11MB3541.namprd11.prod.outlook.com (2603:10b6:a03:f5::16) by BYAPR11MB3431.namprd11.prod.outlook.com (2603:10b6:a03:8d::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.19; Thu, 2 Apr 2020 00:51:41 +0000 Received: from BYAPR11MB3541.namprd11.prod.outlook.com ([fe80::e8ad:5730:3ad0:87c6]) by BYAPR11MB3541.namprd11.prod.outlook.com ([fe80::e8ad:5730:3ad0:87c6%7]) with mapi id 15.20.2878.014; Thu, 2 Apr 2020 00:51:41 +0000 From: "Xing, Beilei" To: Anubhav Choudhary , "dev@dpdk.org" , "users@dpdk.org" Thread-Topic: Garbage value is returned while reading moudle eeprom for i40e (PF) with DPDK 18.11 Thread-Index: AdX6GG4ZFs/2IKbtTki05B35Zc1EwADmqy1QAADAOR4Cj5WXUAAlBmeA Date: Thu, 2 Apr 2020 00:51:41 +0000 Message-ID: References: , <8ec8418c517f4589aaf3f5a9534ab6e7@sandvine.com> In-Reply-To: <8ec8418c517f4589aaf3f5a9534ab6e7@sandvine.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=beilei.xing@intel.com; x-originating-ip: [192.102.204.38] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: cd4b9866-353a-489a-ad5e-08d7d6a00217 x-ms-traffictypediagnostic: BYAPR11MB3431: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1107; x-forefront-prvs: 0361212EA8 x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB3541.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10019020)(346002)(396003)(136003)(376002)(366004)(39860400002)(81166006)(186003)(71200400001)(64756008)(86362001)(66446008)(81156014)(8936002)(8676002)(9326002)(26005)(55016002)(53546011)(5660300002)(316002)(2906002)(66476007)(966005)(9686003)(66556008)(21615005)(66946007)(6506007)(478600001)(7696005)(110136005)(33656002)(52536014)(76116006); DIR:OUT; SFP:1102; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 46Y65nN9pdW5k5y81hxji1PwqobapB6HJHkjeJzD82sMuMNyA02Aavb42y+dIvuk+pGvOynm0pHbus3Sm6pK55VBCHDYLZQLMtzRI2VRO9q6ZndOYhLSco0Vp5s0wHth+O5OTPbpnQ/tJWofYJ43QLgIwBQz5imY0vWmtLSm1JRlDZ59bE+y3QwZJUGmdci6MF23gf8rkOzcKqSZAb4izIDGO7Z+q6x7hw3AFb/wC25pcUn1G5ky3TFqjhkDc8LvtEdp/w6Cg76Y49LJxQLZQ+OKYibmZlNP7bZ7R0IsIIabrLent1bO8O2xaPATIwy5lMxAkVhyXTYOFV2GEi9tE1xCAfuBtEdhb3QZbifsxlLfUPFLc4jGmnvcDjxJxkDeqiiucaucxDEhjF8Vv8kPrq9mLlax2Sxkp/l2ONLTvDUH8uHDlsy0vPme1xVuhHJfFTz/O8UEkPwcZOVwPKQf5rxoBMlxuc9g75iAqAgFDXVakWE0YxB8uFdkQkxkjMj4WCJDHN8x4bHRH/rUkwqGGA== x-ms-exchange-antispam-messagedata: yMT3CLEiOvX4eRcBNW/EFy61t+v4L9q1TXvDXOLBjPfLMsP0m0cszXARUpvaGpXeFkxreC2x6V8BzohpD9nf8TpBuuCLmpo3UVPKmphBWMkUi/Jj+c3U+SoWJjS1FDWtvXPyG1gkg+bM+aLYfGgMNQ== x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: cd4b9866-353a-489a-ad5e-08d7d6a00217 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Apr 2020 00:51:41.2203 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: XFBA+28FtGZzjt3B8mOWGW7qNJOFIt0L0llLUDtPRkMiFiWm2ahloSZKmtOnfgGZHeclyDQY/w483UXWKUkx/Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3431 X-OriginatorOrg: intel.com Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-users] Garbage value is returned while reading moudle eeprom for i40e (PF) with DPDK 18.11 X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org Sender: "users" Hi Anubhav, Thanks for the fix. Could you please submit the fix patch? thanks. BR, Beilei From: Anubhav Choudhary Sent: Wednesday, April 1, 2020 3:13 PM To: Xing, Beilei ; dev@dpdk.org; users@dpdk.org Subject: RE: Garbage value is returned while reading moudle eeprom for i40e= (PF) with DPDK 18.11 Hi, I found a bug in i40e driver which caused the issue shown in the mail chain= . Here is the patch for this : Author: Anubhav Choudhary > Date: Sun Mar 29 07:27:20 2020 -0400 BUG: Fix i40e_get_module_eeprom function in i40e driver In the implementation of i40e_get_module_eeprom, while calling the i40e_aq_get_phy_register, the parameters are not passed in right order. The position of page-change and offset has been swapped due to which garbage value was returned in place of module EEPROM data. Reviewed-By: Daniel Romell diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.= c index dca61f03a..fd84b57cc 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -11919,7 +11919,7 @@ static int i40e_get_module_eeprom(struct rte_eth_de= v *dev, } status =3D i40e_aq_get_phy_register(hw, I40E_AQ_PHY_REG_ACCESS_EXTERNAL_MODULE, - addr, offset, 1, &value, NULL); + addr, 1, offset, &value, NULL); if (status) return -EIO; data[i] =3D (uint8_t)value; Regards, Anubhav From: Anubhav Choudhary Sent: Thursday, March 19, 2020 11:51 AM To: Xing, Beilei Subject: Re: Garbage value is returned while reading moudle eeprom for i40e= (PF) with DPDK 18.11 Hi Beilei, I have used ethtool (dpdk sample application: https://doc.dpdk.org/guides/s= ample_app_ug/ethtool.html) for dumping the eeprom data. It uses the followi= ng code for reading the data : int rte_ethtool_get_module_eeprom(uint16_t port_id, struct ethtool_eeprom *eepr= om, void *words) { struct rte_dev_eeprom_info eeprom_info; int status; if (eeprom =3D=3D NULL || words =3D=3D NULL) return -EINVAL; eeprom_info.offset =3D eeprom->offset; eeprom_info.length =3D eeprom->len; eeprom_info.data =3D words; status =3D rte_eth_dev_get_module_eeprom(port_id, &eeprom_info); if (status) return status; return 0; } Ref : https://github.com/DPDK/dpdk/blob/v18.11/examples/ethtool/lib/rte_eth= tool.c#L190 ________________________________ From: Xing, Beilei > Sent: Thursday, March 19, 2020 11:28:33 AM To: Anubhav Choudhary Subject: RE: Garbage value is returned while reading moudle eeprom for i40e= (PF) with DPDK 18.11 [EXTERNAL] Hi, Could you show me how you dumped eeprom in the script? Read the register? BR, Beilei -----Original Message----- From: dev > On Behalf Of = Anubhav Choudhary Sent: 2020=1B$BG/=1B(B3=1B$B7n=1B(B14=1B$BF|=1B(B 23:56 To: dev@dpdk.org; users@dpdk.org Subject: [dpdk-dev] Garbage value is returned while reading moudle eeprom f= or i40e (PF) with DPDK 18.11 Hi, I am using Intel X710 along with FINISAR module (FTLX1471D3BCL). I am tryin= g to read the module's eeprom but I am getting garbage values when DPDK is = used. However, it is working perfectly fine when device is bound to the lin= ux kernel. I have attached the device details along with the eeprom dumps. = Note that I have executed the command in a VM where Intel X710 was using pc= i-passthrough. Let me know if more details are required to understand the i= ssue. Case 1 : When device used Linux Kernel root@test-system:/home/anubhav# ethtool -i eth2 driver: i40e version: 2.1.14-k firmware-version: 7.10 0x800051a6 19.0.12 expansion-rom-version: bus-info: 0000:00:0b.0 supports-statistics: yes supports-test: yes supports-eeprom-access: yes supports-register-dump: yes supports-priv-flags: yes root@test-system:/home/anubhav # ethtool -m eth2 raw on > module_eeprom_ker= nel.bin root@test-system:/home/anubhav # hexdump -x -v module_eeprom_kernel= .bin 0000000 0403 2007 0000 0000 0000 0600 0067 640a 0000010 0000 0000 4946 494e 4153 2052 4f43 5052 0000020 202e 2020 0000 6590 5446 584c 3431 3137 0000030 3344 4342 204c 2020 2041 2020 1e05 6300 0000040 1a00 0000 4c55 3038 3732 2056 2020 2020 0000050 2020 2020 3131 3830 3631 2020 f068 ce03 0000060 0000 0000 0000 0000 0000 0000 0000 0000 0000070 0000 0000 0000 0000 0000 0000 0000 0000 0000080 0000 0000 0000 0000 0000 0000 0000 0000 0000090 0000 0000 0000 0000 0000 0000 0000 0000 00000a0 0000 0000 0000 0000 0000 0000 0000 0000 00000b0 0000 0000 0000 0000 0000 0000 0000 0000 00000c0 0000 0000 0000 0000 0000 0000 0000 0000 00000d0 0000 0000 0000 0000 0000 0000 0000 0000 00000e0 0000 0000 0000 0000 0000 0000 0000 0000 00000f0 0000 0000 0000 0000 0000 0000 0000 0000 0000100 004e 00f3 0049 00f8 8890 4871 a08c 3075 0000110 04a6 4c1d 409c 1027 e93d 3106 2d31 cb07 0000120 7745 6400 e93d 9e00 0000 0000 0000 0000 0000130 0000 0000 0000 0000 0000 0000 0000 0000 0000140 0000 0000 803f 0000 0000 0000 0001 0000 0000150 0001 0000 0001 0000 0001 0000 0000 7e00 0000160 2c20 2c82 1a42 c31d 681a 0000 0000 0030 0000170 0000 0000 0000 0000 ffff ffff ffff 01ff 0000180 0000 0000 0000 0000 0000 0000 0000 0000 0000190 0000 0000 0000 0000 0000 0000 0000 0000 00001a0 0000 0000 0000 0000 0000 0000 0000 0000 00001b0 0000 0000 0000 0000 0000 0000 0000 0000 00001c0 0000 0000 0000 0000 0000 0000 0000 0000 00001d0 0000 0000 0000 0000 0000 0000 0000 0000 00001e0 0000 0000 0000 0000 0000 0000 0000 0000 00001f0 0000 0000 0000 0000 0000 0000 0000 0000 0000200 Case 2: When device is used with DPDK (18.11) root@test-system:/home/anubhav# ./ethtool EAL: Detected 92 lcore(s) EAL: Detected 1 NUMA nodes EAL: Multi-process socket /var/run/dpdk/rte/mp_socket EAL: Probing VFIO support... EAL: WARNING: cpu flags constant_tsc=3Dyes nonstop_tsc=3Dno -> using unreli= able clock cycles ! EAL: PCI device 0000:00:03.0 on NUMA socket -1 EAL: Invalid NUMA socket, default to 0 EAL: probe driver: 8086:100e net_e1000_em EAL: PCI device 0000:00:04.0 on NUMA socket -1 EAL: Invalid NUMA socket, default to 0 EAL: probe driver: 8086:100e net_e1000_em EAL: PCI device 0000:00:0b.0 on NUMA socket -1 EAL: Invalid NUMA socket, default to 0 EAL: probe driver: 8086:1572 net_i40e EAL: PCI device 0000:00:0b.1 on NUMA socket -1 EAL: Invalid NUMA socket, default to 0 EAL: probe driver: 8086:1572 net_i40e Number of NICs: 2 Init port 0.. Init port 1.. EthApp> drvinfo Port 0 driver: net_i40e (ver: DPDK 18.11.5) firmware-version: 7.10 0x800051a6 19.0.12 bus-info: 0000:00:0b.0 Port 1 driver: net_i40e (ver: DPDK 18.11.5) firmware-version: 7.10 0x800051a6 19.0.12 bus-info: 0000:00:0b.1 EthApp> module-eeprom 0 module_eeprom_dpdk.bin Total plugin module EEPROM length: 512 bytes EthApp> quit root@test-system:/home/anubhav# hexdump -x -v module_eeprom_dpdk.bin 0000000 0404 0404 0404 0404 0404 0404 0404 0404 0000010 0404 0404 0404 0404 0404 0404 0404 0404 0000020 0404 0404 0404 0404 0404 0404 0404 0404 0000030 0404 0404 0404 0404 0404 0404 0404 0404 0000040 0404 0404 0404 0404 0404 0404 0404 0404 0000050 0404 0404 0404 0404 0404 0404 0404 0404 0000060 0404 0404 0404 0404 0404 0404 0404 0404 0000070 0404 0404 0404 0404 0404 0404 0404 0404 0000080 0404 0404 0404 0404 0404 0404 0404 0404 0000090 0404 0404 0404 0404 0404 0404 0404 0404 00000a0 0404 0404 0404 0404 0404 0404 0404 0404 00000b0 0404 0404 0404 0404 0404 0404 0404 0404 00000c0 0404 0404 0404 0404 0404 0404 0404 0404 00000d0 0404 0404 0404 0404 0404 0404 0404 0404 00000e0 0404 0404 0404 0404 0404 0404 0404 0404 00000f0 0404 0404 0404 0404 0404 0404 0404 0404 0000100 0000 0000 0000 0000 0000 0000 0000 0000 0000110 0000 0000 0000 0000 0000 0000 0000 0000 0000120 0000 0000 0000 0000 0000 0000 0000 0000 0000130 0000 0000 0000 0000 0000 0000 0000 0000 0000140 0000 0000 0000 0000 0000 0000 0000 0000 0000150 0000 0000 0000 0000 0000 0000 0000 0000 0000160 0000 0000 0000 0000 0000 0000 0000 0000 0000170 0000 0000 0000 0000 0000 0000 0000 0000 0000180 0000 0000 0000 0000 0000 0000 0000 0000 0000190 0000 0000 0000 0000 0000 0000 0000 0000 00001a0 0000 0000 0000 0000 0000 0000 0000 0000 00001b0 0000 0000 0000 0000 0000 0000 0000 0000 00001c0 0000 0000 0000 0000 0000 0000 0000 0000 00001d0 0000 0000 0000 0000 0000 0000 0000 0000 00001e0 0000 0000 0000 0000 0000 0000 0000 0000 00001f0 0000 0000 0000 0000 0000 0000 0000 0000 0000200 Regards, Anubhav Choudhary Disclaimer: This communication (including any attachments) is intended for the use of t= he intended recipient(s) only and may contain information that is considere= d confidential, proprietary, sensitive and/or otherwise legally protected. = Any unauthorized use or dissemination of this communication is strictly pro= hibited. If you have received this communication in error, please immediate= ly notify the sender by return e-mail message and delete all copies of the = original communication. Thank you for your cooperation.