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 CE796A0C47; Thu, 14 Oct 2021 14:51:01 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AF12B4112E; Thu, 14 Oct 2021 14:51:01 +0200 (CEST) Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by mails.dpdk.org (Postfix) with ESMTP id 0BDEB40E50 for ; Thu, 14 Oct 2021 14:51:01 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 913443200A5F; Thu, 14 Oct 2021 08:50:59 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 14 Oct 2021 08:51:00 -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= wNbY1Qc35sKskTJm3nD077/QHSAyZOTazEcj31ssoYU=; b=Xq6EQF9AXiY/rJET 9dl6fPkBMbKztgw20su8k4CeX/iZOhkE4HY66HSFkYA1jWQx07cSjVBgs4T2lITl 9SeGTf8tFtzF+ATDQOYjxe1Mmnk0beWrgXCEa0YRXjeKC1ZHXD5e0fAhQt2l3W5N /H//qg3wtmbmW2PczrC41WCQJ2yCnOdLJjm+97Vn1n3VbuTKQbZd0cy2cC/cnWRh MnmZCJ2fmFxRkLm2RArUUQ2HrbG/jGXF9raksdqLZdn+kR6mKfB5npAp/+zrtLQ+ UteGYUbEthTiKi9KzmnAeBq0BMLZbeAxvjG6GTWsResJlwxz9ND74ZtrmJIUlxgR iQNCmg== 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=wNbY1Qc35sKskTJm3nD077/QHSAyZOTazEcj31sso YU=; b=bVVDiJhA2gUAFuoHXvDOTwJn8ILdkWhm3P1C2Lw00bWjUALwf1xRdn1KW Gx58jcVQwsrPL4nLCoQ1xH5vmJoljsLs7c1YfUdvsPC4oXdCPDt+qTAG3WdA3zKt TU1yEGSej36v+DKB0n1I0V7PheVARSSINPQq+lr1rcSC5/zFnhJbFl4pZOQlWtZ/ UCH/jCmSerX5OTFF29cixMkv7F/7WpAZ6mPJFhUM4w4A3/MjRPY/0RWEwC8K6tLC Ikw7yaeQ+zWoY356392fTyDz8XzqeJ13TLGJ51rKocd9hIBcfTpAjBK9RJnAI0Jn TiCpbTPK2VjAAQhRBRbBGO2IZldLA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvdduvddgheehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtqhertddttdejnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepkeethedtieevhfeigeejleegudefjeehkeekteeuveeiuedvveeu tdejveehveetnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 14 Oct 2021 08:50:56 -0400 (EDT) From: Thomas Monjalon To: "lihuisong (C)" Cc: dev@dpdk.org, ferruh.yigit@intel.com, aman.deep.singh@intel.com, andrew.rybchenko@oktetlabs.ru, anatoly.burakov@intel.com Date: Thu, 14 Oct 2021 14:50:53 +0200 Message-ID: <2377545.FrEbOPdPNe@thomas> In-Reply-To: <13a0f09e-fc93-3256-e58f-11cec1e02dc8@huawei.com> References: <1627908397-51565-1-git-send-email-lihuisong@huawei.com> <2527815.Doo92MvZa3@thomas> <13a0f09e-fc93-3256-e58f-11cec1e02dc8@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH V2] ethdev: fix eth device released repeatedly 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" 14/10/2021 14:32, lihuisong (C): > Hi, Thomas >=20 > *The commit log=EF=BC=9A* > In secondary process, rte_eth_dev_close() doesn't clear eth_dev->data. > If calling rte_dev_remove() after rte_eth_dev_close(), in=20 > rte_eth_dev_pci_generic_remove() > function, the released eth device still can be found by its name in=20 > shared memory. > As a result, the eth device will be released repeatedly. The state of=20 > the eth device > is modified to RTE_ETH_DEV_UNUSED after rte_eth_dev_close(). So this=20 > state can > be used to avoid this problem. >=20 > Is that will be more clear? Yes, that's clear (at least for me). > /* > * A released eth device can be found by its name in shared memory. > * If the state of the eth device is RTE_ETH_DEV_UNUSED, which means > * the eth device has been released. > */ >=20 > Is it ok to use the above description as a comment in the code? Yes. One small change, I think "which" should be "it". > Hope for your reply. Thanks. Thanks