From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 40AA9A0C45; Wed, 22 Sep 2021 10:32:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 06E9841196; Wed, 22 Sep 2021 10:32:07 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 7129B4069E for ; Wed, 22 Sep 2021 10:32:05 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10114"; a="203702402" X-IronPort-AV: E=Sophos;i="5.85,313,1624345200"; d="scan'208";a="203702402" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2021 01:32:03 -0700 X-IronPort-AV: E=Sophos;i="5.85,313,1624345200"; d="scan'208";a="613313802" Received: from bricha3-mobl.ger.corp.intel.com ([10.252.8.128]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 22 Sep 2021 01:32:02 -0700 Date: Wed, 22 Sep 2021 09:31:58 +0100 From: Bruce Richardson To: fengchengwen Cc: dev@dpdk.org, conor.walsh@intel.com, kevin.laatz@intel.com, jerinj@marvell.com Message-ID: References: <20210826183301.333442-1-bruce.richardson@intel.com> <20210917135429.90562-1-bruce.richardson@intel.com> <20210917135429.90562-2-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [dpdk-dev] [PATCH v5 1/9] dmadev: add channel status check for testing use X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" On Wed, Sep 22, 2021 at 04:25:15PM +0800, fengchengwen wrote: > On 2021/9/17 21:54, Bruce Richardson wrote: > > Add in a function to check if a device or vchan has completed all jobs > > assigned to it, without gathering in the results. This is primarily for > > use in testing, to allow the hardware to be in a known-state prior to > > gathering completions. > > > > Signed-off-by: Bruce Richardson > > Reviewed-by: Conor Walsh > > Reviewed-by: Kevin Laatz > > --- > > lib/dmadev/rte_dmadev.c | 15 +++++++++++++++ > > lib/dmadev/rte_dmadev.h | 33 +++++++++++++++++++++++++++++++++ > > lib/dmadev/rte_dmadev_core.h | 6 ++++++ > > lib/dmadev/version.map | 1 + > > 4 files changed, 55 insertions(+) > > > > diff --git a/lib/dmadev/rte_dmadev.c b/lib/dmadev/rte_dmadev.c > > index 544937acf8..859958fff8 100644 > > --- a/lib/dmadev/rte_dmadev.c > > +++ b/lib/dmadev/rte_dmadev.c > > @@ -716,3 +716,18 @@ rte_dma_dump(int16_t dev_id, FILE *f) > > > > return 0; > > } > > + > > +int > > +rte_dma_vchan_status(uint16_t dev_id, uint16_t vchan, enum rte_dma_vchan_status *status) > > uint16_t dev_id -> int16_t > > > +{ > > + struct rte_dma_dev *dev = &rte_dma_devices[dev_id]; > > + > > + RTE_DMA_VALID_DEV_ID_OR_ERR_RET(dev_id, -EINVAL); > > + if (vchan >= dev->data->dev_conf.nb_vchans) { > > + RTE_DMA_LOG(ERR, "Device %u vchan %u out of range\n", dev_id, vchan); > > + return -EINVAL; > > + } > > + > > + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->vchan_status, -ENOTSUP); > > + return (*dev->dev_ops->vchan_status)(dev, vchan, status); > > +} > > diff --git a/lib/dmadev/rte_dmadev.h b/lib/dmadev/rte_dmadev.h > > index be54f2cb9d..86c4a38f83 100644 > > --- a/lib/dmadev/rte_dmadev.h > > +++ b/lib/dmadev/rte_dmadev.h > > @@ -660,6 +660,39 @@ int rte_dma_stats_get(int16_t dev_id, uint16_t vchan, > > __rte_experimental > > int rte_dma_stats_reset(int16_t dev_id, uint16_t vchan); > > > > +/** > > + * device vchannel status > > + * > > + * Enum with the options for the channel status, either idle, active or halted due to error > > please add @see > Will do in next revision. Thanks for feedback. /Bruce