From patchwork Wed Oct 14 14:42:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Britstein X-Patchwork-Id: 1382184 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CBFWr1H7Sz9sVJ for ; Thu, 15 Oct 2020 01:43:04 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 78AFC2E51D; Wed, 14 Oct 2020 14:43:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 95tzQu0iIVrd; Wed, 14 Oct 2020 14:42:58 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id A870C2E0F5; Wed, 14 Oct 2020 14:42:58 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 8554CC0052; Wed, 14 Oct 2020 14:42:58 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id EED3EC0051 for ; Wed, 14 Oct 2020 14:42:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id D6AC18808B for ; Wed, 14 Oct 2020 14:42:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HkslR2lE-T-H for ; Wed, 14 Oct 2020 14:42:56 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by whitealder.osuosl.org (Postfix) with ESMTP id 10D8688089 for ; Wed, 14 Oct 2020 14:42:55 +0000 (UTC) Received: from Internal Mail-Server by MTLPINE1 (envelope-from elibr@nvidia.com) with SMTP; 14 Oct 2020 17:42:49 +0300 Received: from nvidia.com (dev-r-vrt-214.mtr.labs.mlnx [10.212.214.1]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 09EEgn3E015392; Wed, 14 Oct 2020 17:42:49 +0300 From: Eli Britstein To: dev@openvswitch.org, Ian Stokes Date: Wed, 14 Oct 2020 14:42:47 +0000 Message-Id: <20201014144247.30929-3-elibr@nvidia.com> X-Mailer: git-send-email 2.28.0.546.g385c171 In-Reply-To: <20201014144247.30929-1-elibr@nvidia.com> References: <20201014144247.30929-1-elibr@nvidia.com> MIME-Version: 1.0 Cc: Eli Britstein , Gaetan Rivet , Ilya Maximets Subject: [ovs-dev] [PATCH dpdk-latest V4 2/2] netdev-dpdk: Remove usage of RTE_ETH_DEV_CLOSE_REMOVE flag X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Following DPDK commit [1], RTE_ETH_DEV_CLOSE_REMOVE flag is obsolete. Behavior is equivalent to "always on". Remove the usage of that flag. [1] 638d40ba9622 ("ethdev: remove old close behaviour") Signed-off-by: Eli Britstein Reviewed-by: Andrew Rybchenko --- lib/netdev-dpdk.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index c048aaa75..76eec449a 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -1447,7 +1447,6 @@ netdev_dpdk_destruct(struct netdev *netdev) struct netdev_dpdk *dev = netdev_dpdk_cast(netdev); struct rte_device *rte_dev; struct rte_eth_dev *eth_dev; - bool remove_on_close; ovs_mutex_lock(&dpdk_mutex); @@ -1459,20 +1458,15 @@ netdev_dpdk_destruct(struct netdev *netdev) * FIXME: avoid direct access to DPDK internal array rte_eth_devices. */ eth_dev = &rte_eth_devices[dev->port_id]; - remove_on_close = - eth_dev->data && - (eth_dev->data->dev_flags & RTE_ETH_DEV_CLOSE_REMOVE); rte_dev = eth_dev->device; /* Remove the eth device. */ rte_eth_dev_close(dev->port_id); - /* Remove this rte device and all its eth devices if flag - * RTE_ETH_DEV_CLOSE_REMOVE is not supported (which means representors - * are not supported), or if all the eth devices belonging to the rte - * device are closed. + /* Remove this rte device and all its eth devices if all the eth + * devices belonging to the rte device are closed. */ - if (!remove_on_close || !netdev_dpdk_get_num_ports(rte_dev)) { + if (!netdev_dpdk_get_num_ports(rte_dev)) { int ret = rte_dev_remove(rte_dev); if (ret < 0) {