@@ -21,6 +21,8 @@ Post-v2.15.0
* An optimized miniflow extract (mfex) implementation is now available,
which uses CPU SIMD ISA to parse specific traffic profiles efficiently.
Refer to the documentation for details on how to enable it at runtime.
+ * A new datapath statistic is shown when the "dpif-netdev/pmd-perf-show"
+ command is executed, it counts hits on the optimized mfex parsing.
- ovs-ctl:
* New option '--no-record-hostname' to disable hostname configuration
in ovsdb on startup.
@@ -252,8 +252,10 @@ dp_netdev_input_outer_avx512(struct dp_netdev_pmd_thread *pmd,
}
/* At this point we don't return error anymore, so commit stats here. */
+ uint32_t mfex_hit = __builtin_popcountll(mf_mask);
pmd_perf_update_counter(&pmd->perf_stats, PMD_STAT_RECV, batch_size);
pmd_perf_update_counter(&pmd->perf_stats, PMD_STAT_PHWOL_HIT, phwol_hits);
+ pmd_perf_update_counter(&pmd->perf_stats, PMD_STAT_MFEX_OPT_HIT, mfex_hit);
pmd_perf_update_counter(&pmd->perf_stats, PMD_STAT_EXACT_HIT, emc_hits);
pmd_perf_update_counter(&pmd->perf_stats, PMD_STAT_SMC_HIT, smc_hits);
pmd_perf_update_counter(&pmd->perf_stats, PMD_STAT_MASKED_HIT,
@@ -247,6 +247,7 @@ pmd_perf_format_overall_stats(struct ds *str, struct pmd_perf_stats *s,
" Rx packets: %12"PRIu64" (%.0f Kpps, %.0f cycles/pkt)\n"
" Datapath passes: %12"PRIu64" (%.2f passes/pkt)\n"
" - PHWOL hits: %12"PRIu64" (%5.1f %%)\n"
+ " - MFEX Opt hits: %12"PRIu64" (%5.1f %%)\n"
" - EMC hits: %12"PRIu64" (%5.1f %%)\n"
" - SMC hits: %12"PRIu64" (%5.1f %%)\n"
" - Megaflow hits: %12"PRIu64" (%5.1f %%, %.2f "
@@ -258,6 +259,8 @@ pmd_perf_format_overall_stats(struct ds *str, struct pmd_perf_stats *s,
passes, rx_packets ? 1.0 * passes / rx_packets : 0,
stats[PMD_STAT_PHWOL_HIT],
100.0 * stats[PMD_STAT_PHWOL_HIT] / passes,
+ stats[PMD_STAT_MFEX_OPT_HIT],
+ 100.0 * stats[PMD_STAT_MFEX_OPT_HIT] / passes,
stats[PMD_STAT_EXACT_HIT],
100.0 * stats[PMD_STAT_EXACT_HIT] / passes,
stats[PMD_STAT_SMC_HIT],
@@ -57,6 +57,7 @@ extern "C" {
enum pmd_stat_type {
PMD_STAT_PHWOL_HIT, /* Packets that had a partial HWOL hit (phwol). */
+ PMD_STAT_MFEX_OPT_HIT, /* Packets that had miniflow optimized match. */
PMD_STAT_EXACT_HIT, /* Packets that had an exact match (emc). */
PMD_STAT_SMC_HIT, /* Packets that had a sig match hit (SMC). */
PMD_STAT_MASKED_HIT, /* Packets that matched in the flow table. */
@@ -662,6 +662,7 @@ pmd_info_show_stats(struct ds *reply,
" packet recirculations: %"PRIu64"\n"
" avg. datapath passes per packet: %.02f\n"
" phwol hits: %"PRIu64"\n"
+ " mfex opt hits: %"PRIu64"\n"
" emc hits: %"PRIu64"\n"
" smc hits: %"PRIu64"\n"
" megaflow hits: %"PRIu64"\n"
@@ -671,10 +672,9 @@ pmd_info_show_stats(struct ds *reply,
" avg. packets per output batch: %.02f\n",
total_packets, stats[PMD_STAT_RECIRC],
passes_per_pkt, stats[PMD_STAT_PHWOL_HIT],
- stats[PMD_STAT_EXACT_HIT],
- stats[PMD_STAT_SMC_HIT],
- stats[PMD_STAT_MASKED_HIT], lookups_per_hit,
- stats[PMD_STAT_MISS], stats[PMD_STAT_LOST],
+ stats[PMD_STAT_MFEX_OPT_HIT], stats[PMD_STAT_EXACT_HIT],
+ stats[PMD_STAT_SMC_HIT], stats[PMD_STAT_MASKED_HIT],
+ lookups_per_hit, stats[PMD_STAT_MISS], stats[PMD_STAT_LOST],
packets_per_batch);
if (total_cycles == 0) {
@@ -6834,7 +6834,7 @@ dfc_processing(struct dp_netdev_pmd_thread *pmd,
bool md_is_valid, odp_port_t port_no)
{
struct netdev_flow_key *key = &keys[0];
- size_t n_missed = 0, n_emc_hit = 0, n_phwol_hit = 0;
+ size_t n_missed = 0, n_emc_hit = 0, n_phwol_hit = 0, n_mfex_opt_hit = 0;
struct dp_packet_batch single_packet;
struct dfc_cache *cache = &pmd->flow_cache;
struct dp_packet *packet;
@@ -6902,6 +6902,8 @@ dfc_processing(struct dp_netdev_pmd_thread *pmd,
/* Fallback to original miniflow_extract if there is a miss. */
if (!mf_ret) {
miniflow_extract(packet, &key->mf);
+ } else {
+ n_mfex_opt_hit++;
}
} else {
miniflow_extract(packet, &key->mf);
@@ -6953,6 +6955,8 @@ dfc_processing(struct dp_netdev_pmd_thread *pmd,
*n_flows = map_cnt;
pmd_perf_update_counter(&pmd->perf_stats, PMD_STAT_PHWOL_HIT, n_phwol_hit);
+ pmd_perf_update_counter(&pmd->perf_stats, PMD_STAT_MFEX_OPT_HIT,
+ n_mfex_opt_hit);
pmd_perf_update_counter(&pmd->perf_stats, PMD_STAT_EXACT_HIT, n_emc_hit);
if (!smc_enable_db) {
@@ -202,12 +202,13 @@ dummy@ovs-dummy: hit:0 missed:0
p0 7/1: (dummy-pmd: configured_rx_queues=4, configured_tx_queues=<cleared>, requested_rx_queues=4, requested_tx_queues=<cleared>)
])
-AT_CHECK([ovs-appctl dpif-netdev/pmd-stats-show | sed SED_NUMA_CORE_PATTERN | sed '/cycles/d' | grep pmd -A 10], [0], [dnl
+AT_CHECK([ovs-appctl dpif-netdev/pmd-stats-show | sed SED_NUMA_CORE_PATTERN | sed '/cycles/d' | grep pmd -A 11], [0], [dnl
pmd thread numa_id <cleared> core_id <cleared>:
packets received: 0
packet recirculations: 0
avg. datapath passes per packet: 0.00
phwol hits: 0
+ mfex opt hits: 0
emc hits: 0
smc hits: 0
megaflow hits: 0
@@ -234,12 +235,13 @@ AT_CHECK([cat ovs-vswitchd.log | filter_flow_install | strip_xout], [0], [dnl
recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:77,dst=50:54:00:00:01:78),eth_type(0x0800),ipv4(frag=no), actions: <del>
])
-AT_CHECK([ovs-appctl dpif-netdev/pmd-stats-show | sed SED_NUMA_CORE_PATTERN | sed '/cycles/d' | grep pmd -A 10], [0], [dnl
+AT_CHECK([ovs-appctl dpif-netdev/pmd-stats-show | sed SED_NUMA_CORE_PATTERN | sed '/cycles/d' | grep pmd -A 11], [0], [dnl
pmd thread numa_id <cleared> core_id <cleared>:
packets received: 20
packet recirculations: 0
avg. datapath passes per packet: 1.00
phwol hits: 0
+ mfex opt hits: 0
emc hits: 19
smc hits: 0
megaflow hits: 0