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 6D4FCA045E for ; Fri, 31 May 2019 18:53:36 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 274BA1B965; Fri, 31 May 2019 18:53:35 +0200 (CEST) Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by dpdk.org (Postfix) with ESMTP id 310EF1B951 for ; Fri, 31 May 2019 18:53:34 +0200 (CEST) Received: by mail-pf1-f196.google.com with SMTP id a186so5850170pfa.5 for ; Fri, 31 May 2019 09:53:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=zcSUWYiOCetw2gN6Xgg3YoGujJj1529EM2v+keVxX0o=; b=elVVJkdIKJQWi+gQ7h2F2MqFdsGDqSgz6fchToc873BoRcf+nqtTx/Xcjyq7XL/jGC vgwJ5PIEAlIz1gb3y6SGzFIeK1ECSToKZ0Pd/i7kvjG0w9Vt0myo8nWUfgJTFJCN9HLu HeTUHXuSqWtVHFaJmnVie7OCQTwUHLQ9shGZs30euw9ri0sBdOGyw4Th2ur9YMuviZDI Kd0ooDgr2gahW6UNBRocuigU8QATi5D9Z3F5a4ZLyNYm92UAfWJrsSldkPI2fzTnIscI H5OQ16jjVGuRgp8Zz0S9Mf9U82o7xAaEcKOTLfXcJn46Ru2fVvUvtLmbGrvsCcUuDkg4 WQSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=zcSUWYiOCetw2gN6Xgg3YoGujJj1529EM2v+keVxX0o=; b=H500t7vFY6CXX91+cQm6KDsjBihbtijcN6aNlnlaqYwoD4/y4EIdk/tFKoE/QppOmt mr2hMj4UzdCXxLzK+oRTIkv9A6jJI5npH4Q8++JIhk7np2fiVACaAvb71A8MXDn9a1c7 SgSqtZnFxD/yMWp2wcAufPFuMP3fpkniRpd4d7Yveh9lmLvOPTouBtO5Iz9BNZV/CT/T yKcuZhfucZkZt8WyFYD8Y+vJO6eUkCBqSMXmgSmFYZbRALDgWVGyPmIqa0TkGVVt4oSA 2k3CikuE06ASEvDE+4CrVJy8LSibvqdOEOon7X+QkEmEQucEUvkIUEwA7t4bUPXrlDwk DSgQ== X-Gm-Message-State: APjAAAXdB2ImJUtuHjx8CEjvphz3e05CVFfYQ9x72VZbdDrD4OioyAD/ rR1OgzSyqQpJJsb25SbKbqtOV9Cn X-Google-Smtp-Source: APXvYqxPYfNJeeJKtOJqdWWJtn7hjplKSWIPiec7RXMMqKGzI4cBrqB55q8RrQQTAMrksj+XUhn5XA== X-Received: by 2002:a65:6096:: with SMTP id t22mr3250999pgu.71.1559321613024; Fri, 31 May 2019 09:53:33 -0700 (PDT) Received: from sc9-mailhost3.vmware.com ([66.170.99.2]) by smtp.gmail.com with ESMTPSA id f11sm7363290pfd.27.2019.05.31.09.53.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 31 May 2019 09:53:32 -0700 (PDT) From: William Tu To: dev@dpdk.org, i.maximets@samsung.com Date: Fri, 31 May 2019 09:52:42 -0700 Message-Id: <1559321562-39928-1-git-send-email-u9012063@gmail.com> X-Mailer: git-send-email 2.7.4 Subject: [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" 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); -- 2.7.4