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 5C44741BA7; Thu, 2 Feb 2023 05:23:45 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F3A8F406A2; Thu, 2 Feb 2023 05:23:44 +0100 (CET) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 3A4AC4067B for ; Thu, 2 Feb 2023 05:23:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675311823; x=1706847823; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=AM7M3zTREouu2EO9OkioXlMhdUnAwOY7yJ2aFiv5AtU=; b=HuuyzBcFzyCgHdYsmYwx8BkUy2JNLQe22K5o7vAzqxSdeEZqwep9COXU dFJ3zua2xMWs6AGT4D0tFYOnHQujtVNnmSLuXP1srBYIUKamYPzomQ3P7 f1bRgfzOW7du9t9kRztvv/1jGxDxG0vVmlO6wG3Khf5YdTEfhggSMQ0Al 19mg1kil+vMYzgUvKULE3tdrZZQa4U7kQdEWRmcAbidQGNnYn1NKvIW3V 1nqzWx2u7AmdmG3PqKYYKUr4gmBkYlwRWiVuGWgT6Fclm8DrKP1Q0yFem kWfX35enKWvWbG4TLyioZlj7VvmJDG1ebtUprfaveDUs8PGIVuu5Devcs Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10608"; a="390737921" X-IronPort-AV: E=Sophos;i="5.97,266,1669104000"; d="scan'208";a="390737921" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2023 20:23:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10608"; a="839038228" X-IronPort-AV: E=Sophos;i="5.97,266,1669104000"; d="scan'208";a="839038228" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga005.jf.intel.com with ESMTP; 01 Feb 2023 20:23:42 -0800 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Wed, 1 Feb 2023 20:23:41 -0800 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Wed, 1 Feb 2023 20:23:41 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) 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.2507.16 via Frontend Transport; Wed, 1 Feb 2023 20:23:41 -0800 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.174) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Wed, 1 Feb 2023 20:23:40 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HHw8S3aMhUbIuksK0lPxjGptSwd+whSnPCh6u8DF7yGv5RaFztF4uagu19aarzRgH0yxHVYBjngJSgQTnEddGxzp+U10h5buI69tYV+ihzc1V3mslECv+rsNFFfZ9ZlrR0bSsn5+4ZyD2p8FYudHdLgOCiNkDESZ65xAlKkU/70oAExZMLxqJG6A3SdehVQO9MKO4HxPzt4K0CFpNwcMAr6TrgfoKzJkWUbdXWqql3jUH6fMLD/lFUwK0nRGlI25lrCaZAR23mb24/Kwpj+7Xc6CqonsrEpBH95UimNTJXIMn0smzz7lPqi4c2QeZs6/JMvTK+LsqsyNzAE+G9t91w== 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=9qV3fbJ0+rLKtR3TQSxBRwhZRJfOlb5M5xv1DhCUNq8=; b=aG5RJ9lXEOZJNEzX7ogtdupK3ET3uLVIPhSGS735DzlvwG2MvexkucJlcP19dekmRfLHcRmKM16NXO6Cw05k2yo5LucATzF5FSS0lw3hx6IdnMlqWUs8GfWYa7OOuPvef4+0jQlt2xQW6HW+kFdvXGbzTR7y9gs5en7ZyCaOQCQI0ZXHRKA01Rd5GrCIg4nd+++/2W21I1Cjgd8b87QyNn+Mep9POORSnk2dQblAaqwDQp8pdtqs7XJFNMYBDBhMm9wWCe4ga0iKznvbkva//lKtTRyyt2VacGvJouULF8jJt6bDO6g2usRO8Ev7hFWaKCeXTCYrPatUm03q2MAw2A== 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 MW3PR11MB4587.namprd11.prod.outlook.com (2603:10b6:303:58::7) by IA0PR11MB7353.namprd11.prod.outlook.com (2603:10b6:208:435::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Thu, 2 Feb 2023 04:23:34 +0000 Received: from MW3PR11MB4587.namprd11.prod.outlook.com ([fe80::8b2c:e748:6431:3cb0]) by MW3PR11MB4587.namprd11.prod.outlook.com ([fe80::8b2c:e748:6431:3cb0%4]) with mapi id 15.20.6064.025; Thu, 2 Feb 2023 04:23:33 +0000 From: "Wu, Jingjing" To: "Liu, Mingxia" , "dev@dpdk.org" CC: "Xing, Beilei" Subject: RE: [PATCH v3 5/6] common/idpf: add alarm to support handle vchnl message Thread-Topic: [PATCH v3 5/6] common/idpf: add alarm to support handle vchnl message Thread-Index: AQHZKxRYFwhvz1GoqUCBlXNJkqlQxq67I2Yw Date: Thu, 2 Feb 2023 04:23:33 +0000 Message-ID: References: <20230111071545.504706-1-mingxia.liu@intel.com> <20230118071440.902155-1-mingxia.liu@intel.com> <20230118071440.902155-6-mingxia.liu@intel.com> In-Reply-To: <20230118071440.902155-6-mingxia.liu@intel.com> Accept-Language: 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-traffictypediagnostic: MW3PR11MB4587:EE_|IA0PR11MB7353:EE_ x-ms-office365-filtering-correlation-id: 9b68dd76-e9ab-4e88-7ae7-08db04d53f37 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: qPMMRpoPWY0qVCQDK4K+4ER/QTKvKK6g+cB+plv2xdW4G6sqhHROSVZeHAVM/14WYE9SgCzRATa7gEQ8hAJWKfiajQpq7mUcgXn+Bvk008J8ScP2hPgjt/hLUE9UszmoJkjKb1UunUtxLyUxHh3PKJ41sB41OQSMI2fb+bBrp/YoRj8/jN/TdIxHznLrYNCKBtiekwR4HlH0cp9r3YFk+XPvRVp6SEXhoXZNuEWB/PAdGOUBSZnLzVng7LmWDjuEh2ncAC0YYvBM9d7A22OO+SFTcZWDucHVrArKd4jDBMXrfq3UpLE+CAaXcCB5HMQewKAmxt0gxS9g7LpN0MhN0nig/tcBK0btJjuhsd8bSd5B30cUGwbMsgGPle0L+buYx5K8Z0oowe3qhxinMcWUIijvVsRi0M/BKBXA6GeYK12cASQhmRn1CRGY/lE8TKsxsGrEMqv/I3iXF9aC0UfQmwQ+bDZxE9LSCUKwOMCskcdfvfkJfILe3VPfK56v4GVlTiL2wXY1RdJYf7QwvuDMM70srwXwqieooHWxUOSwIlUldfO/qCZ+35+hCjFMIXjyHchTOL64sLmfM7mWdNnb0yV3BShgY31iZa95vx1XLTvZ0pTKvYkOzQlftXvdxjHQWtTnxThU2J0/KMtPqwXUDKvei6IKAiD/tMsYGj0WrrTc8FMG9htttRpeVr4X/XXFRJl04+phRP18PhBscis7eg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW3PR11MB4587.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(346002)(396003)(366004)(136003)(39860400002)(376002)(451199018)(33656002)(86362001)(316002)(83380400001)(110136005)(66556008)(38100700002)(6506007)(5660300002)(478600001)(26005)(71200400001)(122000001)(7696005)(9686003)(52536014)(186003)(8936002)(107886003)(76116006)(38070700005)(55016003)(66446008)(66946007)(64756008)(8676002)(82960400001)(41300700001)(2906002)(4326008)(66476007); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?YIqHU2kwx2uCTBWvkWC+PeifPo6R0imIJvXrz8ZKwj9bl5rlwUY/1NjyZqzR?= =?us-ascii?Q?xYplHcE54tFH1e+Zy5/N2zxQXCffpXAYIOCewKmYLWvapQccvAzl44A0WnEP?= =?us-ascii?Q?b3xiPn6brF6Ztbfki8X89DcuAQmgZRnIRgusba98xXmm1e+qooPsw+fioA3J?= =?us-ascii?Q?tiQuCO9QDQQf/hOCw0VzFM3Y8CctsN8DNRU+gqVvdPvsPs+VeFUnR2roGt19?= =?us-ascii?Q?LOoqeg9+3stS7+I5tAxCNWzz5kAls2hXfWf1NIa9JOLmgg/N/i536Sew8Q2S?= =?us-ascii?Q?3uGCpqyOOgPltHsznCYjdGTklkCgJd8ig/Mw6vEkw7T1vO4cfKc70FblnD9p?= =?us-ascii?Q?LMM2wu9wip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FJOFR3hQqEDLiQ?= =?us-ascii?Q?sxFbaGBxR0c427OrmGZOxsAWQczHEgdBCHqElbnN1rmqGfnBzY9KKu6pbozM?= =?us-ascii?Q?jGcw+qOCXG/7dm63w7Lo4rMk9AXEmABXTCyfb5kOSmKcDmQZmeOww+zfuTu2?= =?us-ascii?Q?zv0hQ48fNQkY9akFwc3TM5aAIMP6wkuzAZGnx8U+4nFX0irvJbybPTDmhwiH?= =?us-ascii?Q?ebHeKM1nEOFewO5w2jkOARIVIjTc8C8Ol5c363ejsGdb9E3KnmZ4m9sqJGkN?= =?us-ascii?Q?gnXN7xogoVlQqO3FSrrx6w6JxB4GSU3a4EW1dCmSpcWG7klbWXo8uegKjgSy?= =?us-ascii?Q?4ipCpMUszm1RsdemXY0yzQM9ea0WBWtnJLWRMWwT?= 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: MW3PR11MB4587.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9b68dd76-e9ab-4e88-7ae7-08db04d53f37 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Feb 2023 04:23:33.7890 (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: 5NDPS60hADrm8Kv8y9Z4w/EqRX4z7Hd5PvB5nNKEgbDMwpybP6tddC0nwdXpIck+VqfXw8npsEuMsFcb4XKClw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR11MB7353 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 > @@ -83,12 +84,49 @@ static int > idpf_dev_link_update(struct rte_eth_dev *dev, > __rte_unused int wait_to_complete) > { > + struct idpf_vport *vport =3D dev->data->dev_private; > struct rte_eth_link new_link; >=20 > memset(&new_link, 0, sizeof(new_link)); >=20 > - new_link.link_speed =3D RTE_ETH_SPEED_NUM_NONE; > + switch (vport->link_speed) { > + case 10: > + new_link.link_speed =3D RTE_ETH_SPEED_NUM_10M; > + break; > + case 100: > + new_link.link_speed =3D RTE_ETH_SPEED_NUM_100M; > + break; > + case 1000: > + new_link.link_speed =3D RTE_ETH_SPEED_NUM_1G; > + break; > + case 10000: > + new_link.link_speed =3D RTE_ETH_SPEED_NUM_10G; > + break; > + case 20000: > + new_link.link_speed =3D RTE_ETH_SPEED_NUM_20G; > + break; > + case 25000: > + new_link.link_speed =3D RTE_ETH_SPEED_NUM_25G; > + break; > + case 40000: > + new_link.link_speed =3D RTE_ETH_SPEED_NUM_40G; > + break; > + case 50000: > + new_link.link_speed =3D RTE_ETH_SPEED_NUM_50G; > + break; > + case 100000: > + new_link.link_speed =3D RTE_ETH_SPEED_NUM_100G; > + break; > + case 200000: > + new_link.link_speed =3D RTE_ETH_SPEED_NUM_200G; > + break; > + default: > + new_link.link_speed =3D RTE_ETH_SPEED_NUM_NONE; > + } > + > new_link.link_duplex =3D RTE_ETH_LINK_FULL_DUPLEX; > + new_link.link_status =3D vport->link_up ? RTE_ETH_LINK_UP : > + RTE_ETH_LINK_DOWN; > new_link.link_autoneg =3D !(dev->data->dev_conf.link_speeds & > RTE_ETH_LINK_SPEED_FIXED); Better to use RTE_ETH_LINK_[AUTONEG/FIXED] instead. >=20 > @@ -927,6 +965,127 @@ idpf_parse_devargs(struct rte_pci_device *pci_dev, = struct > idpf_adapter_ext *adap > return ret; > } >=20 > +static struct idpf_vport * > +idpf_find_vport(struct idpf_adapter_ext *adapter, uint32_t vport_id) > +{ > + struct idpf_vport *vport =3D NULL; > + int i; > + > + for (i =3D 0; i < adapter->cur_vport_nb; i++) { > + vport =3D adapter->vports[i]; > + if (vport->vport_id !=3D vport_id) > + continue; > + else > + return vport; > + } > + > + return vport; > +} > + > +static void > +idpf_handle_event_msg(struct idpf_vport *vport, uint8_t *msg, uint16_t m= sglen) > +{ > + struct virtchnl2_event *vc_event =3D (struct virtchnl2_event *)msg; > + struct rte_eth_dev *dev =3D (struct rte_eth_dev *)vport->dev; > + > + if (msglen < sizeof(struct virtchnl2_event)) { > + PMD_DRV_LOG(ERR, "Error event"); > + return; > + } > + > + switch (vc_event->event) { > + case VIRTCHNL2_EVENT_LINK_CHANGE: > + PMD_DRV_LOG(DEBUG, "VIRTCHNL2_EVENT_LINK_CHANGE"); > + vport->link_up =3D vc_event->link_status; Any conversion between bool and uint8?