From patchwork Tue Jul 11 23:26:21 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: 26839 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 25B1F7CB5; Wed, 12 Jul 2017 01:26:51 +0200 (CEST) Received: from mail-wr0-f177.google.com (mail-wr0-f177.google.com [209.85.128.177]) by dpdk.org (Postfix) with ESMTP id 1ACBA2E8B for ; Wed, 12 Jul 2017 01:26:47 +0200 (CEST) Received: by mail-wr0-f177.google.com with SMTP id r103so9942720wrb.0 for ; Tue, 11 Jul 2017 16:26:47 -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=n4cLvI+x+ms5MxVdJY6rENFTvnaj6ird39kZKzY06cg=; b=FuHwC4KCV+AN1SFgVsDwf2IXKTvu4ActtAw+YxB2ys/hymOvh2KMPLKqI1n6aqIQ5s 8SoKYTyIaw9h/PEgzVbHmg4XN3nKtO31d+PZjIB5mQKdF1G3+OJDl6PmyQgk+rTRzwZi KYXXV4eQ4m2aE97wYUnMAkLXXoeaNXxwY/XpowMOnTCvT2yDpe6PJygfKfngrYI/d/OZ ZJLhZmEepGdBWOKKaaHsNgYlaxR6ogb+idAHKacGi2zns2Eafx4+Wf353o63kKnRx2+T 4u7ksUx875HQZUzRf4ohv+7jMqcdbNjSDKrzAlACV5yK8w6HftMn2AhBWiZNWaDuXi+D FpPw== 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=n4cLvI+x+ms5MxVdJY6rENFTvnaj6ird39kZKzY06cg=; b=pQvw76CsnAsol1iMLBklMteEgnElalP5DxM4cCQuyGlU5bRWPVdS3Wv5rVu6OMfpLL p0KVJdsJl+0Xi3ymFcDwQEqdNb/X56CBq2LPnWQf59mf7FdIMJukbnMR7QRphvfpNJa1 tOl9xAOdzk4iZBpupdisfi8tPK+4jE7cLFwRBvXt8LUrbT6elXrWGRQBbl0hHHzxeFJT BLVbjeyHxJwIGkdQOVXvAqj5lGNHMyIHi09wLe+EB6mLEIgsdD0wKJrS+i0m0xnDxzur +HgeLgg/TRUPXCVrYL3LvZYax2LUVeVutNAGy0SdAVpkNnfdBko7iD4KlhAQe1fa7gnY FlOA== X-Gm-Message-State: AIVw113N7TuGTnGTp1LMfsZfEGYrD6BEuPP741J1bs4WL8tgLPMbfLiY cZw5opzqNc6boob+rQQ= X-Received: by 10.28.66.153 with SMTP id k25mr405652wmi.129.1499815606528; Tue, 11 Jul 2017 16:26: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 w30sm740855wrb.49.2017.07.11.16.26.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 11 Jul 2017 16:26:45 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Wed, 12 Jul 2017 01:26:21 +0200 Message-Id: <2b6f105070f61435bf542ec4e7b4856299d3164c.1499815140.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 v9 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 fd6baf3..2adef76 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -1607,6 +1607,7 @@ struct rte_eth_rxtx_callback { enum rte_eth_dev_state { RTE_ETH_DEV_UNUSED = 0, RTE_ETH_DEV_ATTACHED, + RTE_ETH_DEV_DEFERRED, }; /**