From patchwork Fri Jul 7 00:09:22 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: 26601 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 8B5467CEA; Fri, 7 Jul 2017 02:10:38 +0200 (CEST) Received: from mail-wr0-f174.google.com (mail-wr0-f174.google.com [209.85.128.174]) by dpdk.org (Postfix) with ESMTP id EE19E5A98 for ; Fri, 7 Jul 2017 02:10:11 +0200 (CEST) Received: by mail-wr0-f174.google.com with SMTP id c11so24292545wrc.3 for ; Thu, 06 Jul 2017 17:10:11 -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=EVo0is4RV68tzf8UPp8Ii43lAvbHxWUwU/1RMGEhCGvn7Tv3kOj2AXZlJFUs9v+IMd Jp34qQU6sHIqc5ffWuPdpr2/1OxrLacrNV85QwI1YfzbqaDNoVpRENnc+1bKaakI7tuD KROekRwpS78/6+Ds1puXZY+Plgb1aSCqtEaVtIT2izJ/Zwl3Y19i57o9sPW9SMp86lDj m3PLqHjuTzDS2kZGID0ACuGya5uvqQO5g7xyHWQSmqpD3OngmbjyzIjXvHzZY+rmoUDz MMXyI3iMYOmalOJNtG/uOMi33jzGHFOh2zd/+NUGxydKQo15Po1RFrz1YmLfW0Mr/f9D hQ1w== 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=DpEUN6eIHdNvOgMGmonCVZq0rePXX1TbQ5rh9V8FvC638VzvN0J9TLLDOLCImVrZSU Ih6PBV++6cYC3Z/aVDvD1KyZQ5lgb97vdHwDG/LPmzGEF80iEmJuSEUTEyZaRULKhJ+X 7LY1bSE/mUy4wqr1HtnC0tF0cSX/ICt0FkgyFojJ1hHG2GUrS5GwhgW1IvYx5Y/VgF/u P7wDyK3+MIPcXh+8MnJD5O1/kImHSRaE3pRmiATChPQrJ55T4okM0XSrtv2g6UkNsg7i yG9yll3Ezpnzf/qnGTymNK4WQAcMnStiF2w9t7L6dklcX7Zp/s2aXKOd/Zc3psyq/8E+ oy1w== X-Gm-Message-State: AIVw110iD65WOG2kbFUkbv41WAgtayIOduUTf2KAIGcOjvKQL9+3/AHx QKNtLIfYsGLxr4FLLwg= X-Received: by 10.28.113.21 with SMTP id m21mr275218wmc.80.1499386211329; Thu, 06 Jul 2017 17:10:11 -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.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 06 Jul 2017 17:10:10 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Fri, 7 Jul 2017 02:09:22 +0200 Message-Id: <089e5fdb2a0bb54e0e45022b4acd364e54e37aa3.1499384906.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 13/23] 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 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, }; /**