From patchwork Mon May 29 13:42:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ga=C3=ABtan_Rivet?= X-Patchwork-Id: 24861 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id DC5097D2D; Mon, 29 May 2017 15:42:55 +0200 (CEST) Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by dpdk.org (Postfix) with ESMTP id A4D237D21 for ; Mon, 29 May 2017 15:42:49 +0200 (CEST) Received: by mail-wm0-f41.google.com with SMTP id d127so60164028wmf.0 for ; Mon, 29 May 2017 06:42:49 -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=gFBXBCDqMW8+oXoPt5k8jvZrPH37wnsD1NiFZeGN4zI=; b=UEa3VHqjk3ELgmLN+YPAxtDtUaM33nrbggtYRYn9Vi26PrPz33kOU3L3UuN0zd5auA Yzaa40tjMceGZ4Jpj36kltp4fy/6jf/8YP+WnPfUQN4W99gEVJjjPzNARYmSzTIRV3qB R/aWwlmbqd5dXvbhA7KJ5Yz/l+1bxqBMZMp156/ksoFNQHljoGiKCTAjiSPl0cMs2TV9 wfIGBRsMocCCOz54uctlAYFxWt0RyX7+xKtAsfXMDOPqDrojsFge/hrKYoOXUCpYI1ql +Dowon9sC0CwS+RQ9URA9slXKrv6oQWpCkSoo385ATBjwpVBWI69OGov0136voCNsxHo xgwQ== 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=gFBXBCDqMW8+oXoPt5k8jvZrPH37wnsD1NiFZeGN4zI=; b=iCgWEDtZ+QgxS8NXVQo25hKHgVlvYft553D3UxBpS9AhtoWyfImZ54jAw/D3GqPhIa 8ve1FyJTW/wuCe5ZL+wonxM1gI3tNtA7gG6fif9dC2I6upC5+yvVnc9V4jNKHJge0WpV f/LOWtDKfSA7b6c7Yp0N+nBWeHxjr8NRwoAdAraBnEXam/WzYZUV1qCnbiuOS5Z41eYE NXGBVNz1dpnAb7cLlmSEhiEsATPqdPVWynzXV44FVmBE7PE/RgQFaCzntDLpsZR19pIR puy4vE5IyZt+zK9YQY4/KE4Z+PJU5Y3j7ISQ/LNBIg7E1sVGzVhn9PuMIjKFPqYvmh0l A9IQ== X-Gm-Message-State: AODbwcDUe8q5M6DUE7bvji/Hc4twEQ7a3CBceU3wtXc30yw+hMKLAAGJ Wotsimu0Qjrv9OOrW4U= X-Received: by 10.28.153.209 with SMTP id b200mr20183240wme.7.1496065368816; Mon, 29 May 2017 06:42:48 -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 l8sm12906671wmd.8.2017.05.29.06.42.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 29 May 2017 06:42:48 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Mon, 29 May 2017 15:42:14 +0200 Message-Id: <687b67347de054714ac6909492c45e16ea2215a8.1496065002.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 v4 02/12] ethdev: add deferred intermediate device state 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" This device state means that the device is managed externally, by whichever party has set this state (PMD or application). Note: this new device state is only an information. The related device structure and operators are still valid and can be used normally. It is however made private by device management helpers within ethdev, making the device invisible to applications. Signed-off-by: Gaetan Rivet --- lib/librte_ether/rte_ethdev.c | 3 ++- lib/librte_ether/rte_ethdev.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index c8c5e73..f592643 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -288,7 +288,8 @@ int rte_eth_dev_is_valid_port(uint8_t port_id) { if (port_id >= RTE_MAX_ETHPORTS || - rte_eth_devices[port_id].state != RTE_ETH_DEV_ATTACHED) + (rte_eth_devices[port_id].state != RTE_ETH_DEV_ATTACHED && + rte_eth_devices[port_id].state != RTE_ETH_DEV_DEFERRED)) return 0; else return 1; diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index 33cc48c..161b0ff 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -1652,6 +1652,7 @@ struct rte_eth_rxtx_callback { enum rte_eth_dev_state { RTE_ETH_DEV_UNUSED = 0, RTE_ETH_DEV_ATTACHED, + RTE_ETH_DEV_DEFERRED, }; /**