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 1D6D5A0C3F; Thu, 15 Apr 2021 14:15:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0256116223A; Thu, 15 Apr 2021 14:15:34 +0200 (CEST) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by mails.dpdk.org (Postfix) with ESMTP id 121A1162229 for ; Thu, 15 Apr 2021 14:15:33 +0200 (CEST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id ACE065C017F; Thu, 15 Apr 2021 08:15:32 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 15 Apr 2021 08:15:32 -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= 0wREXel/aX9gZ95m8foOVEgdfU3i5arLduzolhlRZRE=; b=Ew2b+DzPYLtTH14N lam+D8K4iK+8gm9mohsmZbO5YN2BM6lsElpo0bG3f0Wn6NvbC1ISo6fxcnXuew8n hCwgDAoH2cTq/3TbwXI1NFU/e/MDEqSFW85fcHkcsUN4ywYp61+EZhcw1efINoTy NS/f22nQSeKWB7IpRujh+8CfCTN4bmNV0AgZIrjBLD1Y3XS2Kzrc/OTFJVvVZz+p oa3/wroGRirdYQS2xSiaRaxFlMRT4HlpkR+OP9vcjUBALIjF31I11o79wF5Lq66u OOUqDeJiVP/uiwJgEuEzkHDw7vON0QkAP8+3qyqqL6somv85ugXxZ0CL1NvKAy5F /qxDaA== 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=0wREXel/aX9gZ95m8foOVEgdfU3i5arLduzolhlRZ RE=; b=L+sdqbTa2mbtC/QfKVDOa0JrLe5M3ZTl9mQ4zfnlvcyaQr42Gz1DEHiak CP3ekinpX6Y8Mz6UrHSLg1K7+NkfBAY0IL0b4qfVtrJY42DBdvchZ9cN5MSnW9VY Zo6xlNIHKqSHiZpiU3D5lRkeJRf7o/lVF1ciSq6Z6c9QQ8BrSeSqDRsWuFxLTbPI dBWI06nCiOJc+qoEwp1QAmFSualABnLiMfdzj5zU3rE64AMSejEs4TADq5YsQqVa yIcZc/0bhBooHhO6InK4AjF3WazvC1Rwwey/iUbCl4k0Q1xciqkXrpFue7b8vjiC R0m3+Ba3kgM+4/Fbaq+QrSp7Vmk+Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudelfedgheefucetufdoteggodetrfdotf 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 05F021080067; Thu, 15 Apr 2021 08:15:30 -0400 (EDT) From: Thomas Monjalon To: "Min Hu (Connor)" , Kevin Traynor Cc: dev@dpdk.org, ferruh.yigit@intel.com, andrew.rybchenko@oktetlabs.ru Date: Thu, 15 Apr 2021 14:15:28 +0200 Message-ID: <2194266.8AjRMLih77@thomas> In-Reply-To: <087b2c22-adda-2639-cbdf-2e765f463a91@redhat.com> References: <1618046334-39857-1-git-send-email-humin29@huawei.com> <1618447925-12168-1-git-send-email-humin29@huawei.com> <087b2c22-adda-2639-cbdf-2e765f463a91@redhat.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 14:04, Kevin Traynor: > On 15/04/2021 01:52, Min Hu (Connor) wrote: > > + if (iter == NULL) { > > + RTE_ETHDEV_LOG(ERR, "Failed to iterator init for NULL\n"); > > "Failed to init iterator for NULL iterator\n" The word "Failed" looks weird in these checks. What about "Cannot"? Example: "Cannot init NULL iterator" > > + if (devargs_str == NULL) { > > + RTE_ETHDEV_LOG(ERR, "Failed to iterate matching NULL\n"); > > "Failed to init iterator for NULL devargs\n" "Cannot init iterator for NULL devargs" > > + if (owner == NULL) { > > + RTE_ETHDEV_LOG(ERR, "Failed to get ethdev port %u owner by NULL\n", > > + port_id); > > + return -EINVAL; > > + } > > This fn uses both %u and %"PRIu16" for port_id I don't see the benefit of PRIu16. > > + if (str == NULL) { > > + RTE_ETHDEV_LOG(ERR, "Failed to convert link to NULL\n"); > > "Failed to convert link to NULL string\n" "Cannot convert link in NULL string" > > + if (eth_link == NULL) { > > + RTE_ETHDEV_LOG(ERR, "Failed to convert NULL to string\n"); > > "Failed to convert NULL link to string\n" "Cannot convert NULL link"