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 78B11A0C3F; Thu, 15 Apr 2021 13:57:47 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 380FB162215; Thu, 15 Apr 2021 13:57:47 +0200 (CEST) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by mails.dpdk.org (Postfix) with ESMTP id 434CC162172 for ; Thu, 15 Apr 2021 13:57:46 +0200 (CEST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 904685C0161; Thu, 15 Apr 2021 07:57:45 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 15 Apr 2021 07:57:45 -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=fm3; bh= GTN8WZxTd8d8YnAo9W8A12GU72tyr9mHqq9hkk37YLU=; b=qP0GjV6LvXFN4Z1G iZXb7wZ9MkBTtmXuFo1I6rkw1/uqxVzSWgABUC2gnowKvrnSklM+bwJv5qNTk6wD zNGwkeCIApXPHH+BAhvbFGyAtKtF1wZtHbvc4R0IBRH9clHHWBrdJ6gZdqVwjk9b Db9QuBTupw0yP1l1mPHMCxZcva4vii1drh5BGt4957iEZe0epCezTAAy9GxFD/7A Sp/4f6nIQj0PZ6p/e+dI/tN+O/Fwhjcwfal6FsJc1daBnc6lZ6xanB7Nc/4hPYOC 1kNAIm67hCkcAVz6pVBVwoA37giOZY8jcfsdajd1q88WFmHw8HGJoCWfbIOEll42 l9Niyg== 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=fm2; bh=GTN8WZxTd8d8YnAo9W8A12GU72tyr9mHqq9hkk37Y LU=; b=CiZPKgApGtaNkBLKju4pblHHLU6TxohKkJMwDN0wkIetl2uNvDoK8utXA yVUKyuzJwSbWIeu3BI6mZes1RzLL86SVAuiYTiC5hwhvX736D/g5YdNC+ZOAb1O5 lli3O7cYGHknF2TNccC2vPuIoDqX6MZLAIjnAT3s2QTkdInhVYYjJz91fuc3GKcK scAcJ/Ur/GWT3WYtDo3ETV3jsx5QP4DRgdvNXNECfMa1ID5nv3kECR6GpOw14kuL CxUf+tkrKVBiXh9JsO0MDLraoDdm0WlTAZySKUO1d5UGAJsh2zEI6a/KgJwwHZa1 f1XUOOhGUw7hiIEwDP2ylJSfj7dUw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudelfedggeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepudeggfdvfeduffdtfeeglefghfeukefgfffhueejtdetuedtjeeu ieeivdffgeehnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl ohhnrdhnvght X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 4A724240057; Thu, 15 Apr 2021 07:57:44 -0400 (EDT) From: Thomas Monjalon To: Andrew Rybchenko Cc: "Min Hu (Connor)" , dev@dpdk.org, ferruh.yigit@intel.com Date: Thu, 15 Apr 2021 13:57:42 +0200 Message-ID: <2252218.jVnlyW2HoW@thomas> In-Reply-To: References: <1618046334-39857-1-git-send-email-humin29@huawei.com> <1618447925-12168-1-git-send-email-humin29@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v4] ethdev: add sanity checks in control APIs 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 Sender: "dev" 15/04/2021 10:15, Andrew Rybchenko: > > RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_configure, -ENOTSUP); > > In theory, the first argument is sufficient to make the ops > check, but I think it is the right solution to keep it as is > since current tendency is to check operation support when > driver callback is really required and we're going to use it. > However, if we do it just after port_id check, we'll have a > way to check for callback support without any side effects > if we provide invalid argument value. I.e. if -ENOTSUP is > returned, callback is not supported, if -EINVAL, callback is > supported (but argument is invalid and nothing done). > However, it looks a bit fragile and not always possible. > Thoughts on it are welcome. Sorry I don't understand it fully. You say we should check for ENOTSUP at the very beginning?