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 BB389A0613 for ; Thu, 29 Aug 2019 20:36:09 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 455F91E540; Thu, 29 Aug 2019 20:36:04 +0200 (CEST) Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by dpdk.org (Postfix) with ESMTP id 50F271E543 for ; Thu, 29 Aug 2019 20:36:03 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 090AD4B1; Thu, 29 Aug 2019 14:36:01 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 29 Aug 2019 14:36:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=Os7XH2bcY1MfwmcO2uoLs4QTSGxSCGgwllRsK4M5VPY=; b=RPt8u+B3hYaG DyZr7BvfIoa3rBZoLOZnEmIquxSrM5fvLmV7EZQFMqm1g/v7XSfH4JnCu2FMFl3/ gNvE/x6B0wLMQzie4czC3GhEEumtVG9RWnnulRs2w5z4av6sSIhcz3xBitezF89C FyTvu+WGzK3yvXEEOJJPiEQR91nq/uM= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=Os7XH2bcY1MfwmcO2uoLs4QTSGxSCGgwllRsK4M5V PY=; b=F4z7QfBgceA4qEQdhybXrbTSKFN96qJESFqVQg/BoGVOPuw1Nyw0cHw0P 1+4UBRGD3BzoAL/QVljRIosk0P6VhpHDSaVQ05ziI8bn6KD3x57Zkxaj24cYlNZo zrlomdyLO+4C7GaxWusxTfz4QKCEU8vXh812bZFtzUTad15vFEBZG6jQgXJpe/+f G6R7zsh6kNy9ibrLV2XmiV1ULEcGrbpYgxtS+9fBBPIIj6D6ioCLmDcWLDGrFDhd 2dX7p9Z0oekMvDe3ZvoiGR7LmYr0p9vPuVmCrjSo7wAz/UC512WGhasFbxXHOn1j 1SuQC9ZP1krJA8ThRUujC5YuakY2w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrudeivddguddvfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc fkphepleefrddvfedruddthedrvddvvdenucfrrghrrghmpehmrghilhhfrhhomhepthhh ohhmrghssehmohhnjhgrlhhonhdrnhgvthenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from xps.localnet (222.105.23.93.rev.sfr.net [93.23.105.222]) by mail.messagingengine.com (Postfix) with ESMTPA id 3D48F80061; Thu, 29 Aug 2019 14:35:57 -0400 (EDT) From: Thomas Monjalon To: Andrew Rybchenko , Jan Viktorin , Ferruh Yigit Cc: Neil Horman , John McNamara , Marko Kovacevic , dev@dpdk.org, Ivan Ilchenko Date: Thu, 29 Aug 2019 18:56:38 +0200 Message-ID: <1886728.S05C2o22q7@xps> In-Reply-To: References: <1566915962-5472-2-git-send-email-arybchenko@solarflare.com> <20190828132638.24193266@coaster.localdomain> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH 01/51] ethdev: change rte_eth_dev_info_get() return value to int 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" 28/08/2019 16:39, Andrew Rybchenko: > On 8/28/19 2:26 PM, Jan Viktorin wrote: > > Andrew Rybchenko wrote: > >> On 8/28/19 12:51 PM, Jan Viktorin wrote: > >>> Andrew Rybchenko wrote: > >>>> From: Ivan Ilchenko > >>>> + * @return > >>>> + * - (0) if successful. > >>>> + * - (-ENOTSUP) if support for dev_infos_get() does not exist > >>>> for the device. > >>> I believe that allowing PMDs to return -ENOTSUP is not a good idea. > >>> At the moment, all PMDs provides this kind of information. It is not > >>> always very reliable piece of information but for me, it is a piece > >>> of gold I would not like to loose when configuring devices. > >>> > >>> I think it should be mandatory for all PMDs to provide this > >>> function. Another possible way, give a sane default contents of > >>> this structure. But, please, do not return -ENOTSUP. > >> I agree that dev_infos_get() callback should be mandatory, but > >> what the function should do if the callback is not provided? > > One way would be to fail to register a PMD without that callback. > > Such PMD driver would be simply wrong. This is what I mean by saying > > "mandatory" - the callback MUST be provided. > > Typically callbacks are set on probe and > rte_eth_dev_pci_generic_probe() and similar functions could > be updated to reject devices with missing dev_infos_get callback. > However, there is a secondary process cases where dev_infos_get > is not essential since control path may be unsupported in secondary > process. > > Anyway, I think it is a separate story. > > > DPDK could be so nice to provide a default callback named like > > default_dev_infos_get_when_you_are_incompetent_pmd_author() returning > > mostly zeros and some always "known metadata" like device pointer, > > driver_name, ... > > Thomas, Ferruh, what do you think? I like the idea of making some functions mandatory. If we need to provide a default callback, why not. I'm also thinking we need to better enforce a standardization of basic features to be implemented. It would make DPDK more mature.