From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 3B684A0096 for ; Thu, 6 Jun 2019 14:18:33 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0ACAF1B99B; Thu, 6 Jun 2019 14:18:32 +0200 (CEST) Received: from mail-vs1-f67.google.com (mail-vs1-f67.google.com [209.85.217.67]) by dpdk.org (Postfix) with ESMTP id DECCC1B99A for ; Thu, 6 Jun 2019 14:18:30 +0200 (CEST) Received: by mail-vs1-f67.google.com with SMTP id v6so1064102vsq.4 for ; Thu, 06 Jun 2019 05:18:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SDFHd49bj8wrHzkfcQ+EDysjkWclsydzjuFk3uUr5jM=; b=DgBqlxPhGoCFG/PIpXOCMUKEaXtx491xVBITU4tNrHQQBQSiDqzVBG1k45QdKdoBrz EoowJIf6zEm2mvKrm/4uEav4OB4pRdudgFUwc95xvDVa56bX+NQpVNks1F15M3Cw+oTB pS4YVe7a7o58/HLbuoYusNs608HVqV4AcYeIGRfcyulHPidK32Oz0rMNmbqP2SPuK9cK FKYybp+DKGdSHXGVk8xlCsvcjvc43iFDgrpu4psJM2qmlmCyfWjC2TL304UoFhgba70i g6va8fhgQTK9oR2zExAAyIGsPiaj0DsxJbGbrPydrqxKoYG7l+/Og6HiD5ikJjhjzTzV 2Z/w== X-Gm-Message-State: APjAAAWwQDG6jSfodTn3OtXnfmYjPPPHvNBca4zkm7mmzRVpNQEGkFgN +kKXiqJ6T6++OLthkpnVTrhGK7Q0DkdDIL8hhuJzoQ== X-Google-Smtp-Source: APXvYqwVey1yQnbjF5PyexlQQ/vjMT/1m+SrxzAb8hDWbHvRyvF3/6hiVio8UGfZClSo1uqFBS93/6RjzdFi6nOoRpk= X-Received: by 2002:a67:688f:: with SMTP id d137mr14964751vsc.198.1559823510320; Thu, 06 Jun 2019 05:18:30 -0700 (PDT) MIME-Version: 1.0 References: <1559321562-39928-1-git-send-email-u9012063@gmail.com> <20190601161316.GA53701@intel.com> In-Reply-To: From: David Marchand Date: Thu, 6 Jun 2019 14:18:19 +0200 Message-ID: To: Ferruh Yigit Cc: Ye Xiaolong , William Tu , dev , Ilya Maximets Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 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" Ferruh, On Wed, Jun 5, 2019 at 5:30 PM Ferruh Yigit wrote: > On 6/1/2019 5:13 PM, Ye Xiaolong wrote: > > 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 > > Applied to dpdk-next-net/master, thanks. > Don't we have similar issues with the current drivers flagged RTE_ETH_DEV_CLOSE_REMOVE ? And we are missing a check on this flag in rte_eth_dev_pci_generic_remove(). -- David Marchand