From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 254CFC28CC1 for ; Sat, 1 Jun 2019 16:21:58 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id D7EC02768D for ; Sat, 1 Jun 2019 16:21:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D7EC02768D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A5CF01C0B; Sat, 1 Jun 2019 18:21:56 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id F243D9E4 for ; Sat, 1 Jun 2019 18:21:54 +0200 (CEST) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Jun 2019 09:21:53 -0700 X-ExtLoop1: 1 Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.110.206]) by orsmga007.jf.intel.com with ESMTP; 01 Jun 2019 09:21:52 -0700 Date: Sun, 2 Jun 2019 00:13:16 +0800 From: Ye Xiaolong To: William Tu Cc: dev@dpdk.org, i.maximets@samsung.com Message-ID: <20190601161316.GA53701@intel.com> References: <1559321562-39928-1-git-send-email-u9012063@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1559321562-39928-1-git-send-email-u9012063@gmail.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH] net/af_xdp: fix failure on rte_dev_remove 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" On 05/31, William Tu wrote: >When users call rte_eth_dev_close() and rte_dev_remove(), the af_xdp >pmd return -1 (EPERM) due to eth_dev == NULL. > >Since the af_xdp pmd driver advertises RTE_ETH_DEV_CLOSE_REMOVE, all >the resources are freed on rte_eth_dev_close(). rte_dev_remove() tries >to detach device and subsequently calls rte_pmd_af_xdp_remove() that tries >to free already freed resources and fails. Fix it by return success. > >Fixes: f1debd77efaf6 ("net/af_xdp: introduce AF_XDP PMD") >Reported-at: https://patchwork.ozlabs.org/patch/1106528/ >Signed-off-by: William Tu >Suggested-by: Ilya Maximets >--- > drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c >index 35c72272c919..3dcc3628c5d0 100644 >--- a/drivers/net/af_xdp/rte_eth_af_xdp.c >+++ b/drivers/net/af_xdp/rte_eth_af_xdp.c >@@ -944,7 +944,7 @@ rte_pmd_af_xdp_remove(struct rte_vdev_device *dev) > /* find the ethdev entry */ > eth_dev = rte_eth_dev_allocated(rte_vdev_device_name(dev)); > if (eth_dev == NULL) >- return -1; >+ return 0; > > eth_dev_close(eth_dev); > rte_eth_dev_release_port(eth_dev); Looks good to me. Thanks for the fix. Acked-by: Xiaolong Ye Thanks, Xiaolong >-- >2.7.4 >