From: "Ard Biesheuvel" <ard.biesheuvel@linaro.org>
To: "Ooi, Tzy Way" <tzy.way.ooi@intel.com>
Cc: edk2-devel-groups-io <devel@edk2.groups.io>,
"Kinney, Michael D" <michael.d.kinney@intel.com>,
"Loh, Tien Hock" <tien.hock.loh@intel.com>,
"leif.lindholm@linaro.org" <leif.lindholm@linaro.org>
Subject: Re: [edk2-devel] [PATCH v4 edk2-platforms 1/1] Silicon/DesignWare/Driver: DwEmacSnpDxe: Add DesignWare EMAC driver
Date: Fri, 31 May 2019 11:19:53 +0200 [thread overview]
Message-ID: <CAKv+Gu-W0-asrepTTYmhVY1mi4hAqXygTwX2j0WB5byrk7XY=A@mail.gmail.com> (raw)
In-Reply-To: <5F1105621EDF844291AF8B109E27C06D34D05FCC@PGSMSX109.gar.corp.intel.com>
On Fri, 31 May 2019 at 11:14, Ooi, Tzy Way <tzy.way.ooi@intel.com> wrote:
>
> Thanks Biesheuvel.
>
> I would like to confirm with you on regards of one of the comment. There is one comment where you mentioned that:
> "I am aware that TX is usually the hot path in UEFI, but we should still try to map a buffer directly rather than copy the contents into uncached memory"
>
> I would like to confirm with you if do you mean I should do the DmaMap here instead of doing it at the beginning of the code while DmaAllocate is executed?
Yes.
Each time you receive a buffer, you DmaMap() it with the
MapOperationBusMasterRead attribute, and hand it to the device. After
the device is finished, you DmaUnmap() it again. This removes the need
for uncached memory.
On the RX path, you can allocate the buffers via AllocatePages()
rather than via DmaAllocateBuffer(), and map the for DMA using
DmaMap() with the MapOperationBusMasterWrite attribute. Once the
buffer is filled by the hardware, you can DmaUnmap() it and copy the
contents back to the caller, after which you can recycle the buffer or
free it.
> Or do you mean I shouldn’t copy it into a uncached memory region?
>
DmaAllocateBuffer() gives you an uncached region, so you should only
use it for data structures that are accessed and modified by the CPU
and the hardware at the same time, e.g., the descriptor rings. The
actual data buffers only need directional DMA, so using uncached
memory results in an unnecessary performance hit.
> Thank you
> -----Original Message-----
> From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Sent: Wednesday, May 22, 2019 3:22 PM
> To: edk2-devel-groups-io <devel@edk2.groups.io>; Ooi, Tzy Way <tzy.way.ooi@intel.com>
> Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Loh, Tien Hock <tien.hock.loh@intel.com>; leif.lindholm@linaro.org
> Subject: Re: [edk2-devel] [PATCH v4 edk2-platforms 1/1] Silicon/DesignWare/Driver: DwEmacSnpDxe: Add DesignWare EMAC driver
>
> On Wed, 22 May 2019 at 03:37, Ooi, Tzy Way <tzy.way.ooi@intel.com> wrote:
> >
> > Hi Maintainers,
> >
> > Please could you help to review this patch? Thanks.
> >
>
> I already did, but my email response got rejected twice
>
> https://edk2.groups.io/g/devel/message/40829?p=,,,20,0,0,0::Created,,emac,20,2,0,31541649
next prev parent reply other threads:[~2019-05-31 9:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-08 9:52 [PATCH v4 edk2-platforms 1/1] Silicon/DesignWare/Driver: DwEmacSnpDxe: Add DesignWare EMAC driver tzy.way.ooi
2019-05-22 2:37 ` tzy.way.ooi
2019-05-22 7:21 ` [edk2-devel] " Ard Biesheuvel
2019-05-31 9:14 ` Ooi, Tzy Way
2019-05-31 9:19 ` Ard Biesheuvel [this message]
2019-06-19 10:09 ` Ooi, Tzy Way
2019-06-19 10:12 ` Ard Biesheuvel
2019-06-26 9:35 ` Ooi, Tzy Way
2019-06-26 10:00 ` Ard Biesheuvel
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-list 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='CAKv+Gu-W0-asrepTTYmhVY1mi4hAqXygTwX2j0WB5byrk7XY=A@mail.gmail.com' \
--to=devel@edk2.groups.io \
/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