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 143F2A0547; Wed, 20 Oct 2021 10:27:43 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9F20840687; Wed, 20 Oct 2021 10:27:42 +0200 (CEST) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id 357E740142 for ; Wed, 20 Oct 2021 10:27:40 +0200 (CEST) Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4HZ3X84QzRzbhFr; Wed, 20 Oct 2021 16:23:04 +0800 (CST) Received: from dggpeml500024.china.huawei.com (7.185.36.10) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Wed, 20 Oct 2021 16:27:38 +0800 Received: from [127.0.0.1] (10.67.100.224) by dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Wed, 20 Oct 2021 16:27:37 +0800 To: Kevin Laatz , CC: , , , References: <20210827172048.558704-1-kevin.laatz@intel.com> <20211019141041.1890983-1-kevin.laatz@intel.com> <20211019141041.1890983-10-kevin.laatz@intel.com> From: fengchengwen Message-ID: <1659e8bb-1830-5f98-72e6-4e4922316fbb@huawei.com> Date: Wed, 20 Oct 2021 16:27:37 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20211019141041.1890983-10-kevin.laatz@intel.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.100.224] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpeml500024.china.huawei.com (7.185.36.10) X-CFilter-Loop: Reflected Subject: Re: [dpdk-dev] [PATCH v10 09/16] dma/idxd: add data-path job submission functions 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 2021/10/19 22:10, Kevin Laatz wrote: > Add data path functions for enqueuing and submitting operations to DSA > devices. > > Documentation updates are included for dmadev library and IDXD driver docs > as appropriate. > > Signed-off-by: Bruce Richardson > Signed-off-by: Kevin Laatz > Reviewed-by: Conor Walsh > --- > doc/guides/dmadevs/idxd.rst | 9 +++ > doc/guides/prog_guide/dmadev.rst | 19 +++++ > drivers/dma/idxd/idxd_common.c | 135 +++++++++++++++++++++++++++++++ > drivers/dma/idxd/idxd_internal.h | 5 ++ > drivers/dma/idxd/meson.build | 1 + > 5 files changed, 169 insertions(+) > > diff --git a/doc/guides/dmadevs/idxd.rst b/doc/guides/dmadevs/idxd.rst > index 711890bd9e..d548c4751a 100644 > --- a/doc/guides/dmadevs/idxd.rst > +++ b/doc/guides/dmadevs/idxd.rst > @@ -138,3 +138,12 @@ IDXD configuration requirements: > > Once configured, the device can then be made ready for use by calling the > ``rte_dma_start()`` API. > + > +Performing Data Copies > +~~~~~~~~~~~~~~~~~~~~~~~ > + > +Refer to the :ref:`Enqueue / Dequeue APIs ` section of the dmadev library > +documentation for details on operation enqueue and submission API usage. > + > +It is expected that, for efficiency reasons, a burst of operations will be enqueued to the > +device via multiple enqueue calls between calls to the ``rte_dma_submit()`` function. > diff --git a/doc/guides/prog_guide/dmadev.rst b/doc/guides/prog_guide/dmadev.rst > index 32f7147862..e853ffda3a 100644 > --- a/doc/guides/prog_guide/dmadev.rst > +++ b/doc/guides/prog_guide/dmadev.rst > @@ -67,6 +67,8 @@ can be used to get the device info and supported features. > Silent mode is a special device capability which does not require the > application to invoke dequeue APIs. > > +.. _dmadev_enqueue_dequeue: > + > > Enqueue / Dequeue APIs > ~~~~~~~~~~~~~~~~~~~~~~ > @@ -80,6 +82,23 @@ The ``rte_dma_submit`` API is used to issue doorbell to hardware. > Alternatively the ``RTE_DMA_OP_FLAG_SUBMIT`` flag can be passed to the enqueue > APIs to also issue the doorbell to hardware. > > +The following code demonstrates how to enqueue a burst of copies to the > +device and start the hardware processing of them: > + > +.. code-block:: C > + > + struct rte_mbuf *srcs[DMA_BURST_SZ], *dsts[DMA_BURST_SZ]; > + unsigned int i; > + > + for (i = 0; i < RTE_DIM(srcs); i++) { > + if (rte_dma_copy(dev_id, vchan, rte_pktmbuf_iova(srcs), > + rte_pktmbuf_iova(dsts), COPY_LEN, 0) < 0) { srcs->srcs[i] dsts->dsts[i] could add my reviewed-by after fix it, thanks. > + PRINT_ERR("Error with rte_dma_copy for buffer %u\n", i); > + return -1; > + } > + } > + rte_dma_submit(dev_id, vchan); > + > There are two dequeue APIs ``rte_dma_completed`` and > ``rte_dma_completed_status``, these are used to obtain the results of the > enqueue requests. ``rte_dma_completed`` will return the number of successfully > diff --git a/drivers/dma/idxd/idxd_common.c b/drivers/dma/idxd/idxd_common.c > index b0c79a2e42..a686ad421c 100644 > --- a/drivers/dma/idxd/idxd_common.c > +++ b/drivers/dma/idxd/idxd_common.c > @@ -2,14 +2,145 @@ > * Copyright 2021 Intel Corporation > */ > [snip]