From patchwork Wed Aug 8 07:05:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zhang X-Patchwork-Id: 43628 Return-Path: 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 908D91E35; Wed, 8 Aug 2018 09:05:11 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 491E3100C for ; Wed, 8 Aug 2018 09:05:09 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Aug 2018 00:05:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,456,1526367600"; d="scan'208";a="63456995" Received: from dpdk51.sh.intel.com ([10.67.110.190]) by orsmga008.jf.intel.com with ESMTP; 08 Aug 2018 00:05:00 -0700 From: Qi Zhang 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 Date: Wed, 8 Aug 2018 15:05:45 +0800 Message-Id: <20180808070545.13510-1-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.13.6 Subject: [dpdk-dev] [RFC 0/4] 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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. PMD is responsrible to implement ops->dev_reset in an async way, it can offload the whole task into a separate thread, or maybe just pending on hardware interrupt as reset dependency ready or start a timely alarm to poll register status as a background daemon. PMD is also responsible to raise the RTE_ETH_EVENT_RESET_COMPLETE event to notify the application when reset is complete. 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. Qi Zhang (4): ethdev: claim device reset as async net/i40e: enable async device reset net/ixgbe: enable async device reset testpmd: enable async device reset app/test-pmd/testpmd.c | 55 +++++++++++++++++++++++++++++++++++++++- drivers/net/i40e/i40e_ethdev.c | 28 ++++++++++++++++---- drivers/net/ixgbe/ixgbe_ethdev.c | 26 ++++++++++++++----- lib/librte_ethdev/rte_ethdev.h | 33 ++++++++++++------------ 4 files changed, 114 insertions(+), 28 deletions(-)