From: Gaetan Rivet <[email protected]>

Count the number of updates done to masked classifiers.

Signed-off-by: Gaetan Rivet <[email protected]>
Acked-by: Roi Dayan <[email protected]>
---
 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 cb0639e6eef6..dc5753fac2be 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 b4d7afd7e282..32985b5d8e9d 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) {
-- 
2.47.0

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to