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 7A51341D44; Mon, 27 Feb 2023 16:45:54 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1805540A84; Mon, 27 Feb 2023 16:45:54 +0100 (CET) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by mails.dpdk.org (Postfix) with ESMTP id A064440A7D; Mon, 27 Feb 2023 16:45:52 +0100 (CET) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 3295D5C00FB; Mon, 27 Feb 2023 10:45:52 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 27 Feb 2023 10:45:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1677512752; x= 1677599152; bh=Yvv0FbHdAj7DY7NCPnfAEvnNJablbo+US76uq9dGHxM=; b=h LTTVxh1sN5XzWoQDa9FJuecGvmOs+bZpurwSSEBygwD6km3Ygl7xw2P2Islyce93 qPDEqI/2W3NASv7pO5aToeniA6gW99Gl9w0kAongoNJIdPjQ5uY5AgKhp8bA1Nn/ TV6CNOhogyVWYGvcDpO/2Tde8fG/o0YW4KpsMM1i5jV04sGPoJ5S+LSQOn40xAd0 jOQTyvHRH7wAC7z2AHT71k6QcBAALSaaSIS1OyFTQo2xFT8cH4VqGjNKX27Vu7xG +iQlK4PmNkKI2NS4cN2tOdXHNQb2eCBmxinkq9ZOJ0nGZHas3meblHR+2JbjAW5i 9xSBIVeZDA8gfJU52Z3GA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1677512752; x= 1677599152; bh=Yvv0FbHdAj7DY7NCPnfAEvnNJablbo+US76uq9dGHxM=; b=T K25je+xN2LS0t13q39SnkD61SP8ABZsbIt/WE2u4pTdMsyzzgFg0XshrP7kJE/8c KqWYNmCEoyyDB4o+DEIkZ1TOoz9x4X4atx6ZGO7ihmqVdm23x2Y7RLvMYblpf9Ta /vGh1/3RQakrgx9Y+XocTmAWYjeOpbj7DgNxQJCfTbSlPYhv1UzbOHTT65ynB1yX 4ksHl+ZhKJ7ttygC3Tp5rz8o8cQYqCyahIoGiIs30r/aK5pR/MDLYlHbLFQ31CAr gbwF5iXhfc4q1PddOKV/rAoZ8CA6VmOzwcHeGaeKSLITVEUZxXj9NDE5CjfyL4uL stbFKAQ2A7e+lxBFM3syA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudeltddgjeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedtjeeiieefhedtfffgvdelteeufeefheeujefgueetfedttdei kefgkeduhedtgfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 27 Feb 2023 10:45:50 -0500 (EST) From: Thomas Monjalon To: Andrew Rybchenko , Jerin Jacob Kollanukkaran , Qi Z Zhang , David Marchand , Ferruh Yigit Cc: dev@dpdk.org, Mingxia Liu , yuying.zhang@intel.com, beilei.xing@intel.com, "techboard@dpdk.org" Subject: Re: [PATCH v7 01/21] net/cpfl: support device initialization Date: Mon, 27 Feb 2023 16:45:49 +0100 Message-ID: <1745700.4herOUoSWf@thomas> In-Reply-To: References: <20230213021956.2953088-1-mingxia.liu@intel.com> <20230216003010.3439881-2-mingxia.liu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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 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 = &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 != 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 != 0) { > > + PMD_INIT_LOG(ERR, "Loopback operation mode %d is not supported", > > + conf->lpbk_mode); > > + return -ENOTSUP; > > + } > > + > > + if (conf->dcb_capability_en != 0) { > > + PMD_INIT_LOG(ERR, "Priority Flow Control(PFC) if not supported"); > > + return -ENOTSUP; > > + } > > + > > + if (conf->intr_conf.lsc != 0) { > > + PMD_INIT_LOG(ERR, "LSC interrupt is not supported"); > > + return -ENOTSUP; > > + } > > + > > + if (conf->intr_conf.rxq != 0) { > > + PMD_INIT_LOG(ERR, "RXQ interrupt is not supported"); > > + return -ENOTSUP; > > + } > > + > > + if (conf->intr_conf.rmv != 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. There are some capabilities to read before calling "configure". > 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? Which failures cannot be guessed with capability flags? > 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? I am not sure we can change such an old API. > And I think this is another reason why we should not make a single API > too overloaded and complex. Right, and I would support a work to have some of those "configure" features available as small functions.