On Sat, Sep 18, 2021 at 6:36 AM Hu, Jiayu <jiayu...@intel.com> wrote:
>
> Hi Jerin,
>
> > -----Original Message-----
> > From: Jerin Jacob <jerinjac...@gmail.com>
> > Sent: Friday, September 17, 2021 9:55 PM
> > To: Richardson, Bruce <bruce.richard...@intel.com>
> > Cc: dpdk-dev <dev@dpdk.org>; Walsh, Conor <conor.wa...@intel.com>;
> > Laatz, Kevin <kevin.la...@intel.com>; fengchengwen
> > <fengcheng...@huawei.com>; Jerin Jacob <jer...@marvell.com>;
> > Satananda Burla <sbu...@marvell.com>; Radha Mohan Chintakuntla
> > <rad...@marvell.com>; Hu, Jiayu <jiayu...@intel.com>; Pai G, Sunil
> > <sunil.pa...@intel.com>
> > Subject: Re: [dpdk-dev] [PATCH v3 2/8] dmadev: add burst capacity API
> >
> > On Thu, Sep 9, 2021 at 1:46 PM Bruce Richardson
> > <bruce.richard...@intel.com> wrote:
> > >
> > > On Wed, Sep 08, 2021 at 11:47:59PM +0530, Jerin Jacob wrote:
> > > >    On Tue, 7 Sep 2021, 10:25 pm Bruce Richardson,
> > > >    <[1]bruce.richard...@intel.com> wrote:
> > > >
> > > >      From: Kevin Laatz <[2]kevin.la...@intel.com>
> > > >      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?
> > >
> > > I believe the intent is to use it on fastpath, but I would assume only
> > > once per burst, so the penalty for non-fastpath may be acceptable. As
> > > you point out - for an app that really doesn't want to have to pay
> > > that penalty, tracking ring use itself is possible.
> > >
> > > The desire for fast-path use is also why I suggested having the space
> > > as an optional return parameter from the submit API call. It could
> > > logically also be a return value from the "completed" call, which
> > > might actually make more sense.
> > >
> > > >    # 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?
> > >
> > > Yes, as I understand it, the issue is for multi-segment packets, where
> > > we only want to enqueue the first segment if we know we will success
> > > with the final one too.
> >
> > Sorry for the delay in reply.
> >
> > If so, why do we need this API. We can mark a logical transaction completed
> > IFF final segment is succeeded. Since this fastpath API, I would like to 
> > really
> > understand the real use case for it, so if required then we need to 
> > implement
> > in an optimized way.
> > Otherwise driver does not need to implement this to have generic solution
> > for all the drivers.


Hi Jiayu, Sunil,

> The fact is  that it's very hard for apps to calculate the available space of 
> a DMA ring.

Yes, I agree.

My question is more why to calculate the space per burst and introduce
yet another fastpath API.
For example, the application needs to copy 8 segments to complete a
logical copy in the application perspective.
In case, when 8th copy is completed then only the application marks
the logical copy completed.
i.e why to check per burst, 8 segments are available or not? Even it
is available, there may be multiple
reasons why any of the segment copies can fail. So the application
needs to track all the jobs completed
or not anyway. Am I missing something in terms of vhost or OVS usage?


> For DSA, the available space is decided by three factors: the number of 
> available slots
> in SW ring, the max batching size of a batch descriptor, and if there are 
> available batch
> descriptors. The first one is configured by SW, and apps can calculate it. 
> But the second
> depends on DSA HW, and the third one is hided in DSA driver which is not 
> visible to apps.
> Considering the complexity of different DMA HW, I think the best way is to 
> hide all details
> inside DMA dev and provide this check capacity API for apps.
>
> Thanks,
> Jiayu
>
> >
> > >
> > > >    # 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.
> > >
> > > Agreed. It's just more work for the app, and for simplicity and
> > > completeness I think we should add this API. Because there are other
> > > options I think it should be available, but not as a fast-path fn
> > > (though again, the difference is likely very small for something not
> > > called for every enqueue).
> > >
> > > >    Would like to understand more details on this API usage.
> > > >
> > > Adding Sunil and Jiayu on CC who are looking at this area from the OVS
> > > and vhost sides.
> >
> > See above.
> >
> > Sunil. Jiayu, Could you share the details on the usage and why it is needed.
> >
> >
> > >
> > > /Bruce

Reply via email to