From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f170.google.com (mail-wr0-f170.google.com [209.85.128.170]) by dpdk.org (Postfix) with ESMTP id 773287CC0 for ; Tue, 11 Jul 2017 01:20:08 +0200 (CEST) Received: by mail-wr0-f170.google.com with SMTP id k67so158641576wrc.2 for ; Mon, 10 Jul 2017 16:20:08 -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=xZb2/fdkdqIVuYszJj1jlqoA9SFKeOn85+mch0X5dWkpIMeRRI1SMmveROhXNenC4v MqMQBTw4hZ5mwVY/xW3/Z5pHuEIreIS43tfc750oe2Stzy4xBBGrEVUiJznh8YcKMkXw 9dIk/DpropTQto2QjznI//MkqKv//+KjvDb/ymxuwpTm8pjTHHwtDPYxQj0vAunLYQcx Uf1ZUoPbiYMzkuXF6ZL5iDZ5WwEbWPpEFJmbtXoJVF4DAJn9Ymqhrd92RwG0tPUWLWfN yXFJbQgZ7C3qqGaNaQQz8mnpwYjvEGI2fSeQF7qvuFydPx9QQ39rWE0EDC4tZ3P1bhsq xskQ== 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=RagyO74MwAkKDNxflDAbDZiWVjiYiUNph2t+2ktZCtXC6DrC1PrS14QngBxIiemL3F /jO0rZRSroANJF4r+4jTFN8YgkbzqS3WTtDMWIcx2EDYk0M8Bn3BLhz9qpkXR0VTvtRe MBXYsvyQ9HJ+g00qt0ZS5hq3V1EehBPNZULdFUneWn8pgcTCGoVjlK19R1S74tpzYPG1 f03Mu9/un5KekdJfu1s0Ll1RrPhPIJX01Ytp+uLROeYYzVfOhywW8UEA5Rq+TT7l6bK3 ZqH7/YRBaI/uMZUP79Im/NCYc1K9A9lWXAnGGrCTOXfvEaQYCP7HvC2J/4Y38AEoA+6k 0uwg== X-Gm-Message-State: AIVw1112xiaLFlcXSluBztFZOKdDf8jqk4cB02+xkixbObf+ye/YAeeS I+chPbuLdh+DonW98lk= X-Received: by 10.223.183.40 with SMTP id l40mr9394204wre.154.1499728807850; Mon, 10 Jul 2017 16:20:07 -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 k137sm11805038wmd.22.2017.07.10.16.20.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 10 Jul 2017 16:20:06 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Tue, 11 Jul 2017 01:19:42 +0200 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v8 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: , X-List-Received-Date: Mon, 10 Jul 2017 23:20:08 -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 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, }; /** -- 2.1.4