From 342296b98677b5445d3009619d522f2550e74fe6 Mon Sep 17 00:00:00 2001 From: Gaetan Rivet Date: Thu, 9 Jan 2025 13:35:01 +0200 Subject: [PATCH] dpif-netdev: Count the number of dpcls updates. Count the number of updates done to masked classifiers. Signed-off-by: Gaetan Rivet Acked-by: Roi Dayan Signed-off-by: 0-day Robot --- lib/dpif-netdev-perf.h | 1 + lib/dpif-netdev.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/lib/dpif-netdev-perf.h b/lib/dpif-netdev-perf.h index cb0639e6eef..dc5753fac2b 100644 --- a/lib/dpif-netdev-perf.h +++ b/lib/dpif-netdev-perf.h @@ -74,6 +74,7 @@ enum pmd_stat_type { PMD_STAT_SIMPLE_UPDATE, /* Updates on the simple match cache. */ PMD_STAT_EXACT_UPDATE, /* Updates on the exact match cache (EMC). */ PMD_STAT_SMC_UPDATE, /* Updates on the sig match cache (SMC). */ + PMD_STAT_MASKED_UPDATE, /* Updates on the masked classifiers. */ PMD_STAT_RECV, /* Packets entering the datapath pipeline from an * interface. */ PMD_STAT_RECIRC, /* Packets reentering the datapath pipeline due to diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index b4d7afd7e28..32985b5d8e9 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -3106,6 +3106,7 @@ dp_netdev_pmd_remove_flow(struct dp_netdev_pmd_thread *pmd, cls = dp_netdev_pmd_lookup_dpcls(pmd, in_port); ovs_assert(cls != NULL); dpcls_remove(cls, &flow->cr); + pmd_perf_update_counter(&pmd->perf_stats, PMD_STAT_MASKED_UPDATE, 1); dp_netdev_simple_match_remove(pmd, flow); cmap_remove(&pmd->flow_table, node, dp_netdev_flow_hash(&flow->ufid)); ccmap_dec(&pmd->n_flows, odp_to_u32(in_port)); @@ -4206,6 +4207,7 @@ dp_netdev_flow_add(struct dp_netdev_pmd_thread *pmd, /* Select dpcls for in_port. Relies on in_port to be exact match. */ cls = dp_netdev_pmd_find_dpcls(pmd, in_port); dpcls_insert(cls, &flow->cr, &mask); + pmd_perf_update_counter(&pmd->perf_stats, PMD_STAT_MASKED_UPDATE, 1); ds_put_cstr(&extra_info, "miniflow_bits("); FLOWMAP_FOR_EACH_UNIT (unit) {