Skip to content

Commit 7cb7b98

Browse files
committed
ibmvnic: Only replenish rx pool when resources are getting low
jira LE-2742 Rebuild_History Non-Buildable kernel-5.14.0-503.35.1.el9_5 commit-author Nick Child <nnac123@linux.ibm.com> commit dda10fc Previously, the driver would replenish the rx pool if the polling function consumed less than the budget. The logic being that the driver did not exhaust its budget so that must mean that the driver is not busy and has cycles to spare for replenishing the pool. So pool replenishment happens on every poll which did not consume the budget. This can very costly during request-response tests. In fact, an extra ~100pps can be seen in TCP_RR_150 tests when we remove this conditional. Trace results (ftrace, graph-time=1) for the poll function are below: Previous results: ibmvnic_poll = 64951846.0 us / 4167628.0 hits = AVG 15.58 replenish_rx_pool = 17602846.0 us / 4710437.0 hits = AVG 3.74 Now: ibmvnic_poll = 57673941.0 us / 4791737.0 hits = AVG 12.04 replenish_rx_pool = 3938171.6 us / 4314.0 hits = AVG 912.88 While the replenish function takes longer, it is hit less frequently meaning the ibmvnic_poll function, on average, is faster. Furthermore, this change does not have a negative effect on performance bandwidth/latency measurements. Signed-off-by: Nick Child <nnac123@linux.ibm.com> Link: https://patch.msgid.link/20240807211809.1259563-2-nnac123@linux.ibm.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> (cherry picked from commit dda10fc) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent 3387fc2 commit 7cb7b98

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/net/ethernet/ibm/ibmvnic.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3320,9 +3320,8 @@ static int ibmvnic_poll(struct napi_struct *napi, int budget)
33203320
}
33213321

33223322
if (adapter->state != VNIC_CLOSING &&
3323-
((atomic_read(&adapter->rx_pool[scrq_num].available) <
3324-
adapter->req_rx_add_entries_per_subcrq / 2) ||
3325-
frames_processed < budget))
3323+
(atomic_read(&adapter->rx_pool[scrq_num].available) <
3324+
adapter->req_rx_add_entries_per_subcrq / 2))
33263325
replenish_rx_pool(adapter, &adapter->rx_pool[scrq_num]);
33273326
if (frames_processed < budget) {
33283327
if (napi_complete_done(napi, frames_processed)) {

0 commit comments

Comments
 (0)