How to utilize other qDMA DMA engines or channels to boost performance.

cancel
Showing results for 
Search instead for 
Did you mean: 

How to utilize other qDMA DMA engines or channels to boost performance.

425 Views
aabitria
Contributor I

The Linux driver DPAA2 qDMA reference code seems to be just using one (1) hardware frame queue for all of its software channels.  We also followed the same algorithm as that of the driver and the speed in LS1088ARDB is not that impressive.  It seems we are only using 1 DMA engine, but the low level DPAA2 HW reference manual mentions there are 8 engines.  We need to boost our throughput by tapping into those engines or multiple channels or whatever to do parallel/concurrent transfers.  How do we do that, given that we can't directly access qDMA and we do it via SW portals?

Also, it's mentioned that a DPDMAI object has only two priorities.  Are these priorities DMA channels themselves?

Tags (3)
0 Kudos
2 Replies

169 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Alain Abitria,

DPDMAI object provides up to two priorities for processing QDMA requests.

Each DPDMAI transmit queue is mapped to one of two service priorities, allowing further prioritization in hardware between requests from different DPDMAI objects.

Each DPDMAI receive queue is mapped to one of two receive priorities, allowing further prioritization between other interfaces when associating the DPDMAI receive queues to DPIO or DPCON objects.

Please refer to the following in dpaa2_qdma_setup function in driver/dma/dpaa2-qdma/dpaa2-qdma.c

...

uint8_t prio_def = DPDMAI_PRIO_NUM;

...

priv->num_pairs = min(priv->dpdmai_attr.num_of_priorities, prio_def);

...

        for (i = 0; i < priv->num_pairs; i++) {
                err = dpdmai_get_rx_queue(priv->mc_io, 0, ls_dev->mc_handle,
                                i, &priv->rx_queue_attr[i]);
                if (err) {
                        dev_err(dev, "dpdmai_get_rx_queue() failed\n");
                        return err;
                }
                ppriv->rsp_fqid = priv->rx_queue_attr[i].fqid;

                err = dpdmai_get_tx_queue(priv->mc_io, 0, ls_dev->mc_handle,
                                i, &priv->tx_queue_attr[i]);

     ...

For channels allocation, please refer to the following in dpaa2_dpdmai_alloc_channels definition invoked in dpaa2_qdma_probe function.


        dpaa2_qdma->n_chans = NUM_CH;
        err = dpaa2_dpdmai_alloc_channels(dpaa2_qdma);

...

   static int dpaa2_dpdmai_alloc_channels(struct dpaa2_qdma_engine *dpaa2_qdma)
{

...

        INIT_LIST_HEAD(&dpaa2_qdma->dma_dev.channels);
        for (i = 0; i < dpaa2_qdma->n_chans; i++) {
                dpaa2_chan = &dpaa2_qdma->chans[i];
                dpaa2_chan->qdma = dpaa2_qdma;
                dpaa2_chan->vchan.desc_free = dpaa2_qdma_free_desc;
                vchan_init(&dpaa2_chan->vchan, &dpaa2_qdma->dma_dev);

                dpaa2_chan->fd_pool = dma_pool_create("fd_pool",
                                        dev, FD_POOL_SIZE, 32, 0);
                if (!dpaa2_chan->fd_pool)
                        return -1;
                dpaa2_chan->sg_blk_pool = dma_pool_create("sg_blk_pool",
                                        dev, SG_POOL_SIZE, 32, 0);
                if (!dpaa2_chan->sg_blk_pool)
                        return -1;

...


Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

169 Views
aabitria
Contributor I

Hello Yiping Wang,

Thanks for the clarification on the DPDMAI priorities.

On the channels allocation, yes I've seen that.  However, it's more of software channels that the qdma driver is presenting to the Linux kernel.  But during actual processing of DMA requests, all those channels send requests to just one fixed (hard-coded) hardware Frame queue.  Does this use only one DMA engine all the time?  How can we utilize other DMA hardware engine/channels to boost performance?

On the contrary, I looked at the fsl-qdma driver in LS1046A DPAA and it has different hardware Command queues assigned to software channels seen by the linux kernel.

0 Kudos