Skip to content

Commit c20faec

Browse files
committed
ibmvnic: Only record tx completed bytes once per handler
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 1c33e29 Byte Queue Limits depends on dql_completed being called once per tx completion round in order to adjust its algorithm appropriately. The dql->limit value is an approximation of the amount of bytes that the NIC can consume per irq interval. If this approximation is too high then the NIC will become over-saturated. Too low and the NIC will starve. The dql->limit depends on dql->prev-* stats to calculate an optimal value. If dql_completed() is called more than once per irq handler then those prev-* values become unreliable (because they are not an accurate representation of the previous state of the NIC) resulting in a sub-optimal limit value. Therefore, move the call to netdev_tx_completed_queue() to the end of ibmvnic_complete_tx(). When performing 150 sessions of TCP rr (request-response 1 byte packets) workloads, one could observe: PREVIOUSLY: - limit and inflight values hovering around 130 - transaction rate of around 750k pps. NOW: - limit rises and falls in response to inflight (130-900) - transaction rate of around 1M pps (33% improvement) Signed-off-by: Nick Child <nnac123@linux.ibm.com> Link: https://patch.msgid.link/20240807211809.1259563-7-nnac123@linux.ibm.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> (cherry picked from commit 1c33e29) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent 7cb7b98 commit c20faec

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

drivers/net/ethernet/ibm/ibmvnic.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4020,20 +4020,17 @@ static int ibmvnic_complete_tx(struct ibmvnic_adapter *adapter,
40204020
struct ibmvnic_sub_crq_queue *scrq)
40214021
{
40224022
struct device *dev = &adapter->vdev->dev;
4023+
int num_packets = 0, total_bytes = 0;
40234024
struct ibmvnic_tx_pool *tx_pool;
40244025
struct ibmvnic_tx_buff *txbuff;
40254026
struct netdev_queue *txq;
40264027
union sub_crq *next;
4027-
int index;
4028-
int i;
4028+
int index, i;
40294029

40304030
restart_loop:
40314031
while (pending_scrq(adapter, scrq)) {
40324032
unsigned int pool = scrq->pool_index;
40334033
int num_entries = 0;
4034-
int total_bytes = 0;
4035-
int num_packets = 0;
4036-
40374034
next = ibmvnic_next_scrq(adapter, scrq);
40384035
for (i = 0; i < next->tx_comp.num_comps; i++) {
40394036
index = be32_to_cpu(next->tx_comp.correlators[i]);
@@ -4069,8 +4066,6 @@ static int ibmvnic_complete_tx(struct ibmvnic_adapter *adapter,
40694066
/* remove tx_comp scrq*/
40704067
next->tx_comp.first = 0;
40714068

4072-
txq = netdev_get_tx_queue(adapter->netdev, scrq->pool_index);
4073-
netdev_tx_completed_queue(txq, num_packets, total_bytes);
40744069

40754070
if (atomic_sub_return(num_entries, &scrq->used) <=
40764071
(adapter->req_tx_entries_per_subcrq / 2) &&
@@ -4095,6 +4090,9 @@ static int ibmvnic_complete_tx(struct ibmvnic_adapter *adapter,
40954090
goto restart_loop;
40964091
}
40974092

4093+
txq = netdev_get_tx_queue(adapter->netdev, scrq->pool_index);
4094+
netdev_tx_completed_queue(txq, num_packets, total_bytes);
4095+
40984096
return 0;
40994097
}
41004098

0 commit comments

Comments
 (0)