[RFC,v2,0/2] ethdev: claim device reset as async
Message ID | 20180910134633.6087-1-qi.z.zhang@intel.com (mailing list archive) |
---|---|
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A61AC4C94; Mon, 10 Sep 2018 15:45:44 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id F132C11A4 for <dev@dpdk.org>; Mon, 10 Sep 2018 15:45:42 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Sep 2018 06:45:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,355,1531810800"; d="scan'208";a="231644332" Received: from dpdk51.sh.intel.com ([10.67.110.190]) by orsmga004.jf.intel.com with ESMTP; 10 Sep 2018 06:45:36 -0700 From: Qi Zhang <qi.z.zhang@intel.com> To: thomas@monjalon.net, konstantin.ananyev@intel.com, declan.doherty@intel.com, ferruh.yigit@intel.com Cc: dev@dpdk.org, benjamin.h.shelton@intel.com, narender.vangati@intel.com, beilei.xing@intel.com, wenzhuo.lu@intel.com, Qi Zhang <qi.z.zhang@intel.com> Date: Mon, 10 Sep 2018 21:46:33 +0800 Message-Id: <20180910134633.6087-1-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.13.6 Subject: [dpdk-dev] [RFC v2 0/2] ethdev: claim device reset as async X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Message
Qi Zhang
Sept. 10, 2018, 1:46 p.m. UTC
Device reset may have the dependency, for example, a VF reset expects PF ready, or a NIC function as a part of a SOC need to wait for other parts of the system be ready, these are time-consuming tasks and will block current thread. So we claimed rte_eth_dev_reset as an async API, that makes things easy for an application that what to reset the device from the interrupt thread since typically a RTE_ETH_EVENT_INTR_RESET handler is invoked in interrupt thread. rte_eth_dev_reset will spawn a new thread to call ops->dev_reset, once it is finished, it will raise the RTE_ETH_EVENT_RESET_COMPLETE event to notify the application. Application should not assume device reset is finished after rte_eth_dev_reset return, it should always wait for a RTE_ETH_EVENT_RESET_COMPLETE event and check the reset result. v2: - rte_eth_dev_reset will spawn a thread. Qi Zhang (2): ethdev: claim device reset as async testpmd: enable async device reset app/test-pmd/testpmd.c | 50 +++++++++++++++++++++++++++++++++++++++++- lib/librte_ethdev/rte_ethdev.c | 48 ++++++++++++++++++++++++++++++++++++++-- lib/librte_ethdev/rte_ethdev.h | 48 ++++++++++++++++++++++++---------------- 3 files changed, 124 insertions(+), 22 deletions(-)