Skip to content

Commit 1919b39

Browse files
haiyangzPaolo Abeni
authored andcommitted
net: mana: Fix perf regression: remove rx_cqes, tx_cqes counters
The apc->eth_stats.rx_cqes is one per NIC (vport), and it's on the frequent and parallel code path of all queues. So, r/w into this single shared variable by many threads on different CPUs creates a lot caching and memory overhead, hence perf regression. And, it's not accurate due to the high volume concurrent r/w. For example, a workload is iperf with 128 threads, and with RPS enabled. We saw perf regression of 25% with the previous patch adding the counters. And this patch eliminates the regression. Since the error path of mana_poll_rx_cq() already has warnings, so keeping the counter and convert it to a per-queue variable is not necessary. So, just remove this counter from this high frequency code path. Also, remove the tx_cqes counter for the same reason. We have warnings & other counters for errors on that path, and don't need to count every normal cqe processing. Cc: stable@vger.kernel.org Fixes: bd7fc6e ("net: mana: Add new MANA VF performance counters for easier troubleshooting") Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com> Reviewed-by: Jiri Pirko <jiri@nvidia.com> Link: https://lore.kernel.org/r/1685115537-31675-1-git-send-email-haiyangz@microsoft.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent 111d467 commit 1919b39

3 files changed

Lines changed: 0 additions & 14 deletions

File tree

drivers/net/ethernet/microsoft/mana/mana_en.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,8 +1279,6 @@ static void mana_poll_tx_cq(struct mana_cq *cq)
12791279
if (comp_read < 1)
12801280
return;
12811281

1282-
apc->eth_stats.tx_cqes = comp_read;
1283-
12841282
for (i = 0; i < comp_read; i++) {
12851283
struct mana_tx_comp_oob *cqe_oob;
12861284

@@ -1363,8 +1361,6 @@ static void mana_poll_tx_cq(struct mana_cq *cq)
13631361
WARN_ON_ONCE(1);
13641362

13651363
cq->work_done = pkt_transmitted;
1366-
1367-
apc->eth_stats.tx_cqes -= pkt_transmitted;
13681364
}
13691365

13701366
static void mana_post_pkt_rxq(struct mana_rxq *rxq)
@@ -1626,15 +1622,11 @@ static void mana_poll_rx_cq(struct mana_cq *cq)
16261622
{
16271623
struct gdma_comp *comp = cq->gdma_comp_buf;
16281624
struct mana_rxq *rxq = cq->rxq;
1629-
struct mana_port_context *apc;
16301625
int comp_read, i;
16311626

1632-
apc = netdev_priv(rxq->ndev);
1633-
16341627
comp_read = mana_gd_poll_cq(cq->gdma_cq, comp, CQE_POLLING_BUFFER);
16351628
WARN_ON_ONCE(comp_read > CQE_POLLING_BUFFER);
16361629

1637-
apc->eth_stats.rx_cqes = comp_read;
16381630
rxq->xdp_flush = false;
16391631

16401632
for (i = 0; i < comp_read; i++) {
@@ -1646,8 +1638,6 @@ static void mana_poll_rx_cq(struct mana_cq *cq)
16461638
return;
16471639

16481640
mana_process_rx_cqe(rxq, cq, &comp[i]);
1649-
1650-
apc->eth_stats.rx_cqes--;
16511641
}
16521642

16531643
if (rxq->xdp_flush)

drivers/net/ethernet/microsoft/mana/mana_ethtool.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@ static const struct {
1313
} mana_eth_stats[] = {
1414
{"stop_queue", offsetof(struct mana_ethtool_stats, stop_queue)},
1515
{"wake_queue", offsetof(struct mana_ethtool_stats, wake_queue)},
16-
{"tx_cqes", offsetof(struct mana_ethtool_stats, tx_cqes)},
1716
{"tx_cq_err", offsetof(struct mana_ethtool_stats, tx_cqe_err)},
1817
{"tx_cqe_unknown_type", offsetof(struct mana_ethtool_stats,
1918
tx_cqe_unknown_type)},
20-
{"rx_cqes", offsetof(struct mana_ethtool_stats, rx_cqes)},
2119
{"rx_coalesced_err", offsetof(struct mana_ethtool_stats,
2220
rx_coalesced_err)},
2321
{"rx_cqe_unknown_type", offsetof(struct mana_ethtool_stats,

include/net/mana/mana.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,10 +347,8 @@ struct mana_tx_qp {
347347
struct mana_ethtool_stats {
348348
u64 stop_queue;
349349
u64 wake_queue;
350-
u64 tx_cqes;
351350
u64 tx_cqe_err;
352351
u64 tx_cqe_unknown_type;
353-
u64 rx_cqes;
354352
u64 rx_coalesced_err;
355353
u64 rx_cqe_unknown_type;
356354
};

0 commit comments

Comments
 (0)