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 5190C41D94; Tue, 28 Feb 2023 03:06:18 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D59B140DD8; Tue, 28 Feb 2023 03:06:17 +0100 (CET) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 1860F40141; Tue, 28 Feb 2023 03:06:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677549976; x=1709085976; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=LZbKI3ttJYnYSM3WdAn9+HrKbLdRQ0UxPeB5q90ics8=; b=dEWZ3sw8VBEVJZOlfM/9iLucCRt2+F9cMHUa1cRdH5+qzI76eFOZOwD5 6YFeEFHvZx5933TuMaEKp2CUwPNLZfYtzejwS+vx7VnJHrhlQBm4vQPfo u69ZxMRG99ie2j+Dv5sI6v8XIQE8Uc2yQ32axu1zVV19lyiTh1BBzoW4c tzoBQOrpfq2kPPdvoc4qX7HySg7uUWUNHB5aln0MyJt9r6Yg6a5n82QgK i5vhdmF+L6Gwvk9xAr0kiNdZcab8cV48iJDKIVdUMEhaWwM8F49+mahpg 8rI2kKnBrKNcgEOgp/NISt6zcE9Ed2ypBuVh/R07Abhp8CKf4RPrhhIxj w==; X-IronPort-AV: E=McAfee;i="6500,9779,10634"; a="396589743" X-IronPort-AV: E=Sophos;i="5.98,220,1673942400"; d="scan'208";a="396589743" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2023 18:06:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10634"; a="1003054720" X-IronPort-AV: E=Sophos;i="5.98,220,1673942400"; d="scan'208";a="1003054720" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by fmsmga005.fm.intel.com with ESMTP; 27 Feb 2023 18:06:10 -0800 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) 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; Mon, 27 Feb 2023 18:06:10 -0800 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Mon, 27 Feb 2023 18:06:10 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) 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 via Frontend Transport; Mon, 27 Feb 2023 18:06:10 -0800 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.173) 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; Mon, 27 Feb 2023 18:06:10 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PjNIfwvkIMKCd4ptgIee3AD6Vpp/5FRaotbT0CeIdG6USKOC/GDIf6NoiqYaDTYU3vsq4poyaUNI68b1B7CnPqnqUfjuudvLMOFZQE+yEdm4dVE9KDHm2kasqHl7/oI61Hv0pCY4biO43Sb6VaZSw/BGalS0240vnkPgSYqFcDe9Q1ungfXzky2UMFmF00nqoXT9bzz05BP8hJHu9gpFxcHWuwENx0AVWxrSKCaDYmWyiI/QiFWgq+H2MUg/MZHwKaRGhq6VTI0WFBrNcM56Kw4ffBf4OmoTDNGN16pRaAlP+9PflIbsJyGozqQWrGxs0ssMCqPRapdiem1jk4SuiQ== 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=QXJdNOC93kxX++9epp+dT8or98CP5c/dWUjcctwD3Ug=; b=lwuCT9Y/sk1l+yYS1WD60exb6PabM6OvBryNPOaD1hXD+oW+ORcF0ygWnEAdbRts9RoJOEf1U8X4HVzU1LIBQX3l403v0sU5+t482e0WoAkQzROjxpPrtbjI2IXtKBWOJMzQICIW/D6k9A9CSzFEM7Si7pyByrdsUwUe4R3GB9mDu5+0pVb6W9AtOQRFYUuF7MIuedgxKo0woMTq0jaxcyosoXBghrnm5072ZXiKshvqNKbBmKPZrs5xDGAsX+7shU/MeC0T0xB0C015sftGDEkj2AohKf5EawqaJlAImb5QSNF8duwJychmAh+fqBYiUC7iJpBBPFShcGWmK2CU8A== 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 DS0PR11MB7733.namprd11.prod.outlook.com (2603:10b6:8:dc::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.29; Tue, 28 Feb 2023 02:06:08 +0000 Received: from PH0PR11MB5877.namprd11.prod.outlook.com ([fe80::73e:9f2f:1bef:8263]) by PH0PR11MB5877.namprd11.prod.outlook.com ([fe80::73e:9f2f:1bef:8263%7]) with mapi id 15.20.6134.024; Tue, 28 Feb 2023 02:06:08 +0000 From: "Liu, Mingxia" To: Thomas Monjalon , Andrew Rybchenko , Jerin Jacob Kollanukkaran , "Zhang, Qi Z" , David Marchand , Ferruh Yigit CC: "dev@dpdk.org" , "Zhang, Yuying" , "Xing, Beilei" , "techboard@dpdk.org" Subject: RE: [PATCH v7 01/21] net/cpfl: support device initialization Thread-Topic: [PATCH v7 01/21] net/cpfl: support device initialization Thread-Index: AQHZQaXnIP1faqCYNUGlqcuuTss4q67i4I6AgAAhRoCAAKuuYA== Date: Tue, 28 Feb 2023 02:06:08 +0000 Message-ID: References: <20230213021956.2953088-1-mingxia.liu@intel.com> <20230216003010.3439881-2-mingxia.liu@intel.com> <1745700.4herOUoSWf@thomas> In-Reply-To: <1745700.4herOUoSWf@thomas> 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_|DS0PR11MB7733:EE_ x-ms-office365-filtering-correlation-id: eb6ebc45-03ed-4651-8a08-08db19305b1b x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: i9iK6PVoxGKNlLFQb/CMrKYjLDgris2hPRnmRTACJsG1o1zeD8VlvF5Yl59iUT83AMwScLR28AMz5rjoDq5LeBa6zu0SJlbcLYWfa7w+wfYuNdinNZiqYuBekty+pTDJ6e6hx5RU/DA8iS05zB9NyF4pH63CQNBx5oJ/n7axiSIkEd6jY4PCaFutCdRlYt8VKfEDIFzoE4FNzOKoJ0ErGme2KmMSEACUWzOElmiTqNJ9TNh9NvZpD7Szx5Cu8ckrnEn3xO79g2qHIEvyDc7+d1eG2L1nxx/8NGdu/RhE3RTrb4LSVlvgMq2nBBxP6FaqFQoaLA+zMkDivRvUUO5G3Af8mocX39AX8qfUY1KBr8jLVs73VXGQ2ndreuS8RT+6Rw9lfvHOkAJB+2JRlzgK1D6xkTo29Nw9sYcE/eOq29S+gnf27KoZXKK3X+MqnD+BEPe9g9aBpxVVy2HP9ZxrKA3UwjJ0hDBbab97KU47PLUAHKv32WnOQdb/NLkjQ6syzoJ5OQgvigTSdxldkNO0OHTjld58JpIBAtShQvl12eUi+eMr/hakimMQEldzcz3WFAd5if1Y9qkTxVI+PRknQweSoh4hBaWJLJsJYj+n7ivYqHICye2iG2/kQHIdlUCKv4HScbUrNRdLfCEf6ssgXGNmawVRW0tn019wdMUonTlbzhtBH8ph8JSQ3bH2xnUxMR2yy0OXRDFkrJhrThDdcg== 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)(396003)(136003)(376002)(39860400002)(346002)(366004)(451199018)(122000001)(83380400001)(54906003)(110136005)(316002)(33656002)(82960400001)(4326008)(64756008)(38100700002)(8676002)(66446008)(55016003)(26005)(6506007)(53546011)(9686003)(66476007)(186003)(478600001)(7696005)(71200400001)(5660300002)(66556008)(86362001)(66946007)(41300700001)(76116006)(52536014)(8936002)(2906002)(38070700005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?RXv4mJuhTiFnX1HhIYIPiCx2K1iY7bPxB4Fo30RUSfowYkut5fgrl4psnGym?= =?us-ascii?Q?1ga4mO2dD8sHZB7VjiafnIMK5yr72bkAMR83CRNJhC5zO0q8V5CR57xynTSD?= =?us-ascii?Q?9dTkkQ/Xsis8LucunDgFbYMdaJVLcSCMVC9UeBTz+CNmRJsvNHucp9E0tQiO?= =?us-ascii?Q?5z6l2Py2sf+goY//FFTRlJjTaDmQSrzzuN8Xwqyd5jmrUNzHPdchlT2hNahY?= =?us-ascii?Q?2bmuy3FTSrYuBWpudumO1glOGLqZwF3dCz01DMWO6Gmv2rQvcsWZEJCNYS38?= =?us-ascii?Q?L3yWzia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4rUVtG+fRclJNo8C8FaAR?= =?us-ascii?Q?RhUlbculDkLhig9CQNBicL4kmT4lNbVvGD6qPDlIhpFYnNrFHoeSryMVUwZe?= =?us-ascii?Q?t1+EXXZ89AJ86VWIe6J9FJvWwnmUNfLUO+7dNxj1lpzyV1GEs9CotTsS8wVX?= =?us-ascii?Q?BC5DiE74xSVVEp6QycydSr/sgXI13uMJGgZPUjLlLN4N7Gexu8f6iJyACG90?= =?us-ascii?Q?I+BbZmpn8VF/SQlE3uNwRlQe+/EkK1yOcrHCbt1D6eEIP4vUEN3AE3Yvc2Qi?= =?us-ascii?Q?APyCsvU7vYGC6+bGbRDDS+xHd7aqDfbcDAYLpZhnkhLucmJ4uYl5ipAxDU5Q?= =?us-ascii?Q?kSooLAMhH5LtdRRMOgZ+4Z5sITVeb0N4CtdTmVRh8iVy9bUpXbFvPfY6eyq/?= =?us-ascii?Q?bdUfbtVe36b3H2RVVr4mfED+tEzuKgR//6NP5zX5?= 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: eb6ebc45-03ed-4651-8a08-08db19305b1b X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Feb 2023 02:06:08.0557 (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: 19lRLlxsZsm3dakrY7M0S3W5ESLox04JVftsAZsYGDjcO28aQLvzAyHofX34jOJjVw0108HJn1GBUAB+Lj7ntw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR11MB7733 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 Thanks you all! It's a good question, but as it is experimental version and rc2 is approach= ing, we won't optimize this function now, and will do it at the time of the offi= cial product release. > -----Original Message----- > From: Thomas Monjalon > Sent: Monday, February 27, 2023 11:46 PM > To: Andrew Rybchenko ; Jerin Jacob > Kollanukkaran ; Zhang, Qi Z ; > David Marchand ; Ferruh Yigit > > Cc: dev@dpdk.org; Liu, Mingxia ; Zhang, Yuying > ; Xing, Beilei ; > techboard@dpdk.org > Subject: Re: [PATCH v7 01/21] net/cpfl: support device initialization >=20 > 27/02/2023 14:46, Ferruh Yigit: > > On 2/16/2023 12:29 AM, Mingxia Liu wrote: > > > +static int > > > +cpfl_dev_configure(struct rte_eth_dev *dev) { > > > + struct rte_eth_conf *conf =3D &dev->data->dev_conf; > > > + > > > + if (conf->link_speeds & RTE_ETH_LINK_SPEED_FIXED) { > > > + PMD_INIT_LOG(ERR, "Setting link speed is not supported"); > > > + return -ENOTSUP; > > > + } > > > + > > > + if (conf->txmode.mq_mode !=3D RTE_ETH_MQ_TX_NONE) { > > > + PMD_INIT_LOG(ERR, "Multi-queue TX mode %d is not > supported", > > > + conf->txmode.mq_mode); > > > + return -ENOTSUP; > > > + } > > > + > > > + if (conf->lpbk_mode !=3D 0) { > > > + PMD_INIT_LOG(ERR, "Loopback operation mode %d is not > supported", > > > + conf->lpbk_mode); > > > + return -ENOTSUP; > > > + } > > > + > > > + if (conf->dcb_capability_en !=3D 0) { > > > + PMD_INIT_LOG(ERR, "Priority Flow Control(PFC) if not > supported"); > > > + return -ENOTSUP; > > > + } > > > + > > > + if (conf->intr_conf.lsc !=3D 0) { > > > + PMD_INIT_LOG(ERR, "LSC interrupt is not supported"); > > > + return -ENOTSUP; > > > + } > > > + > > > + if (conf->intr_conf.rxq !=3D 0) { > > > + PMD_INIT_LOG(ERR, "RXQ interrupt is not supported"); > > > + return -ENOTSUP; > > > + } > > > + > > > + if (conf->intr_conf.rmv !=3D 0) { > > > + PMD_INIT_LOG(ERR, "RMV interrupt is not supported"); > > > + return -ENOTSUP; > > > + } > > > + > > > + return 0; > > > > This is '.dev_configure()' dev ops of a driver, there is nothing wrong > > with the function but it is a good example to highlight a point. > > > > > > 'rte_eth_dev_configure()' can fail from various reasons, what can an > > application do in this case? > > It is not clear why configuration failed, there is no way to figure > > out failed config option dynamically. >=20 > There are some capabilities to read before calling "configure". >=20 > > Application developer can read the log and find out what caused the > > failure, but what can do next? Put a conditional check for the > > particular device, assuming application supports multiple devices, > > before configuration? >=20 > Which failures cannot be guessed with capability flags? >=20 > > I think we need better error value, to help application detect what > > went wrong and adapt dynamically, perhaps a bitmask of errors one per > > each config option, what do you think? >=20 > I am not sure we can change such an old API. >=20 > > And I think this is another reason why we should not make a single API > > too overloaded and complex. >=20 > Right, and I would support a work to have some of those "configure" > features available as small functions. >=20