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 697105A6A for ; Fri, 7 Jul 2017 02:10:09 +0200 (CEST) Received: by mail-wr0-f176.google.com with SMTP id 77so24326761wrb.1 for ; Thu, 06 Jul 2017 17:10:09 -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=ddO8j/NMYzIIyx0I/AxwhboRNSUmR3OyeDK7Lvms55Q=; b=F9cn13qEmIDMpvFM2Em4GNLa7sK9s80sLUxTdufNDZuIVF2Va128aLsfeuSDYnGqOJ nF58r4DRqv/tvKa5tU/nq39fSwDUJLHGRGvzkmw5AvDjswbETMJl1wn9EvADdjlHMgWj BmL2HpW6jFwR/XsAamy0N5rrJxBGLR8tU90wybJXATG3+nIddVHWeeqvjAuSfPATdxY6 8FQIkV3impuPs0Lh+h+boNk0qSNV9HUfsk8C0YJpkecSlZdP2MGSpdI+rQA9iui3M5V1 eW0TUrqtwF/kZps0D28baP868S/8YbcpEmiJO/V/btrN9U+oxu+teI/ip4zn8SHbCdxz eJpg== 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=ddO8j/NMYzIIyx0I/AxwhboRNSUmR3OyeDK7Lvms55Q=; b=hfeg0Cfr7wuydwkTxzwcVcIh34NKyoOi6YPZ5PS1m6D0mIcO+550++ArVqy87SQnJB 4AZmc0wgF+3dDDPGcYM5wuZ+t5wHxJOsEt6us1v6WoPfCoGQBR2g4B28eNCt1eu0QIbG 2Q3pfElPEgUJrpyGglGxw5qm2C0nrNImFs98qsFUoF3N4cDjaQW+3Yx1DdlBFKuxgcc1 3sixb+xfr5nkaLQZXq7ONoX6EsYedCQGCShX+NjKgqlD9lnxBqxLa0p0mOSvIMmXD8oA YD+NVnyJcoWK4oMVzexy9ZKlRNvV+l4FOfcsX2Tk07wXQis+4x4TZR8T+imsQp3Mclsv 5j6w== X-Gm-Message-State: AIVw113ppbmEEuWeX8r7uo3eE+KErp9FBMAt/wLR3RPuGlwXd0uS3gQz GUfOUBReYnQheob1Z7U= X-Received: by 10.28.72.66 with SMTP id v63mr292717wma.129.1499386208900; Thu, 06 Jul 2017 17:10:08 -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 f45sm2391166wrf.2.2017.07.06.17.10.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 06 Jul 2017 17:10:08 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Fri, 7 Jul 2017 02:09:20 +0200 Message-Id: <9d628ca9af5cabde1f9526a236f7eb4230ef643b.1499385282.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 v6 12/22] 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, 07 Jul 2017 00:10:10 -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 38c5ad4..0377b97 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -291,7 +291,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 acbbbb6..4b485f7 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -1589,6 +1589,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