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 81B90A04C9; Mon, 14 Sep 2020 00:25:46 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9AD902C52; Mon, 14 Sep 2020 00:25:45 +0200 (CEST) Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by dpdk.org (Postfix) with ESMTP id F32121DB9 for ; Mon, 14 Sep 2020 00:25:43 +0200 (CEST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 93632605; Sun, 13 Sep 2020 18:25:42 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Sun, 13 Sep 2020 18:25:43 -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=fm2; bh= oKH8Cc8l2FNCyBrej7nr4z7/lcrMNwQMxlXcRTIBh9A=; b=I9RWx4RgHabpkd3H aeeuV1pkhHU8EbvfGQGnY+aTF+FDB5wnZ+YwTd2YbgTZOfuoKwBKL2LwsJMODFW1 2DyL/w9rhDdbY23L1FerJKO9mLcJnEUDTHpalwD2XLC+o41pGE+BygKwWb503d+3 aCmvInYwsDt6V66fj+2nUo3+7+6Fi4lG+BMRseMY0yllfAFDRulA46I1zy1gx06Z kUVGW2MvZuOCjwAsHvTG2biViKHoqDzIZZCwjMYorP2DvPPOVn3Te0wp7FK/Wzhg m82ptoljZtQ3LEh/DEeGR9sM4Uhk2YO2wbFfe3TcpGACx3KjCNn0ggEiG52/2K5o aaHrxw== 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=oKH8Cc8l2FNCyBrej7nr4z7/lcrMNwQMxlXcRTIBh 9A=; b=JL4lwWMr4H29Q6LoxlNriPTeVWeqZI8hQD4dRaLqmBgOUsQUJ3QqggRaL wU+i/fbfqsWk/lNNuuTIH2Tu8sD56kb/W2gC50Rh+IzV0thV7FjFn9hQjEmHW1el ej6zdN+e92yKbjVpY+WDm0E9/ZwHXUT0blDOoUwYMjjjkxdOSUzcC+uSxcEYkUM/ dlpue/NywcBZZ72f2k0rY2yUJfFDu+I7hiSt/aEC9HWjMkp785JvhIkLUTOo7/m+ r4+xWrQg1sftD3Gy7Gn2VJSALWFZZMpNon96z+e3E+Cjg5qbvFqrDeev3ymzzDBb 8kZuspjMRA5pGyLoIm2hpwlRDMw8Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudeihedgtdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepffdvffejueetleefieeludduuefgteejleevfeekjeefieegheet ffdvkeefgedunecuffhomhgrihhnpeguphgukhdrohhrghenucfkphepjeejrddufeegrd dvtdefrddukeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhf rhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth 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 E19A2328005A; Sun, 13 Sep 2020 18:25:40 -0400 (EDT) From: Thomas Monjalon To: SteveX Yang Cc: dev@dpdk.org, qiming.yang@intel.com, beilei.xing@intel.com, jingjing.wu@intel.com, Qi Zhang , ferruh.yigit@intel.com Date: Mon, 14 Sep 2020 00:25:39 +0200 Message-ID: <9724451.1XQYmnX9Yp@thomas> In-Reply-To: <2832850.hRueZzFlNT@thomas> References: <20200811072752.20813-1-stevex.yang@intel.com> <2832850.hRueZzFlNT@thomas> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] net/iavf: release port upon close 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" As you may notice, I have included a slightly modified version of this patch in my series in order to cover the full picture: https://patches.dpdk.org/patch/77559/ Feel free to continue improving your patch in this thread or the other, as you prefer, as long as the secondary process issue is adressed. Thanks 13/09/2020 10:53, Thomas Monjalon: > Hi, > > SteveX Yang wrote: > > Set RTE_ETH_DEV_CLOSE_REMOVE upon probe so all the private resources > > for the port can be freed by rte_eth_dev_close(). > > > > Signed-off-by: SteveX Yang > > I guess the X is not part of your name. > > [...] > > -static int > > -iavf_dev_uninit(struct rte_eth_dev *dev) > > -{ > > - struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(dev->data->dev_private); > > - > > - if (rte_eal_process_type() != RTE_PROC_PRIMARY) > > - return -EPERM; > > All the code below is moved from iavf_dev_uninit() where it was > restricted to the primary process, to iavf_dev_close() which can be > called from the primary process. > It looks inconsistent. > > > > > dev->dev_ops = NULL; > > dev->rx_pkt_burst = NULL; > > dev->tx_pkt_burst = NULL; > > > > - iavf_dev_close(dev); > > + > > + if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_RSS_PF) { > > + if (vf->rss_lut) { > > + rte_free(vf->rss_lut); > > + vf->rss_lut = NULL; > > + } > > + if (vf->rss_key) { > > + rte_free(vf->rss_key); > > + vf->rss_key = NULL; > > + } > > + } > > > > rte_free(vf->vf_res); > > vf->vsi_res = NULL; > > > > @@ -1449,15 +1456,15 @@ iavf_dev_uninit(struct rte_eth_dev *dev) > > > > rte_free(vf->aq_resp); > > vf->aq_resp = NULL; > > > > +} > > > > - if (vf->rss_lut) { > > - rte_free(vf->rss_lut); > > - vf->rss_lut = NULL; > > - } > > - if (vf->rss_key) { > > - rte_free(vf->rss_key); > > - vf->rss_key = NULL; > > - } > > +static int > > +iavf_dev_uninit(struct rte_eth_dev *dev) > > +{ > > + if (rte_eal_process_type() != RTE_PROC_PRIMARY) > > + return -EPERM; > > + > > + iavf_dev_close(dev); > > Are you sure about what should be freed in the secondary process? > If iavf_dev_close() should not be called by the secondary process, > you should move the check inside the function, > because iavf_dev_close() is also called by rte_eth_dev_close(). > > > > > return 0; > > > > }