mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lizhi Hou <lizhi.hou@amd.com>
To: Vinod Koul <vkoul@kernel.org>
Cc: <dmaengine@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Nishad Saraf <nishads@amd.com>, <nishad.saraf@amd.com>,
	<sonal.santan@amd.com>, <max.zhen@amd.com>
Subject: Re: [PATCH V10 1/1] dmaengine: amd: qdma: Add AMD QDMA driver
Date: Thu, 18 Apr 2024 10:35:44 -0700	[thread overview]
Message-ID: <5e2e2539-38e0-1d3c-62c2-da986da1c68f@amd.com> (raw)
In-Reply-To: <ZiFTheOik-2jsfXP@matsya>


On 4/18/24 10:08, Vinod Koul wrote:
> On 17-04-24, 10:53, Lizhi Hou wrote:
>> On 4/17/24 10:03, Vinod Koul wrote:
>>> On 08-04-24, 11:06, Lizhi Hou wrote:
>>>
>>>>>> +static void *qdma_get_metadata_ptr(struct dma_async_tx_descriptor *tx,
>>>>>> +				   size_t *payload_len, size_t *max_len)
>>>>>> +{
>>>>>> +	struct qdma_mm_vdesc *vdesc;
>>>>>> +
>>>>>> +	vdesc = container_of(tx, typeof(*vdesc), vdesc.tx);
>>>>>> +	if (payload_len)
>>>>>> +		*payload_len = sizeof(vdesc->dev_addr);
>>>>>> +	if (max_len)
>>>>>> +		*max_len = sizeof(vdesc->dev_addr);
>>>>>> +
>>>>>> +	return &vdesc->dev_addr;
>>>>> Can you describe what metadata is being used here for?
>>>> The metadata is the device address the dma request will transfer
>>>>
>>>> data to / from.  Please see the example usage here:
>>>>
>>>> https://github.com/houlz0507/XRT-1/blob/qdma_v1_usage/src/runtime_src/core/pcie/driver/linux/xocl/subdev/qdma.c#L311
>>>>
>>>> Before dmaengine_submit(), it specifies the device address.
>>> Hmmm, why is the vaddr passed like this, why not use slave_config for
>>> this
>>>
>> This is because the hardware is capable to process multiple vdesc at one
>> kick off.
>>
>> For example, there are two pending vdesc: vd1 and vd2. If there is enough
>> free
>>
>> space in hardware queue, the vd1 and vd2 can be put in queue, and do one
>> kick off
>>
>> to transfer both vd1 and vd2.
>>
>> The destination device address of vd1 and vd2 could be any valid device
>> address.
>>
>> desc_metadata_ptr seems helpful for the per vdesc destination device
>> address.
>>
>>
>> If using slave_config, it needs to call dmaengine_slave_config() and
> That would be the right thing to do...
>
> - set parameters and call dmaengine_slave_config()
> - prep transfer for vd1 dmaengine_prep_slave_sg()
> - set parameters and call dmaengine_slave_config()
> - prep transfer for vd2 dmaengine_prep_slave_sg()
> - submit vd1
> - submit vd2
> - issue_pending
>          - you see you can issue both as you have space, so do that
>
> This should be done always to maximize the dmaengine thoroughput

Thanks for your comments. I will change this.


Lizhi

>
>> dmaengine_prep_slave_sg() with a lock protection. Is this what you would
>> recommend?
>>
>>
>> Thanks,
>>
>> Lizhi

      reply	other threads:[~2024-04-18 17:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-05 21:49 [PATCH V10 0/1] " Lizhi Hou
2024-03-05 21:49 ` [PATCH V10 1/1] dmaengine: amd: qdma: Add " Lizhi Hou
2024-04-07 13:21   ` Vinod Koul
2024-04-08 18:06     ` Lizhi Hou
2024-04-17 17:03       ` Vinod Koul
2024-04-17 17:53         ` Lizhi Hou
2024-04-18 17:08           ` Vinod Koul
2024-04-18 17:35             ` Lizhi Hou [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5e2e2539-38e0-1d3c-62c2-da986da1c68f@amd.com \
    --to=lizhi.hou@amd.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=max.zhen@amd.com \
    --cc=nishad.saraf@amd.com \
    --cc=nishads@amd.com \
    --cc=sonal.santan@amd.com \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®