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 AADA3A00C5; Thu, 30 Apr 2020 08:18:40 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 344601D721; Thu, 30 Apr 2020 08:18:40 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id C4CDD1D719; Thu, 30 Apr 2020 08:18:38 +0200 (CEST) IronPort-SDR: vXfNyBBVA/1jJjTuYSjd+cbcplOCaiil+ukRLPXEUE2d35k9Ogyk/joshwZhkpVAqJGGMdn4Jo 1NCHybA0QAww== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2020 23:18:37 -0700 IronPort-SDR: 0/WQsp8FFmqbcbsxb54oViUHel1KrFL4hzVUCh68unjcU/T13U+zcXH1FyWm2xmH3ZqDeyg9Od mr5XzHWWNMyg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,334,1583222400"; d="scan'208";a="293457990" Received: from orsmsx106.amr.corp.intel.com ([10.22.225.133]) by fmsmga002.fm.intel.com with ESMTP; 29 Apr 2020 23:18:37 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX106.amr.corp.intel.com (10.22.225.133) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 29 Apr 2020 23:18:37 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 29 Apr 2020 23:18:37 -0700 Received: from ORSEDG002.ED.cps.intel.com (10.7.248.5) by orsmsx609.amr.corp.intel.com (10.22.229.22) 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, 29 Apr 2020 23:18:36 -0700 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (104.47.38.52) by edgegateway.intel.com (134.134.137.101) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 29 Apr 2020 23:18:26 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iIl3V4jvgOpSKvtiWRgS/ZIsVUsAetsMSnHBixHrQ79s0t9R5U0Y+XpbCCdlfMPQ3HRKLMYt/x8cBSm2bBDT0V2XPrrmXJ6MJtfJuUk/+9cD+gWVAxMTq3hhBxiS0sgnW6mIPGj7NKtMzqyAgaYcM+UP8rJiBawRGeFIbPgyX7WuuJMlHq6ZZIFgzaSE9abpFtJaJfBGaKiXXS3LOXk/DS1za7U12EnW4lVB0hcKQhQDVhC0hJMOayIQ5hgP9d3p9r+9l2+9EsfilyBHLoRoXO+ugPgVHrMFKmAQpzqP/rc/Kzk/Bv4pOMWsIVkPSWOAkYzDdrrxblOHp9LA/NE77Q== 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=REkXlehexZ3+C2jSEraopriRePF+o3P7YjzU/jNKjvM=; b=eiPiQGAvHuEDdPLtfmDaVqy4o9zanK3ZNMx1bSAU4S5FMQhSMQdBnN0IxPSLq/qn+EeHqaO6BS8QlKa6aUBZztPxxDJxopzkOL130UrO7j3XCy7p2Po8XL5KnHHRr8Xpm6FDu3wzGzBe+N7MU6IhuUD+kVo63/brZfpLybM698QHC/vOL2P7s73C5rjS2VSWSgrp6CEKjNd4Czb5TkiC2X4BMwh3goXmXpSS0QceVe8VTiEGiSB6onSQuV1BgvHfBwD3g134y7XaL0Mar4mErztam4ZfaReUNzqM2unpPZ/pSvYguj4YDkU9/36iDEaaEoJvqhENZz3BmTv78MSjxw== 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=REkXlehexZ3+C2jSEraopriRePF+o3P7YjzU/jNKjvM=; b=G9sPbuR0+gSXWDntig6oQiI1mzrvOkZVfdv0APGFaccwQ2pilnPeeg2uEkMfY09bDV6PGBikvn8NwcWW37e1NBYouKopAJ75SqkJ10lzUOr8V9m2rcQ7ibFsZRz+A1cmYlTs13ZFETHzkpNQtpghwk8RIdKRMTYvk31E2/CUIZI= Received: from BYAPR11MB3541.namprd11.prod.outlook.com (2603:10b6:a03:f5::16) by BYAPR11MB3272.namprd11.prod.outlook.com (2603:10b6:a03:1b::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20; Thu, 30 Apr 2020 06:18:22 +0000 Received: from BYAPR11MB3541.namprd11.prod.outlook.com ([fe80::2c4f:22b:b8b0:27f9]) by BYAPR11MB3541.namprd11.prod.outlook.com ([fe80::2c4f:22b:b8b0:27f9%5]) with mapi id 15.20.2937.028; Thu, 30 Apr 2020 06:18:22 +0000 From: "Xing, Beilei" To: "Zhang, AlvinX" , "dev@dpdk.org" CC: "Zhang, Qi Z" , "Wu, Jingjing" , "stable@dpdk.org" Thread-Topic: [PATCH v3] net/iavf: fix link speed Thread-Index: AQHWHp7MAWwPThYzOUKnfc1cQV8DQKiRMQIQ Date: Thu, 30 Apr 2020 06:18:22 +0000 Message-ID: References: <20200428090616.15260-1-alvinx.zhang@intel.com> <20200430032111.21380-1-alvinx.zhang@intel.com> In-Reply-To: <20200430032111.21380-1-alvinx.zhang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.102.204.45] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b343699e-5730-4275-6fc1-08d7ecce48cd x-ms-traffictypediagnostic: BYAPR11MB3272: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:741; x-forefront-prvs: 0389EDA07F x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: V+xX7KRmWu2xm+P4OOTpdBrEjNeHEnVUhuAuOY9rSfNXlkDa4AG6o4iHU1bzliGtF/FpWChavRqI4boeoMAh0toYfShef7sFLRY47SL8aCaGdOig5sDvRq55E/sSCY1Mlxb8f5i5eEwvsK+ycjylpnPWbiP5dcfq1duoP12xoxHE/dGtpwJtE4lItoeqVeDqUHC7k5gZWj5QeZa6YDC012E9MyQTHjr5boSfbirZsyqB11NEDGswfDDlKuMSqTO4+kLV4ToLAVGFc4Rq5+lrw2RNcCUwjDOSZFiXRb7tICKkeEus8aPPTfwbXPWb+/4WSlxs9o3BZOH7kVlVA9Os/ivTun2NS2wMIU2wAcsqXndMAFnioL1OlDwty4YAoFObJ6jriYL3hFOLApTItq6KCGBCcAMz5HCq8f0fJflW1PpgHjrKkGSO1G0L7vI84F2J 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:(366004)(396003)(39860400002)(346002)(376002)(136003)(71200400001)(54906003)(4326008)(53546011)(110136005)(6506007)(316002)(26005)(7696005)(450100002)(5660300002)(186003)(2906002)(52536014)(8936002)(55016002)(9686003)(478600001)(33656002)(66476007)(76116006)(66556008)(8676002)(86362001)(66446008)(66946007)(64756008); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: 8GWdI+v4E8lCvDe68H4FUKWA9FVBerleXF6iJCQVt+q3HyGTQAgBkeYyrB+NPH0HjJ4lNU3TlgqK67YGISXWdnaJ45QFPczis0wrQeOUN646FeaKhFAXtSQ7gATmxhpc/LAyFcjMBNiZGkg2Zp+2qi+c2bTOOXB3Fhk3Aolyd89lxc++wJqkLMrB3asDBvJ/tw3dBAGfxOLMrSNg1Gs0gDzzlZ9MUj1gbItzhVwTGVjzSB6cGfiZ6/CTs/y+xGdc0nq63mD+HHypTcsBOWKjKHq45S7YD5MVfKTen1m58uu6/DVrsODBk7xeMXfY/5HjfP+F3mIiE13qqb7IzguNUxMD7rRGMX1tOmItv/Q2VEmM82JmIiJ92LAa509QKeAVF9jV64/iGuyD/zObzwgctw9Ib2BVsCdGr2+jcc7z/OaxNzNtAyWWNKvFyilbqh6FYWOhalUYX30IXzRD8nNjxUHiwagLGHAE0zOLW7p0yqZ+qP0MXZSg3bdFq156h4U30DMbSm4qyy1SdrjxUxkB6214+5vCqicPIAL5wmOoIlKMKUz5Q9qmBBWCEu0y9srJ5CCgIK+Q7L2iQZWOih6YecgTwE3zLz5f8D526y5dwvKS9Dh6z52e3RGgNvvyAp5962KsN7DePOMnrK2l/pf4sJlpAHTRkHyMdupFs8Ha+sQLtE0Pylxc6xhZ2Mln4kLSVugT7qJXtG3GatSrJQpxk3DQbx6612Fnx4o7R5sU9ZLyBhhsItXstdF/LH8e5kobRyLjaFHsJ+l/3FhLsfy8TKSmr806vCUsJrOPVPN5kpA= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: b343699e-5730-4275-6fc1-08d7ecce48cd X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Apr 2020 06:18:22.2806 (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: LZHQlrQqJtHs1K6X7l4LpxW2jApN56kR3qqQUspeSv1fLHfdXf/1yvXpjxphKqPlXuwotTi3VI6Q1Umq3zHxKw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3272 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v3] net/iavf: fix link speed 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: Zhang, AlvinX > Sent: Thursday, April 30, 2020 11:21 AM > To: dev@dpdk.org > Cc: Zhang, Qi Z ; Xing, Beilei ; > Zhang, AlvinX ; Wu, Jingjing > ; stable@dpdk.org > Subject: [PATCH v3] net/iavf: fix link speed >=20 > From: Alvin Zhang >=20 > If the PF driver does not support the new speed reporting capabilities th= en > use link_event instead of link_event_adv to get the speed. >=20 > Fixes: 48de41ca11f0 (net/iavf: enable link status update) > Cc: jingjing.wu@intel.com > Cc: stable@dpdk.org >=20 > Signed-off-by: Alvin Zhang >=20 > V2: Modify codes according to comments. > V3: Update git log. > --- > drivers/net/iavf/iavf_vchnl.c | 47 > ++++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 46 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.= c index > 2a0cdd9..5b8d32e 100644 > --- a/drivers/net/iavf/iavf_vchnl.c > +++ b/drivers/net/iavf/iavf_vchnl.c > @@ -130,6 +130,44 @@ > return err; > } >=20 > +static uint32_t > +iavf_convert_link_speed(enum virtchnl_link_speed virt_link_speed) { > + uint32_t speed; > + > + switch (virt_link_speed) { > + case VIRTCHNL_LINK_SPEED_100MB: > + speed =3D 100; > + break; > + case VIRTCHNL_LINK_SPEED_1GB: > + speed =3D 1000; > + break; > + case VIRTCHNL_LINK_SPEED_10GB: > + speed =3D 10000; > + break; > + case VIRTCHNL_LINK_SPEED_40GB: > + speed =3D 40000; > + break; > + case VIRTCHNL_LINK_SPEED_20GB: > + speed =3D 20000; > + break; > + case VIRTCHNL_LINK_SPEED_25GB: > + speed =3D 25000; > + break; > + case VIRTCHNL_LINK_SPEED_2_5GB: > + speed =3D 2500; > + break; > + case VIRTCHNL_LINK_SPEED_5GB: > + speed =3D 5000; > + break; > + default: > + speed =3D 0; > + break; > + } > + > + return speed; > +} > + > static void > iavf_handle_pf_event_msg(struct rte_eth_dev *dev, uint8_t *msg, > uint16_t msglen) > @@ -151,7 +189,14 @@ > case VIRTCHNL_EVENT_LINK_CHANGE: > PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_LINK_CHANGE > event"); > vf->link_up =3D pf_msg->event_data.link_event.link_status; > - vf->link_speed =3D pf_msg- > >event_data.link_event_adv.link_speed; > + if (vf->vf_res->vf_cap_flags & > VIRTCHNL_VF_CAP_ADV_LINK_SPEED) { > + vf->link_speed =3D > + pf_msg- > >event_data.link_event_adv.link_speed; > + } else { > + enum virtchnl_link_speed speed; > + speed =3D pf_msg->event_data.link_event.link_speed; > + vf->link_speed =3D iavf_convert_link_speed(speed); > + } > iavf_dev_link_update(dev, 0); > _rte_eth_dev_callback_process(dev, > RTE_ETH_EVENT_INTR_LSC, > NULL); > -- > 1.8.3.1 Acked-by: Beilei Xing