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 CC717A00C4; Thu, 31 Oct 2019 14:58:40 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 814391C24F; Thu, 31 Oct 2019 14:58:40 +0100 (CET) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by dpdk.org (Postfix) with ESMTP id 0939B1C24A for ; Thu, 31 Oct 2019 14:58:40 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id ABBDA2252A; Thu, 31 Oct 2019 09:58:39 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 31 Oct 2019 09:58:39 -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=3oNmNyuFv8FJol7gQGQgJ48z+8mGZyAoW40KNpGqHEU=; b=enMDaOoJoCWp 1DujTdIWIocmTv624IpQ8tag+aAQV3A0lMyB7pEKq/t6YYxoPU3v4AuSnoqEHAAc BFOW0V5k6kWTP27D5I7e5oUx6Z4lGo3CoznogouUENb9hRl2+36ZDZUNIHQ28YWq kJPPGAjCIDn5It/+RlQz2dFvkp3Ts/w= 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=fm1; bh=3oNmNyuFv8FJol7gQGQgJ48z+8mGZyAoW40KNpGqH EU=; b=q4ZR6VhCiAgXzbLVm/rHAXyG5JBS/vHCu5wBbkkB2726mN0ea9+vvEIUP rqGM1fu8TG794Ga19QfUuVs17da26lx248OFuRIdmK36CwRmN1RXoNxZpUOceTEQ /DihMW8XvDL081LQftcQg93hatyh8chczN/ydjrpEYehBLJdtdAXAt9400HZY/7q otviwKjeYsnWiuqgjZbMdXz+igvsD3DpqTpre8Sc/YUdKMdEW5Uvrg45WCmky+aV VasL5Xr4hQWJVIIx28ZR8Sy4JGMhWPrFFPkwCrHfJwJs2IhRP3eC19410S8jHWU/ 5uhCId04algUL7hOfsf3NIRJImbsg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedruddthedgheehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkjghfggfgtgesthfure dttddtvdenucfhrhhomhepvfhhohhmrghsucfoohhnjhgrlhhonhcuoehthhhomhgrshes mhhonhhjrghlohhnrdhnvghtqeenucfkphepjeejrddufeegrddvtdefrddukeegnecurf grrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtnecu vehluhhsthgvrhfuihiivgeptd 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 630883060066; Thu, 31 Oct 2019 09:58:38 -0400 (EDT) From: Thomas Monjalon To: pbhagavatula@marvell.com Cc: dev@dpdk.org, ferruh.yigit@intel.com, arybchenko@solarflare.com, jerinj@marvell.com Date: Thu, 31 Oct 2019 14:58:37 +0100 Message-ID: <56162614.NpA4zj6keT@xps> In-Reply-To: <20191029153722.4547-4-pbhagavatula@marvell.com> References: <20191029050312.2715-1-pbhagavatula@marvell.com> <20191029153722.4547-1-pbhagavatula@marvell.com> <20191029153722.4547-4-pbhagavatula@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v15 3/7] ethdev: add validation to offloads set by PMD 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" 29/10/2019 16:37, pbhagavatula@marvell.com: > From: Pavan Nikhilesh > --- a/lib/librte_ethdev/rte_ethdev.c > +++ b/lib/librte_ethdev/rte_ethdev.c > +static int > +_rte_eth_dev_validate_offloads(uint16_t port_id, uint64_t req_offloads, > + uint64_t set_offloads, > + const char *(*f)(uint64_t)) Please do not call "f" a function parameter. This function has a purpose, please name it. Overall, I feel it would be easier to understand this function with a comment on top, explaining each parameter. Thanks > +{ > + uint64_t offloads_diff = req_offloads ^ set_offloads; > + uint64_t offloads_req_diff, offloads_set_diff; > + uint64_t offload; > + uint8_t err = 0; > + > + /* Check if any offload is advertised but not enabled. */ Not sure "advertised" is the right word here.