From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) by dpdk.org (Postfix) with ESMTP id EAB35F964 for ; Fri, 3 Mar 2017 16:40:47 +0100 (CET) Received: by mail-wm0-f49.google.com with SMTP id v186so18305651wmd.0 for ; Fri, 03 Mar 2017 07:40:47 -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; bh=CtCxmyHKvahqxSD/0Zz253qbAjahK81qxesHwA2ziA4=; b=IRV6J0RNVq8//8ApOyfrvATTPqNAcBn2/kO0cPiBgaam7kow9/ICj2+M0r06qjejc7 wikwhfq5mRir2SqHtaIbQ7YfgBwUmUIb/hkY4R4GMVIVngHym+YRyO4E0BCPNLpWDbHG y8Y/8/WzzjsHDWeCMSjQJbcNyeLM4+Gg7VQjKYwBK/b/xMRMJD74czaEmMPcFlK1waXt ryptYQJSafrD3RHww6TxCJr75eqSFj6O5vq5/d+NhPJbi9WXUOXFhpS7Y9DWJy3rgx/N GELvnSnsoraA2PCsN+TFv5yFAJ5HynAgh9Dj3pA6jyBx9Wc41sbmzJAmylR3X7Y2mPgW KQpw== 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; bh=CtCxmyHKvahqxSD/0Zz253qbAjahK81qxesHwA2ziA4=; b=S0lNo1MfPhuyi0q17FilRj1OkL2GijsZYXL8Wz9HDXtTph27WN2FfHemgL4jUrYd1R 6AMAxF+ZeJevytzQ1+ICTBuDNMoSG1gbws78ufSmEx2lMg/6VJFI6fWq2i/Ofa6FgTVt TNZMqoV3Dge2zaUoczp7J8kX4TTZv98j1we4TLKYwfg7Qn+7Y8Izg8J8Og81erNeODEr D1RLSIFoAXWwJhJVh1RGcN/Ogn8kCS9BSDClbFU6O9jqcJNfkmByBxlZ76rtLY3U5uro DFfqD9qqRYnpbBXW102ylbPpfjOqhDUPAX24L5qS3PYr5/VJV78aGCyjjfI8KASuLKFn fHJA== X-Gm-Message-State: AMke39kQSrS6F0++vJ9OLk5+z5ln4KMweCmlCHsJaiBUO148FUjyNEzgsP2KRaJzxLa3v0ru X-Received: by 10.28.203.204 with SMTP id b195mr3698635wmg.51.1488555647537; Fri, 03 Mar 2017 07:40:47 -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 63sm3486280wmp.9.2017.03.03.07.40.46 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 03 Mar 2017 07:40:47 -0800 (PST) From: Gaetan Rivet To: dev@dpdk.org Date: Fri, 3 Mar 2017 16:40:25 +0100 Message-Id: <360ef4b7a2f14e26ecc412ea5b964df7367d13d3.1488550982.git.gaetan.rivet@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: Subject: [dpdk-dev] [PATCH 03/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: , X-List-Received-Date: Fri, 03 Mar 2017 15:40:48 -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. --- 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