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 6294A41BAA; Thu, 2 Feb 2023 08:39:16 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 52E0042B7E; Thu, 2 Feb 2023 08:39:16 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id E79B3406A2 for ; Thu, 2 Feb 2023 08:39:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675323555; x=1706859555; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=Oy5j8HIJqK8RGX1xQNsdGqWzVHomL5pb/0jmd6s6xoQ=; b=MmvrBRblD3DEwXoHSliybdc89T83aiDbg/micbowg5+VoIovGBgzVUk+ AD2xddlB8BhukrTCjFWRFwaZlo+gR6k7uuICjGT886257kx99IKiZYajR MAUhmVwKd/aHqGHh0mDW4DJYVBAvapHFuGKGnPePDqKyZlkGbhoGkktad Uz+a351lB5fKkY49oqJIjRHaMViUwdArf1NNSpjl/IZw1a6OWcOkT2W1k SecoKLjrnbWJUmiQkqDhnmLQWb1EclB0eCebs9cCsAvp4BF5Cs0OUBNNF DJmVOEJPP4X4/MNMBGiVkdL998q9QqVxrhbgIWiUxbLfbUAolRBXgXEPE g==; X-IronPort-AV: E=McAfee;i="6500,9779,10608"; a="328394488" X-IronPort-AV: E=Sophos;i="5.97,266,1669104000"; d="scan'208";a="328394488" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2023 23:39:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10608"; a="839092048" X-IronPort-AV: E=Sophos;i="5.97,266,1669104000"; d="scan'208";a="839092048" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga005.jf.intel.com with ESMTP; 01 Feb 2023 23:39:13 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX603.amr.corp.intel.com (10.22.229.16) 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 23:39:13 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx610.amr.corp.intel.com (10.22.229.23) 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 23:39:13 -0800 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (104.47.73.44) by edgegateway.intel.com (134.134.137.100) 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 23:39:11 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HmXrttupWJ7ETfP9k/0APzVRpqTMSqdU9JP0zAEsYnJ0pzQT++vTXH7hz+S0nMG7QUYctTpEqfTvK3CLvlyCTDePdF9rjdmviqmmYPheEUkkix8n7MIpQZhjUpAo5PRgIDUgclU7AFL8El6xUUfS7XPefycMs5LPN5LDH0waZ3Q3YqRmsxQ+OTPbD8yQElObXDfHgcooFRrfGmH2opgWDDuxQa6n4ANWfpyA3bcYg/yRNHwtHnU+kcugn7ZgX61NdJy38c8u/kjyxRASdcqRnilVWIfSII0xIiatdnW0hVtOt9GNwY3LARDpIyTu7RKz/vwa+j/u/rtiGMM4njhakg== 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=HKse2orahezvtLIFbSQMK7De2jP8+Iz47lSBCmxFT68=; b=daT+uZflVSYnLyY652bCfyTHMc5xXVVQVASfUlA5C70cj6qDlYy2bCdEwgFiDTgjF9VlqAh6TXs0+meQ6IwAK5JkboqxtNQ0PUxgYn3K11OK2OeTTdR/IWdBS4WJVEb9t4/lW9iVkFgyGSSGY1EWFSPhzs2ZZOZDhQT612FxUoW9ZxE+ia9EvFJHEhqcnzo9XuzRMUieIKQrR3bHahIWGAB29irKejIqwkOrKX2Dbox02QZMuNFPEks+4cdNlZeo3FiIKQhV2md5avd62KTSw35yBXVTpJypeCKJwlgL5ilUonxFfEQbERcYG1D+ZLDBHDhHaWszQ1LecUkVQlVtgA== 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 PH0PR11MB5877.namprd11.prod.outlook.com (2603:10b6:510:141::12) by DM8PR11MB5592.namprd11.prod.outlook.com (2603:10b6:8:35::6) 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 07:39:04 +0000 Received: from PH0PR11MB5877.namprd11.prod.outlook.com ([fe80::8c1c:6df6:533f:282c]) by PH0PR11MB5877.namprd11.prod.outlook.com ([fe80::8c1c:6df6:533f:282c%8]) with mapi id 15.20.6064.027; Thu, 2 Feb 2023 07:39:04 +0000 From: "Liu, Mingxia" To: "Wu, Jingjing" , "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: AQHZKxRY+FUIc1VQYkKkZwZv9I6XWa67Jg+AgAAyhlA= Date: Thu, 2 Feb 2023 07:39:04 +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: 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: PH0PR11MB5877:EE_|DM8PR11MB5592:EE_ x-ms-office365-filtering-correlation-id: ff382df4-87e6-415f-29ea-08db04f08f64 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: L6eFTv27S62bvhpfeb6cvtCKdTR7I9krVlD8UsDJKfb1grmZxIsN0ZKx2O2jqNgMzbAfYZlPdlmicyT1RuVvUYz1WjvXDFaMWSV+S/YvIzVb+lD57ePZoQLn1BZB0FJkOdl7H+Zf/MxlKhBb98l6HleanKHIExIxQnvb5PMwI91a/aT3f080i7b3bZe41Gcc6rCLeuJS4oIUBiDu7mjHpzgqZI3PPzWyV+mUmrpuH99GyUbV0HY0k09orReesnTx9xi15nYtTwyAYf+MzODneCpsyMFCGHbeTxmBn8ifwyO4SBtIReu02ta2N8rtzn91hnN3uaqUfDOYdbR32ezrCW570FPTeeu1dM7N6soWIycKI10hrKs/cZreHEH0Z7ypJ5CQP5QvB+3hZCFhBpYhwcvloUQb89id76kze7OowIa8BRrHksysn/BNWbUjzqisy7trvFueeGhiLHnesIA9CcwIz1Z2X6sSOK2dMEqO5WVRXNMg6TMH1vDdM8JO5xS3qUv9+N1jbrz1a3uT+3QK8Gcw0vM+tjsvUH55ZBmL7IwzUO0AsXgy5tXOO6Ran1aMdrTPt52ZpN2jiWeVv8gcTInOE5XW3POz039PWomD6enK0qKycnplTSkiAFsjMLDhpKXS+JT+46+V84ytMBxzula4dOQPS8BDxliuPbmhGy6ySp4ozFNHU5FyjbXTUtQF4611KmRzA63xySrQFYS57RXwdfXzd5uMlTjcy3hra2o= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5877.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(136003)(376002)(346002)(396003)(39860400002)(366004)(451199018)(9686003)(83380400001)(38070700005)(2906002)(15650500001)(5660300002)(53546011)(186003)(71200400001)(8676002)(7696005)(66556008)(107886003)(33656002)(66446008)(6506007)(8936002)(4326008)(86362001)(41300700001)(478600001)(26005)(122000001)(82960400001)(38100700002)(66476007)(55016003)(64756008)(110136005)(316002)(66946007)(52536014)(76116006)(21314003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?10XGw+pCw8Ke426vYH50+pbv3dJO8aelYVy8hdpSUUR7dRp/uT/zkpO53x8q?= =?us-ascii?Q?uwCzaKzS+FxVNSxgnQSyjAFsXwb29hZh9asrKJPJTUKER2bmcXv6EFYgagMo?= =?us-ascii?Q?t3wMMuQRAtkpnMpCwZ/JdbByl67zPYJI557WYauzOG+Rbd+8/Sk1fUyz3iOC?= =?us-ascii?Q?dK6guoYkdFjf46WaeIkEekbHIwuRkFNONv9VJzfQdb71R00CPwxASA64g8dH?= =?us-ascii?Q?+kunsO2E2BjobrJv4jSadhDb4i+XMdVzeQu2/JCsuL7JcNFU8s5W5H6unCDh?= =?us-ascii?Q?9RgO2/x96yIh2SyrASuCA8882tvIfNhRpX5lecDtEA+bG6BJ3ULkCUpm/Qy3?= =?us-ascii?Q?l/H3eB9mr89F6sKUr+OXOxZilk93la9k47NsxHqvST62E43/IVeecCAbF7Aj?= =?us-ascii?Q?dlTWNVGCMU+rlnaMs7jGZd30osdOCP0fEvZOqAQQCdlWXpqFnSJgcj7XrbVy?= =?us-ascii?Q?GkNZI7knttKLycrE2TOviBbAFPSJmll8JeNlit/is5JowkqaacCNeepY//R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jTMvbSrjfot/JYFJIq8wV3IxBi?= =?us-ascii?Q?VaVLBDxrxini8CGAEQwLBnN0H5bxpiB+8Ix4JAvhrXqMIT7HShJW6tDEj84v?= =?us-ascii?Q?3TFU4Ey9ssS8Gk8wlaE0HlytuXhAf7lGfzRdDOIhhAgzPmuxMhtfhio4GDOF?= =?us-ascii?Q?6oiWytuESBBb7UtnZHH1U7KbUS5hkNo4kerXdECl?= 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: PH0PR11MB5877.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ff382df4-87e6-415f-29ea-08db04f08f64 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Feb 2023 07:39:04.7269 (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: eDA0lsFd8RqnY5tuZ96lnD+8RBeXgM6hLktAJKRNrKGpSr2+9dacQncgPtvmrSG2YAVIcdj1yHtmVx6vNA9ArA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR11MB5592 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 > -----Original Message----- > From: Wu, Jingjing > Sent: Thursday, February 2, 2023 12:24 PM > To: Liu, Mingxia ; dev@dpdk.org > Cc: Xing, Beilei > Subject: RE: [PATCH v3 5/6] common/idpf: add alarm to support handle vchn= l > message >=20 > > @@ -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; > > > > memset(&new_link, 0, sizeof(new_link)); > > > > - 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 [Liu, Mingxia] According to the comment description of struct rte_eth_conf,= RTE_ETH_LINK_SPEED_FIXED is better. struct rte_eth_conf { uint32_t link_speeds; /**< bitmap of RTE_ETH_LINK_SPEED_XXX of speeds to be used. RTE_ETH_LINK_SPEED_FIXED disables link autonegotiation, and a unique speed shall be set. Otherwise, the bitmap defines the set of speeds to be advertised. If the special value RTE_ETH_LINK_SPEED_AUTONEG (0) is used, all speeds supported are advertised. */ > > > > @@ -927,6 +965,127 @@ idpf_parse_devargs(struct rte_pci_device > > *pci_dev, struct idpf_adapter_ext *adap > > return ret; > > } > > > > +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 msglen) { > > + 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? >=20 [Liu, Mingxia] Ok, thanks, I 'll use !! to convert uint8 to bool.