From: "Michael Brown" <mcb30@ipxe.org>
To: devel@edk2.groups.io, tinhnguyen@os.amperecomputing.com,
richardho@ami.com
Subject: Re: [edk2-devel] [PATCH v2 1/3] UsbNetworkPkg/UsbRndis: Add USB RNDIS devices support
Date: Tue, 7 Feb 2023 08:20:08 +0000 [thread overview]
Message-ID: <010201862af5f9a8-3ff78c40-4bcb-4fdf-83dd-e8888694d1a5-000000@eu-west-1.amazonses.com> (raw)
In-Reply-To: <7e1d26ff-33a1-6090-6fe0-38fcb88dddaa@amperemail.onmicrosoft.com>
On 07/02/2023 06:21, Tinh Nguyen via groups.io wrote:
> From: Tinh Nguyen <tinhn@os.amperecomputing.com>
> Date: Tue, 7 Feb 2023 12:43:17 +0700
> Subject: [PATCH] UsbNetworkPkg: Support rate limitting
>
> Signed-off-by: Tinh Nguyen <tinhn@os.amperecomputing.com>
Thank you for extending my patch to add the PCD support. The overall
patch appears still to be substantially my code: could you please credit
it as such?
> + if (Nic->RateLimitCredit < PcdGet32 (RateLimitingResumeTime)) {
> + Nic->RateLimitCredit++;
> + }
Is PcdGet32() guaranteed to be a compile-time constant? If not, then
it's probably a good idea to read it once upon initialisation, rather
than once per timer interrupt handler invocation.
> + if ((Nic->RateLimitCredit == 0) && (PcdGetBool (EnableRateLimiting))) {
> + return PXE_STATCODE_NO_DATA;
> + }
Again: unless PcdGetBool() is guaranteed to be a compile-time constant,
then it's probably best to avoid reading it on every call to Receive().
(Sorry, I've never been clear on how the PCD mechanism works, so I'm not
sure whether or not there is any runtime overhead from reading them.)
Thanks,
Michael
next prev parent reply other threads:[~2023-02-07 8:20 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-04 8:54 [PATCH v2 1/3] UsbNetworkPkg/UsbRndis: Add USB RNDIS devices support RichardHo [何明忠]
2023-02-04 8:54 ` [PATCH v2 2/3] UsbNetworkPkg/UsbCdcEcm: Add USB Cdc ECM " RichardHo [何明忠]
2023-02-04 8:54 ` [PATCH v2 3/3] UsbNetworkPkg/UsbCdcNcm: Add USB Cdc NCM " RichardHo [何明忠]
2023-02-07 6:21 ` [edk2-devel] [PATCH v2 1/3] UsbNetworkPkg/UsbRndis: Add USB RNDIS " Tinh Nguyen
2023-02-07 8:20 ` Michael Brown [this message]
2023-02-08 2:46 ` Tinh Nguyen
2023-02-09 3:04 ` RichardHo [何明忠]
2023-02-09 14:53 ` Rebecca Cran
2023-02-07 16:13 ` Rebecca Cran
2023-02-09 3:05 ` RichardHo [何明忠]
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=010201862af5f9a8-3ff78c40-4bcb-4fdf-83dd-e8888694d1a5-000000@eu-west-1.amazonses.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