From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f181.google.com (mail-wr0-f181.google.com [209.85.128.181]) by dpdk.org (Postfix) with ESMTP id 8018F7CBE for ; Wed, 26 Jul 2017 15:36:13 +0200 (CEST) Received: by mail-wr0-f181.google.com with SMTP id k71so78210336wrc.2 for ; Wed, 26 Jul 2017 06:36:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=LgBpAQatwC6J3fz6eXhcHu8nL6jiA0KyZGdpQ+NJlJ4=; b=zVRzwB3bNa4op3LYmiBd9eOkopdmV1T0c6lSusHA2Ns08wq9yG6UUbEg0xi+RFLe7R 0kkqDoRS+nti1y5Mxf2ZERFtr5100dSFQ56OXmORoTbhe3xf7umHXThTtnRLXy2g1Y99 RJNkT8GqV59Yt/KyrTB2IL22vdl+z1TxQhGCaU5hX0PaaDbNBArtOvhUp8hgtIeeia3Z J4S1U3BV0Nxa0ALTbNhNJDxlQoPLKI2jIvPO3i9V/BEbfr4n7zmPQu8/258wXqIQgpe7 sXChWEh0oLGKSVdjkLFoTQZtMB7d1SQHAcPWTZHUgs70J+WiTcjUIk/bgvAqb+Wl5AL7 035Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=LgBpAQatwC6J3fz6eXhcHu8nL6jiA0KyZGdpQ+NJlJ4=; b=Nr5e/BZyBB6r5RiEdceKnf6zz3JQMEaJXgaE5FpsDk7UjEqqCPBJn33ypYj2fMwVHy xXsZaXKreHCIhbY5cji8dIyGTlNlhl7uMsMAxj8E9oNkC//fLBzn/PcoGKrMQ9VluTwd uO/4UeevnWcNmJJIhsv4VQtd15daGDPC8ixeY5qjBYLtrMGc15KZZAldiHuPCn05vw8f rmUku7oRUGRzDy460b6eBXHW8YjPZLyaPvqDjutOQpTOCyBYxsXKBj49le8P3h/dMS6i tcQVR/DNkbCdBXDwylxwKOwvYUHE3SFT0+yjITf8duJzQvxmwdGdRd4nUpGZg53vl6G/ EW3g== X-Gm-Message-State: AIVw110KwcN+0ssIbPnCpKRvq+u4C7U7PBJOl1oYrGx4ymp6g5NnXeUd IEtcys0kO4QKIgXWiow= X-Received: by 10.223.130.144 with SMTP id 16mr899546wrc.166.1501076172618; Wed, 26 Jul 2017 06:36:12 -0700 (PDT) Received: from bidouze.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id c13sm3144707wrc.7.2017.07.26.06.36.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 26 Jul 2017 06:36:11 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Wed, 26 Jul 2017 15:35:53 +0200 Message-Id: <9a0cace92c45ef6a3c073d300a8e5de9111b3b00.1501076035.git.gaetan.rivet@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v2 2/6] ethdev: properly check detach capability 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: , X-List-Received-Date: Wed, 26 Jul 2017 13:36:14 -0000 This capability is not bound to which driver is handling the device, but whether the bus is able to unplug it. This check is already performed in rte_eal_dev_detach, there is no need to do it in the ether layer. Signed-off-by: Gaetan Rivet --- lib/librte_ether/rte_ethdev.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 8c365ed..805ef63 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -367,16 +367,6 @@ rte_eth_dev_is_detachable(uint8_t port_id) RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL); - switch (rte_eth_devices[port_id].data->kdrv) { - case RTE_KDRV_IGB_UIO: - case RTE_KDRV_UIO_GENERIC: - case RTE_KDRV_NIC_UIO: - case RTE_KDRV_NONE: - case RTE_KDRV_VFIO: - break; - default: - return -ENOTSUP; - } dev_flags = rte_eth_devices[port_id].data->dev_flags; if ((dev_flags & RTE_ETH_DEV_DETACHABLE) && (!(dev_flags & RTE_ETH_DEV_BONDED_SLAVE))) -- 2.1.4