From: Thomas Falcon <tlfalcon@linux.ibm.com>
To: ljp <ljp@linux.vnet.ibm.com>
Cc: cforno12@linux.ibm.com, netdev@vger.kernel.org,
ricklind@linux.ibm.com, dnbanerg@us.ibm.com,
Linuxppc-dev
<linuxppc-dev-bounces+ljp=linux.ibm.com@lists.ozlabs.org>,
drt@linux.vnet.ibm.com, brking@linux.vnet.ibm.com,
kuba@kernel.org, sukadev@linux.vnet.ibm.com,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH net-next v2 9/9] ibmvnic: Do not replenish RX buffers after every polling loop
Date: Thu, 19 Nov 2020 14:26:35 -0600 [thread overview]
Message-ID: <83ca37f3-07be-4179-8414-88c8c83bfe56@linux.ibm.com> (raw)
In-Reply-To: <1a4e7b1ef1fb101cbb26fb9d5867ee46@linux.vnet.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 2129 bytes --]
On 11/19/20 3:43 AM, ljp wrote:
> On 2020-11-18 19:12, Thomas Falcon wrote:
>> From: "Dwip N. Banerjee" <dnbanerg@us.ibm.com>
>>
>> Reduce the amount of time spent replenishing RX buffers by
>> only doing so once available buffers has fallen under a certain
>> threshold, in this case half of the total number of buffers, or
>> if the polling loop exits before the packets processed is less
>> than its budget.
>>
>> Signed-off-by: Dwip N. Banerjee <dnbanerg@us.ibm.com>
>> ---
>> drivers/net/ethernet/ibm/ibmvnic.c | 5 ++++-
>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/ibm/ibmvnic.c
>> b/drivers/net/ethernet/ibm/ibmvnic.c
>> index 96df6d8fa277..9fe43ab0496d 100644
>> --- a/drivers/net/ethernet/ibm/ibmvnic.c
>> +++ b/drivers/net/ethernet/ibm/ibmvnic.c
>> @@ -2537,7 +2537,10 @@ static int ibmvnic_poll(struct napi_struct
>> *napi, int budget)
>> frames_processed++;
>> }
>>
>> - if (adapter->state != VNIC_CLOSING)
>> + if (adapter->state != VNIC_CLOSING &&
>> + ((atomic_read(&adapter->rx_pool[scrq_num].available) <
>> + adapter->req_rx_add_entries_per_subcrq / 2) ||
>> + frames_processed < budget))
>
> 1/2 seems a simple and good algorithm.
> Explaining why "frames_process < budget" is necessary in the commit
> message
> or source code also helps.
>
Hello, Lijun. The patch author, Dwip Banerjee, suggested the modified
commit message below:
Reduce the amount of time spent replenishing RX buffers by
only doing so once available buffers has fallen under a certain
threshold, in this case half of the total number of buffers, or
if the polling loop exits before the packets processed is less
than its budget. Non-exhaustion of NAPI budget implies lower
incoming packet pressure, allowing the leeway to refill the buffers
in preparation for any impending burst.
Would such an update require a v3?
>
>> replenish_rx_pool(adapter, &adapter->rx_pool[scrq_num]);
>> if (frames_processed < budget) {
>> if (napi_complete_done(napi, frames_processed)) {
[-- Attachment #2: Type: text/html, Size: 3641 bytes --]
next prev parent reply other threads:[~2020-11-19 21:01 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-19 1:12 [PATCH net-next v2 0/9] ibmvnic: Performance improvements and other updates Thomas Falcon
2020-11-19 1:12 ` [PATCH net-next v2 1/9] ibmvnic: Introduce indirect subordinate Command Response Queue buffer Thomas Falcon
2020-11-19 9:34 ` ljp
2020-11-19 1:12 ` [PATCH net-next v2 2/9] ibmvnic: Introduce batched RX buffer descriptor transmission Thomas Falcon
2020-11-19 1:12 ` [PATCH net-next v2 3/9] ibmvnic: Introduce xmit_more support using batched subCRQ hcalls Thomas Falcon
2020-11-19 1:12 ` [PATCH net-next v2 4/9] ibmvnic: Clean up TX code and TX buffer data structure Thomas Falcon
2020-11-19 1:12 ` [PATCH net-next v2 5/9] ibmvnic: Remove send_subcrq function Thomas Falcon
2020-11-19 9:37 ` ljp
2020-11-19 1:12 ` [PATCH net-next v2 6/9] ibmvnic: Ensure that device queue memory is cache-line aligned Thomas Falcon
2020-11-19 1:12 ` [PATCH net-next v2 7/9] ibmvnic: Correctly re-enable interrupts in NAPI polling routine Thomas Falcon
2020-11-19 1:12 ` [PATCH net-next v2 8/9] ibmvnic: Use netdev_alloc_skb instead of alloc_skb to replenish RX buffers Thomas Falcon
2020-11-19 9:47 ` ljp
2020-11-19 1:12 ` [PATCH net-next v2 9/9] ibmvnic: Do not replenish RX buffers after every polling loop Thomas Falcon
2020-11-19 9:43 ` ljp
2020-11-19 20:26 ` Thomas Falcon [this message]
2020-11-19 20:38 ` ljp
2020-11-19 20:58 ` Thomas Falcon
2020-11-21 3:52 ` [PATCH net-next v2 0/9] ibmvnic: Performance improvements and other updates Jakub Kicinski
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=83ca37f3-07be-4179-8414-88c8c83bfe56@linux.ibm.com \
--to=tlfalcon@linux.ibm.com \
--cc=brking@linux.vnet.ibm.com \
--cc=cforno12@linux.ibm.com \
--cc=dnbanerg@us.ibm.com \
--cc=drt@linux.vnet.ibm.com \
--cc=kuba@kernel.org \
--cc=linuxppc-dev-bounces+ljp=linux.ibm.com@lists.ozlabs.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=ljp@linux.vnet.ibm.com \
--cc=netdev@vger.kernel.org \
--cc=ricklind@linux.ibm.com \
--cc=sukadev@linux.vnet.ibm.com \
/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;
as well as URLs for NNTP newsgroup(s).