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 49440A0C5C; Wed, 8 Sep 2021 20:18:11 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0DEB040E01; Wed, 8 Sep 2021 20:18:11 +0200 (CEST) Received: from mail-il1-f169.google.com (mail-il1-f169.google.com [209.85.166.169]) by mails.dpdk.org (Postfix) with ESMTP id C77894003E for ; Wed, 8 Sep 2021 20:18:09 +0200 (CEST) Received: by mail-il1-f169.google.com with SMTP id l10so3286148ilh.8 for ; Wed, 08 Sep 2021 11:18:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gOOx5E8N32CzObl+y3Hddd3yryqOHX9T1p/8Dotz2qc=; b=CKu3o9tH/ApX0lgunR6bf0i1L+j5wZfhFhFYRwVB+lmTzrkT+ZyqoCWly2BtLBvZvn 8Z0AdpmFnopYRgnhFP6lcHCApkvyIb0F2xvQJxdEvxpVbchDqmb56SU85JhRfrkQ4qfN DeO2snCl66LY6Et5DphbOjUei/fFqEOwf60psB8sxTNn32IpSKdpOpbg2TH3WVh28ze6 eqkt9Sv94xKOJQLu3TOahBdmzk+h06tC0ZrLdly6I0swLQBomwcBmUaLrp00w+FosTZg 71W8gYPUVj/Y7E90CaXsgydnt3VkV2jd0PvKa4mvXP6iSuw5Z8h3WgLJprw9/sNzPP15 Q+SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gOOx5E8N32CzObl+y3Hddd3yryqOHX9T1p/8Dotz2qc=; b=QOWyE3NUAqjNW9wOHL5xFfVg1u8OZxoH2GClmvramcqAxIiBOsp/1LySlaNqwRZ3ZG qsFZBnc/so6u5p8WIUi4Itl2/SvOdMqUDqOwnQEb79G9ya7Rx50bPpxTDxN24aEbxw4U r29PBimINWgQEjtnoLldKJVWQGZAz+0MBaWuui4HaEa1jY7XrZORFSZWq/eAYOpY189U qlSbhLAk7keN9kIC0ptpojYJEFdYPN5vnUOu7UPMGDrB9MNHxd5gkfTO+MFteEVkRb7Q U7yV92SH1jr0gw/aIde0K8bFvrHHKSbRr+f23uBx4pplntfzOnOd9qnPGzfHOgiBzOa2 /Fvw== X-Gm-Message-State: AOAM533U4SPFUkGEAxrzdNnuGx9Z1hca1qczetKBRpotUx8j22oHQQHV wt/jJrH7sGZEhUPOENolIr0UyOqVpZoaeFpTXIM= X-Google-Smtp-Source: ABdhPJw0QG/4ZDzViMbd93ggVrwvYm4Ffu/MvwMW1Q0twaKZaDIelxJA/DzXV9KTOfZ5n/z5rgp2BNJDP4l0ABETVPk= X-Received: by 2002:a92:6b01:: with SMTP id g1mr875791ilc.251.1631125089190; Wed, 08 Sep 2021 11:18:09 -0700 (PDT) MIME-Version: 1.0 References: <20210826183301.333442-1-bruce.richardson@intel.com> <20210907164925.291904-1-bruce.richardson@intel.com> <20210907164925.291904-3-bruce.richardson@intel.com> In-Reply-To: <20210907164925.291904-3-bruce.richardson@intel.com> From: Jerin Jacob Date: Wed, 8 Sep 2021 23:47:59 +0530 Message-ID: To: Bruce Richardson Cc: dpdk-dev , "Walsh, Conor" , "Laatz, Kevin" , fengchengwen , Jerin Jacob , Satananda Burla , Radha Mohan Chintakuntla Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [dpdk-dev] [PATCH v3 2/8] dmadev: add burst capacity API 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 Tue, 7 Sep 2021, 10:25 pm Bruce Richardson, wrote: > From: Kevin Laatz > > Add a burst capacity check API to the dmadev library. This API is useful to > applications which need to how many descriptors can be enqueued in the > current batch. For example, it could be used to determine whether all > segments of a multi-segment packet can be enqueued in the same batch or not > (to avoid half-offload of the packet). > #Could you share more details on the use case with vhost? # Are they planning to use this in fast path if so it need to move as fast path function pointer? # Assume the use case needs N rte_dma_copy to complete a logical copy at vhost level. Is the any issue in half-offload, meaning when N th one successfully completed then only the logical copy is completed. Right? # There is already nb_desc with which a dma_queue is configured. So if the application does its accounting properly, it knows how many desc it has used up and how many completions it has processed. Would like to understand more details on this API usage. Sorry for the format issue, sending from mobile. > Signed-off-by: Kevin Laatz > --- > lib/dmadev/rte_dmadev.c | 11 +++++++++++ > lib/dmadev/rte_dmadev.h | 19 +++++++++++++++++++ > lib/dmadev/rte_dmadev_core.h | 5 +++++ > lib/dmadev/version.map | 1 + > 4 files changed, 36 insertions(+) > > diff --git a/lib/dmadev/rte_dmadev.c b/lib/dmadev/rte_dmadev.c > index ab45928efb..6494871f05 100644 > --- a/lib/dmadev/rte_dmadev.c > +++ b/lib/dmadev/rte_dmadev.c > @@ -573,6 +573,17 @@ dmadev_dump_capability(FILE *f, uint64_t dev_capa) > fprintf(f, "\n"); > } > > +int > +rte_dmadev_burst_capacity(uint16_t dev_id, uint16_t vchan) > +{ > + const struct rte_dmadev *dev = &rte_dmadevices[dev_id]; > + > + RTE_DMADEV_VALID_DEV_ID_OR_ERR_RET(dev_id, -EINVAL); > + > + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->burst_capacity, -ENOTSUP); > + return (*dev->dev_ops->burst_capacity)(dev, vchan); > +} > + > int > rte_dmadev_dump(uint16_t dev_id, FILE *f) > { > diff --git a/lib/dmadev/rte_dmadev.h b/lib/dmadev/rte_dmadev.h > index 39d73872c8..8b84914810 100644 > --- a/lib/dmadev/rte_dmadev.h > +++ b/lib/dmadev/rte_dmadev.h > @@ -673,6 +673,25 @@ __rte_experimental > int > rte_dmadev_vchan_status(uint16_t dev_id, uint16_t vchan, enum > rte_dmadev_vchan_status *status); > > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change without prior notice. > + * > + * Check remaining capacity in descriptor ring for the current burst. > + * > + * @param dev_id > + * The identifier of the device. > + * @param vchan > + * The identifier of virtual DMA channel. > + * > + * @return > + * - Remaining space in the descriptor ring for the current burst on > success. > + * - -ENOTSUP: if not supported by the device. > + */ > +__rte_experimental > +int > +rte_dmadev_burst_capacity(uint16_t dev_id, uint16_t vchan); > + > /** > * @warning > * @b EXPERIMENTAL: this API may change without prior notice. > diff --git a/lib/dmadev/rte_dmadev_core.h b/lib/dmadev/rte_dmadev_core.h > index 3c9d698044..2756936798 100644 > --- a/lib/dmadev/rte_dmadev_core.h > +++ b/lib/dmadev/rte_dmadev_core.h > @@ -52,6 +52,10 @@ typedef int (*rte_dmadev_stats_get_t)(const struct > rte_dmadev *dev, > typedef int (*rte_dmadev_stats_reset_t)(struct rte_dmadev *dev, uint16_t > vchan); > /**< @internal Used to reset basic statistics. */ > > +typedef uint16_t (*rte_dmadev_burst_capacity_t)(const struct rte_dmadev > *dev, > + uint16_t vchan); > +/** < @internal Used to check the remaining space in descriptor ring. */ > + > typedef int (*rte_dmadev_dump_t)(const struct rte_dmadev *dev, FILE *f); > /**< @internal Used to dump internal information. */ > > @@ -114,6 +118,7 @@ struct rte_dmadev_ops { > rte_dmadev_stats_get_t stats_get; > rte_dmadev_stats_reset_t stats_reset; > > + rte_dmadev_burst_capacity_t burst_capacity; > rte_dmadev_vchan_status_t vchan_status; > > rte_dmadev_dump_t dev_dump; > diff --git a/lib/dmadev/version.map b/lib/dmadev/version.map > index 10eeb0f7a3..56cb279e8f 100644 > --- a/lib/dmadev/version.map > +++ b/lib/dmadev/version.map > @@ -1,6 +1,7 @@ > EXPERIMENTAL { > global: > > + rte_dmadev_burst_capacity; > rte_dmadev_close; > rte_dmadev_completed; > rte_dmadev_completed_status; > -- > 2.30.2 > >