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 4C717A0C56; Wed, 8 Sep 2021 12:41:08 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 51DB6411DC; Wed, 8 Sep 2021 12:40:28 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 346CC411AD for ; Wed, 8 Sep 2021 12:40:24 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10100"; a="217284636" X-IronPort-AV: E=Sophos;i="5.85,277,1624345200"; d="scan'208";a="217284636" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Sep 2021 03:40:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,277,1624345200"; d="scan'208";a="524780097" Received: from silpixa00401160.ir.intel.com ([10.55.128.248]) by fmsmga004.fm.intel.com with ESMTP; 08 Sep 2021 03:40:22 -0700 From: Conor Walsh To: bruce.richardson@intel.com, fengchengwen@huawei.com, jerinj@marvell.com, kevin.laatz@intel.com Cc: dev@dpdk.org, Conor Walsh Date: Wed, 8 Sep 2021 10:40:03 +0000 Message-Id: <20210908104004.3218016-11-conor.walsh@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210908104004.3218016-1-conor.walsh@intel.com> References: <20210903111734.2734545-1-conor.walsh@intel.com> <20210908104004.3218016-1-conor.walsh@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 10/11] dma/ioat: add burst capacity function 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" Adds the ability to find the remaining space in the IOAT ring. Signed-off-by: Conor Walsh Signed-off-by: Kevin Laatz --- drivers/dma/ioat/ioat_dmadev.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/dma/ioat/ioat_dmadev.c b/drivers/dma/ioat/ioat_dmadev.c index 1b1381675f..578b12c8a3 100644 --- a/drivers/dma/ioat/ioat_dmadev.c +++ b/drivers/dma/ioat/ioat_dmadev.c @@ -493,6 +493,19 @@ ioat_completed_status(struct rte_dmadev *dev, uint16_t qid __rte_unused, return count; } +/* Get the remaining capacity of the ring. */ +static uint16_t +ioat_burst_capacity(const struct rte_dmadev *dev, uint16_t vchan __rte_unused) +{ + struct ioat_dmadev *ioat = dev->data->dev_private; + unsigned short size = ioat->qcfg.nb_desc - 1; + unsigned short read = ioat->next_read; + unsigned short write = ioat->next_write; + unsigned short space = size - (write - read); + + return space; +} + /* Retrieve the generic stats of a DMA device. */ static int ioat_stats_get(const struct rte_dmadev *dev, uint16_t vchan __rte_unused, @@ -544,6 +557,7 @@ static int ioat_dmadev_create(const char *name, struct rte_pci_device *dev) { static const struct rte_dmadev_ops ioat_dmadev_ops = { + .burst_capacity = ioat_burst_capacity, .dev_close = ioat_dev_close, .dev_configure = ioat_dev_configure, .dev_dump = ioat_dev_dump, -- 2.25.1