From patchwork Sun Jul 9 01:47: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: 26670 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 8BBF27CCE; Sun, 9 Jul 2017 03:47:50 +0200 (CEST) Received: from mail-wr0-f178.google.com (mail-wr0-f178.google.com [209.85.128.178]) by dpdk.org (Postfix) with ESMTP id E52AB5699 for ; Sun, 9 Jul 2017 03:47:46 +0200 (CEST) Received: by mail-wr0-f178.google.com with SMTP id 77so93700280wrb.1 for ; Sat, 08 Jul 2017 18:47:46 -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=n24IpW1fdBTrGhSQLp5bthyl7rHcoWdouA+oISkpsho=; b=1sj9ndpAp8sx1MoKBWZRk6jgdW20hxR6VH8TolwbPNayylGhs+z1NouhIEZesgKPa3 MbTxn6UwVMl1SsqV26qeUNqt6oxWPHPfJM/r/lUjYdf1vZZrCrOahZGmYMYLZhbJ3X/9 tk9p5jmzzVBNPNJqD7ZrGJSIOQ+6/bO8gq93uWCbsdjj1YXseq2g4T1ExOCA60FNNRZ3 rkBkkptQQQ/Bf+PsMbyYLdsAKHur9acmJKXKkHFQgBQ9ZJnql1zlCwdNH8iWxNhWzfHt XAnYKtHCfp1lYwEuAhTGXI+0hkmk6i7So+unWKdKTF9IFkpPjrkZxmjTmkSvgAlmLK3I zuDg== 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=n24IpW1fdBTrGhSQLp5bthyl7rHcoWdouA+oISkpsho=; b=IzA+REI6GSPrhKzIdX4MyO9w0bUKhqV/AfsKB31hAWywCAahyYh12UO3Ng+SLGu4kf zngRODhbA3Rm0gWK+jyc+WljuAt7bXlLBGQzMZoHScw990B26OZnnSvP6UHeXxqC9fUy vVZOU20Or3BNRZEpIrIRTevhREMeDDY8kMrfo2gN8gS/SrIGcPaFBX4kW0DK/3gXpmOU N92y7YNuSiYObTv9dCWy37MU27M/lhrNVcTo7lkJv5pzW89hVzHL3ZmyDEcvmo9HB0J1 GcBY6gGGxEYJZ27NmfbMF5/KFoweYUM+EoaIW47i3/I5sBfK7DKNbvPmUUBxp2TxfQQh Uz4w== X-Gm-Message-State: AIVw112vLhMVxR9KYfNM1LBLVzemKsml6hHS2rNXO6D4s/54uu/hplKT 07hQ9FtFXxMITn0E+7I= X-Received: by 10.28.113.21 with SMTP id m21mr3479551wmc.80.1499564866138; Sat, 08 Jul 2017 18:47:46 -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 l186sm4278642wma.10.2017.07.08.18.47.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 08 Jul 2017 18:47:45 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Sun, 9 Jul 2017 03:47:22 +0200 Message-Id: <08baa672fdad6db82a6ad53f43e1c64171c7ad47.1499564333.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 v7 01/11] 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 76179fd..69896e9 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 93182b8..d894af6 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, }; /**