From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f176.google.com (mail-wr0-f176.google.com [209.85.128.176]) by dpdk.org (Postfix) with ESMTP id 6B9EE5589 for ; Wed, 8 Mar 2017 16:16:06 +0100 (CET) Received: by mail-wr0-f176.google.com with SMTP id g10so25537106wrg.2 for ; Wed, 08 Mar 2017 07:16:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references:in-reply-to :references; bh=yAiz/+QoeGO+n/Cmr5fRxClNrwYhatTvgCK5C+J2pDc=; b=Nt3m2KPeuyz2raS9nbUCf7zwkeYSn/hQt9lrqhlR5rNn1KCgG35Nrq06FuYfd5p57w 1MOCfSLKwKcCEMh1ATGJMOLfzlyVjvNfthf1tPgsLQepahurZJXJKg8WUqf/nF5O1zPq zqirrmrNAhMZ/P6taEnL4r5xNAYa7QDQA2Uo2teLhpxq37mg61ICBy3P76ncuySnqwB6 QPTWkRKzzmLm8gYprT7hCRLVvuIo8azzRXvyeRPYc20zeXmouRBAw5iBjYtTYX6Qx4PD 8om49WqEA7AWLLuX5SMhZOwtwpATHKNUmnTpWySLx6eK0RwKQRtU+Bkb7ZbJwd3vGJ8F e8Kw== 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:in-reply-to :references:in-reply-to:references; bh=yAiz/+QoeGO+n/Cmr5fRxClNrwYhatTvgCK5C+J2pDc=; b=CrurWeCHBNo+fG7TMANNYOHZNvVB5pUbqyBHxv/kKgZRWUhUT8+sSWCaehXSG8WJWH rPLvQSicsoUi98pScwRYo/EnN1rBKscMYH91kjXkhWhT6V/hzCJzYFe2aDcRnbmAFZpK LU8/9i9665BIaXrA1YTfiIpDZx24Y/TVhAg27OfWe0jcc6VMmcS+Nannda7JC3ZtP8a+ 37F7/nlfP4kbwt+TWioou2d5e+O5ZsAGqAdMF6bdol7C0M6Y+0A71LNh4anG7mXWsx7W zhAtg8VeV1pACPDm5k9MQ/WK/HTWGwRHoGRmvK4qSn040MVCxxDrXrrnxEXMFWY/xw7d eJKg== X-Gm-Message-State: AMke39lV2uVqbXax64lyOn5cBYjYLz8GNb3+mmUylU6GERiSr15Yk63vfw5nxNfpLYpCnWjz X-Received: by 10.223.164.83 with SMTP id e19mr5811193wra.201.1488986165719; Wed, 08 Mar 2017 07:16:05 -0800 (PST) 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 t103sm4553592wrc.43.2017.03.08.07.16.05 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Mar 2017 07:16:05 -0800 (PST) From: Gaetan Rivet To: dev@dpdk.org Date: Wed, 8 Mar 2017 16:15:36 +0100 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v2 03/13] 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: , X-List-Received-Date: Wed, 08 Mar 2017 15:16:06 -0000 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 61a63b7..7824f87 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -382,7 +382,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 f01d140..ae1e9e6 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -1629,6 +1629,7 @@ struct rte_eth_rxtx_callback { enum rte_eth_dev_state { RTE_ETH_DEV_UNUSED = 0, RTE_ETH_DEV_ATTACHED, + RTE_ETH_DEV_DEFERRED, }; /** -- 2.1.4