Skip to content

Commit

Permalink
dpif-netdev: Count the number of dpcls updates.
Browse files Browse the repository at this point in the history
Count the number of updates done to masked classifiers.

Signed-off-by: Gaetan Rivet <[email protected]>
Acked-by: Roi Dayan <[email protected]>
Signed-off-by: 0-day Robot <[email protected]>
  • Loading branch information
grivet authored and ovsrobot committed Jan 9, 2025
1 parent dc6fdfd commit 342296b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/dpif-netdev-perf.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions lib/dpif-netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 342296b

Please sign in to comment.