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 B6A9AA00C4; Mon, 11 Apr 2022 10:13:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 599E240685; Mon, 11 Apr 2022 10:13:54 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 8B3AF4067B for ; Mon, 11 Apr 2022 10:13:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649664832; x=1681200832; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=jJzDPCDJODvrXtjzkyGiy6+fuYk/C8ObfYavIHN7R6U=; b=fbHREoDNDQ2fCtXFlUNPrxQKSTEY9BDrz7Qm3g+PlCjSih3WOu63cHzT 6eubNZK61hbuqVe/xy+mjX4Dyfi2jjZk/J/pBsP+nwGEk4zjs6NS59FUr DekDQdZOryDRkXAxBsGiazAaLIcP3L/III3s7NSto8YXkL4XS7mcLeUM8 hen+xJcQE6HvRWVzIY2PNgkxeLsfz/+aqp9pEwUdzGmvaLqpIx/KmK1o/ knHRqJhIMnclLCl6friZ2balLWWbynQOTM8XoSbSCfu5amGamI2V8LrHU OKw4WMNElLalXFUWuvFo/cQKcQ+e13ekffLdp4Rcr2h5KUAUWmAABpwvG A==; X-IronPort-AV: E=McAfee;i="6400,9594,10313"; a="322508598" X-IronPort-AV: E=Sophos;i="5.90,251,1643702400"; d="scan'208";a="322508598" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Apr 2022 01:13:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,251,1643702400"; d="scan'208";a="525378532" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by orsmga002.jf.intel.com with ESMTP; 11 Apr 2022 01:13:51 -0700 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Mon, 11 Apr 2022 01:13:50 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Mon, 11 Apr 2022 01:13:50 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.41) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Mon, 11 Apr 2022 01:13:50 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PCD8zJhKsRUrzEatumCL4KAha1cQIEgNB8lreqUgnENQPS613Dcq3GhyyIRXGFwnwkd3b7A/SVUohsZjtjer9YGCEyhIDLbP38p9PsirsrZsO4lq1xOPkw9fxnP408QseN/ZrdFjjLU4i8sM4xaEGmGB4xVS0hiOxyWEas6GS7+6uA3hnZGq6MyGc4idFMoV+uvsTaOIQCcLJ0ld8/UFjCMdZistWOSb08djgDmGRi7m/vfTNO6bNwv32Eq6vrMgk6hBP0UGwQtgYx84KJy7SgsgfdZwAGRP2Obup1i3N0Yo/iofSViOHXVRwMXtVBrHkmDg46zKPrpVGpl1ddyieA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=PWW5y8W2jkGOkhcYWAm8cXO1mVFwd4ORXq9AbqIX+yo=; b=dInbLtKz1stG80V+QLwBFXaV/1UN7XZAJngh2h/m55vcvECYGeLL0Z2eNlzVvrjXArtjOKjGFEY+LzgPayPFCN97LEyDYKuAqQO9ITU8+n2vFgwH07e2HMnH6NqQCBMjh8vDzVE8kZFBNzSZElD1lrGgx9q1cWdAwyOArEKPiZgYMSSU8ZURb5ynptSTbqDD4VpxHCBzv7+Zz5Idiq0fKYZvPavME6fZsDRYcqSHxkCPYxBM5CzkjMBfo2xrwe2zzM6hkHgNORSAPQqqfqxfYCoja1mDibQFZyDpEv8SaEF1G2VGYMBoJy435neN5sJgDsAX6V5LSBTmYyasvWb8XA== 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 Received: from BN9PR11MB5529.namprd11.prod.outlook.com (2603:10b6:408:102::16) by SJ0PR11MB4864.namprd11.prod.outlook.com (2603:10b6:a03:2d4::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.29; Mon, 11 Apr 2022 08:13:48 +0000 Received: from BN9PR11MB5529.namprd11.prod.outlook.com ([fe80::5052:f83a:10ea:5627]) by BN9PR11MB5529.namprd11.prod.outlook.com ([fe80::5052:f83a:10ea:5627%9]) with mapi id 15.20.5144.029; Mon, 11 Apr 2022 08:13:47 +0000 From: "Zhang, RobinX" To: "Richardson, Bruce" CC: "dev@dpdk.org" , "Yang, Qiming" , "Zhang, Qi Z" , "Yang, SteveX" Subject: RE: [PATCH v2] common/sff_module: add telemetry command to dump module EEPROM Thread-Topic: [PATCH v2] common/sff_module: add telemetry command to dump module EEPROM Thread-Index: AQHYSzNR5Gga9td1yEyIf2Ceis0Blqzl0bCAgAAC+UCAAASxgIAAAHOwgAAG64CABG+3sA== Date: Mon, 11 Apr 2022 08:13:47 +0000 Message-ID: References: <20220215101853.919735-1-robinx.zhang@intel.com> <20220408102330.774749-1-robinx.zhang@intel.com> In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8001828e-4fd5-4489-8d5f-08da1b93346a x-ms-traffictypediagnostic: SJ0PR11MB4864:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: YZRN/aKUR4I85ujyvobgTVO3fMyU6FZ19yVr1zQEU8mHLOYtqL2CxgYP1FfGvmf1OvnwXwCsPALYVmpmTspGxFQgx0Xaqy7a5I0Ap0TeTwdw4Gc4q2wGVLA1nHUSkgW3sUMIWKg8PfYJeaLBR8Sn24KYCv0JTOa6dFsxqHaes8RvV/fFBEik7kYdFLT7QhINJta4aGkDbtVaPXZaHzdgN0ykS537cAh0YPfDSE1xVXWKf9Wm1vOEdRHZsAomKYxTAZlaugi9gQH+YihZEtGPDm811rP/2pSpu0ylICbNEtg2LEB54ezNhtb7skJuwOW5cULo5itN6Y9QjVYtz15upQHw3U8KLYzvMTTHDBE85m/4qHIlnrc3BPVxIsOl0lakxzEvCb+SVA902y3hY0ZRf0AWssGBJXMk9RqNfuloFcWabfnLhsekLDs8kF8Jg4C2GRY230MLFRTjdkg5X8x/xIpPJj09dzyyL2DLu2gqTpmRrRJ9mSkipsBQi1wpABkUscP4ftgxQUjxTIRaU7a1OtQrrpi7E7GO0oGiGIorMb33PDv73CZ0jAsE6zaRBmMrJuAm+Mosw1hgQLC3k0lEMBEm27A/hWiq9vynkC99IAYUbc8vAv1xxbN5ZfUJTF5+hBD7g4amZVQyCMm2DnrlIHqtdbltJM3KSBG1uOUEb353Ge5DsEZQ6dvs1u8Qja5bIUNxW3zrvJNnb8MqSnOSmQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN9PR11MB5529.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(316002)(66556008)(6636002)(66946007)(8936002)(66446008)(76116006)(66476007)(122000001)(71200400001)(5660300002)(54906003)(8676002)(53546011)(6862004)(9686003)(6506007)(7696005)(64756008)(4326008)(186003)(26005)(508600001)(52536014)(83380400001)(107886003)(82960400001)(86362001)(38070700005)(33656002)(2906002)(38100700002)(55016003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?x/Jwjsb9pPhISya+7trkqQoNznAC3fHwojtTPkRlBHWPGFeMjO5S+uQ4HC/U?= =?us-ascii?Q?Yk74d2zDu4V0JR/nT5NgxtILDa7/+J0X/5XxsCxZF8r940Q+WdTRSzsrmlic?= =?us-ascii?Q?lwGQBwEpRnqPmr+4sfBwmzoMJvKXzv6kdmbTkLzjOSo6cE/5qV/5naN7oA6l?= =?us-ascii?Q?xz/tPXhlIykDGh+CGeq6R5iy3+AbXm/G0NijPH/Cx/tBDyhUJ85roVjQXsFi?= =?us-ascii?Q?0dCu0b9AgPvJALKSZCmIIJ+qAq4FWsVWfDLkXzGiBRVEKPQiPTso3iGM8wea?= =?us-ascii?Q?TZp/F/QOa1pbztEqw4heqlo0WV9FOteDD+qln6RfNLokU6Tn552KIlsX3+xP?= =?us-ascii?Q?ZokJ+/jy5CXZsz6T9HZIYZPf6xQqbW98HqMYcq1g+WpDf+2t3558Yhx9lxHK?= =?us-ascii?Q?4NuOTp+a8HVGY1XCQQb1TZ2K/46psXtLjVVAlBwaKzkiON2EIBtbUD1H38+/?= =?us-ascii?Q?OOChZuSdN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wE1Vg2bGWNomn2oQet0z?= =?us-ascii?Q?EGuBQaXDf/zl1JhCVR+Qt32+adP07/E8yQs5kpjVQf02vLqphHvL8l6k3/Gw?= =?us-ascii?Q?lzm4ip5g7G0g6nxslJNJ7LD7zcVfQF9rihfzGlOq/+vTo+P5u0cMCnfwPC8Q?= =?us-ascii?Q?jLosKH+JHwKy9M9Vu85BhcNDKGdU2DHbysN3DkL9mPRN27WzH2YMresvpdx5?= =?us-ascii?Q?UM8yP6P5MVAsQXdB6iV+JTb5VtqmnJCl49nlSKm64KEA5HinC/3qfT1MuO2p?= =?us-ascii?Q?A87LiNssNwRn/Bis8zWuy0GLgD4LbkDnSC75Iw8OSxwx//U2r766rApC4F7W?= =?us-ascii?Q?NpDPkBY9WpwIhyymL9k+lpv1O6qN1Xhq9i5ufdiWHT81Ne3itYnTIy20+FKO?= =?us-ascii?Q?Jj0VMEbL5g=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN9PR11MB5529.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8001828e-4fd5-4489-8d5f-08da1b93346a X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Apr 2022 08:13:47.7544 (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: igjdriMdzgj1XkkzAggKGCLsT/jaVfaUfD1h5cNz0Qn2Lht+nQ48hQwuMJUf4fhypubUJKA8B8roq/KMUm+3Tw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB4864 X-OriginatorOrg: intel.com 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 Hi Bruce, > -----Original Message----- > From: Richardson, Bruce > Sent: Friday, April 8, 2022 7:27 PM > To: Zhang, RobinX > Cc: dev@dpdk.org; Yang, Qiming ; Zhang, Qi Z > ; Yang, SteveX > Subject: Re: [PATCH v2] common/sff_module: add telemetry command to > dump module EEPROM >=20 > On Fri, Apr 08, 2022 at 12:20:23PM +0100, Zhang, RobinX wrote: > > Hi Bruce > > > > > -----Original Message----- > > > From: Richardson, Bruce > > > Sent: Friday, April 8, 2022 7:01 PM > > > To: Zhang, RobinX > > > Cc: dev@dpdk.org; Yang, Qiming ; Zhang, Qi Z > > > ; Yang, SteveX > > > Subject: Re: [PATCH v2] common/sff_module: add telemetry command > to > > > dump module EEPROM > > > > > > On Fri, Apr 08, 2022 at 11:55:07AM +0100, Zhang, RobinX wrote: > > > > Hi Bruce, > > > > > > > > > -----Original Message----- > > > > > From: Richardson, Bruce > > > > > Sent: Friday, April 8, 2022 6:33 PM > > > > > To: Zhang, RobinX > > > > > Cc: dev@dpdk.org; Yang, Qiming ; Zhang, > > > > > Qi Z ; Yang, SteveX > > > > > > > > > > Subject: Re: [PATCH v2] common/sff_module: add telemetry > command > > > to > > > > > dump module EEPROM > > > > > > > > > > On Fri, Apr 08, 2022 at 10:23:30AM +0000, Robin Zhang wrote: > > > > > > This patch introduce a new telemetry command '/sff_module/info' > > > > > > to dump format module EEPROM information. > > > > > > > > > > > > The format support for SFP(Small Formfactor Pluggable)/SFP+ > > > > > > /QSFP+(Quad Small Formfactor Pluggable)/QSFP28 modules based > > > > > > on SFF(Small Form Factor) Committee specifications > > > > > > SFF-8079/SFF-8472/SFF-8024/SFF-8636. > > > > > > > > > > > > Signed-off-by: Robin Zhang > > > > > > --- > > > > > > > > > > > > v2: > > > > > > - Redesign the dump function as a telemetry command, so that > > > > > > the > > > > > EEPROM > > > > > > information can be used by other app. > > > > > > > > > > > > - The usage like this: > > > > > > > > > > > > Launch the primary application with telemetry: > > > > > > Take testpmd as example: ./app/dpdk-testpmd > > > > > > > > > > > > Then launch the telemetry client script: > > > > > > ./usertools/dpdk-telemetry.py > > > > > > > > > > > > In telemetry client run command: > > > > > > --> /sff_module/info, > > > > > > > > > > > > Both primary application and telemetry client will show the > formated > > > > > > module EEPROM information. > > > > > > > > > > > > drivers/common/meson.build | 1 + > > > > > > drivers/common/sff_module/meson.build | 16 + > > > > > > drivers/common/sff_module/sff_8079.c | 672 > ++++++++++++++ > > > > > > drivers/common/sff_module/sff_8472.c | 301 ++++++ > > > > > > drivers/common/sff_module/sff_8636.c | 1004 > > > > > +++++++++++++++++++++ > > > > > > drivers/common/sff_module/sff_8636.h | 592 ++++++++++++ > > > > > > drivers/common/sff_module/sff_common.c | 415 +++++++++ > > > > > > drivers/common/sff_module/sff_common.h | 192 ++++ > > > > > > drivers/common/sff_module/sff_telemetry.c | 142 +++ > > > > > > drivers/common/sff_module/sff_telemetry.h | 41 + > > > > > > drivers/common/sff_module/version.map | 9 + > > > > > > 11 files changed, 3385 insertions(+) create mode 100644 > > > > > > drivers/common/sff_module/meson.build > > > > > > create mode 100644 drivers/common/sff_module/sff_8079.c > > > > > > create mode 100644 drivers/common/sff_module/sff_8472.c > > > > > > create mode 100644 drivers/common/sff_module/sff_8636.c > > > > > > create mode 100644 drivers/common/sff_module/sff_8636.h > > > > > > create mode 100644 drivers/common/sff_module/sff_common.c > > > > > > create mode 100644 drivers/common/sff_module/sff_common.h > > > > > > create mode 100644 drivers/common/sff_module/sff_telemetry.c > > > > > > create mode 100644 drivers/common/sff_module/sff_telemetry.h > > > > > > create mode 100644 drivers/common/sff_module/version.map > > > > > > > > > > > Is this is whole new driver just to provide telemetry dumps of > > > > > SFP information? I can understand the problem somewhat - though > > > > > I am in some doubt that telemetry is the best way to expose this > > > > > information > > > > > - but creating a new driver seems the wrong approach here. SFPs > > > > > are for NIC devices, so why isn't this available in a common API > > > > > such as > > > ethdev? > > > > > > > > > > > > > I have considered add this function as a new telemetry command of > > > ethdev (like '/ethdev/sff_module_info') to dump these SFP information= . > > > > But I'm not sure if it's acceptable to add all these production > > > > code > > > (sff_8xxx.c) into lib/ethdev? > > > > If it's OK, I can make V3 patches to change it as a telemetry > > > > command of > > > ethdev. > > > > > > > > > > Hi, > > > > > > I think some discussion is needed before you go preparing a new > > > version of this patchset. > > > > > > Some initial questions: > > > > > > 1. Does SFF code apply only to Intel products/NICs or is it multi-ven= dor? > > The SFF code apply to multi-vendor. > > In fact, it's applied to all the NIC driver which implemented dev_ops- > >get_module_eeprom. > > > > > 2. For the driver approach you previously took, how was the presence = of > > > hardware detected to load the driver? > > The purpose of put these production code into drivers/common is want to > treat it as a common function for NIC drivers. > > It will not related to any presence of hardware. > > > > > 3. Does this work on SFPs need to interact with the NIC drivers in an= y way? > > > > > Yes, just like my answer in question 1, the module EEPROM raw data is g= et > from dev_ops->get_module_eeprom. > > So need the NIC drivers to implement dev_ops->get_module_eeprom. > > >=20 > So is the intent that individual NIC drivers would add a get_module_eepro= m > function to their drivers pointing at this driver? If so, this approach o= f putting > the code in drivers/common does make sense. However, this needs to be > better explained in the patch description, and maybe include with the dri= ver > patch (which should probably be split up into easier reviewed sections), > additional patches to add the get_eeprom function to some drivers to show > use. >=20 Let me explain in more detail. This patch actually include two parts: 1. Module EEPROM raw data parser code Files: sff_common.h, sff_common.c, sff_8xxx.* 2. Add new telemetry command Files: sff_telemetry.h, sff_telemetry.c Part 1 will only parsing the module EEPROM raw data base on different modul= e type. Now DPDK support 4 types that defined in rte_dev_info.h with macro RTE_ETH_= MODULE_SFF_8xxx. Part 2 will call rte_eth_dev_get_module_info and rte_eth_dev_get_module_eep= rom to get the module EEPROM raw data, then pass the raw data to Part 1 par= ser code. Finally, Part 1 parser code will print formatted information. So, these codes are more likely a common tool than a common driver, because= it will only read the module EEPROM raw data from NIC PMD driver. For those NIC drivers who has not implemented get_module_info and get_modul= e_eeprom dev_ops, we will simply return not support. > Thanks, > /Bruce