From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by dpdk.org (Postfix) with ESMTP id 0C6862BC7 for ; Sat, 15 Jul 2017 19:57:55 +0200 (CEST) Received: by mail-wm0-f41.google.com with SMTP id f67so49042342wmh.1 for ; Sat, 15 Jul 2017 10:57:55 -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=n1wQX/e/4zltsb3EfFuF0au3L1eL1cGS74YtmKEWtI8=; b=XMZeryqbMNk7w17W6JCiavELrx80tciJe5Xmy/tUaAjklFFziR6DQMoHyyUpAAytOl EWNFOH8EClfLGtC57k6rL56Qe09deN0XdGafHOxoUBQcr/C9X7gX/kviEXYv3+pAkZgn /1BMNYEr9P831tR/QSGw+L1cPB39mQUYAKUgERiwq7B0DAobipQ8P3MjrbZeaZtedfRl YACeZoGaEh6DKTbkOPWmtZvYuvLekLBMK6Y2rxQzUlXYwXAtccTew0XgD5KUXVUOk9mI LrUyAyWjnoWwicKEd+fu0RG2VUHRhB6Q+qwU1PPGSRXJ8vcwpwddfQNopoA+WvUuc5Kc mwUw== 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=n1wQX/e/4zltsb3EfFuF0au3L1eL1cGS74YtmKEWtI8=; b=ZNyhNgcvyfIa8HS/kkfx333KrH6blRaH1kEgHO0H2qJTtKutiJ4wKjhj1AOiRYjOEO Z4OCXCT4oWvzsE7VlbYZDMRfsizYgdQLaBiloaDqSV4LRoKqxC3pcQUkW7tAmqthYJFV I6HN6bdNlRyIxbDAvdboXL5IqTAGP3XEcsSB6xXiUxxIPTw6oNDJW8rUDua7Fmn/7cDv kGv8Bp5YzREL5y/kqmYK5iBW6EoayZo1JRyn7CS/zZmWW5wqURVTdsYlJ4NPxGomovT0 ObaSj+Ae6qiWGYW45C8LkQHKDnjGn6KlTMzN3lsd01c6l8tVUiceB+hNLbcIQvK/aPN5 1pBQ== X-Gm-Message-State: AIVw110PgY9X1OEcPDDzWThpb5SbmgXJf33j1LF9vHO3rdtIdnkjh/AW M1/CsN8sh64l1FCNVec= X-Received: by 10.28.97.86 with SMTP id v83mr1592636wmb.74.1500141474376; Sat, 15 Jul 2017 10:57:54 -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 g82sm6342745wmg.8.2017.07.15.10.57.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 15 Jul 2017 10:57:53 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Sat, 15 Jul 2017 19:57:30 +0200 Message-Id: <9051876b6829707c8659b2023a27bce8c9e79dc9.1500130634.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 v10 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: Sat, 15 Jul 2017 17:57:55 -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 a1b7447..81b398d 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 f683727..774408c 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -1613,6 +1613,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