This commits add the mfex optimized options to be executed as part of scalar DPIF.
Signed-off-by: kumar Amber <[email protected]> --- lib/dpif-netdev.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index e761c415c..8f5156036 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -7035,6 +7035,7 @@ dfc_processing(struct dp_netdev_pmd_thread *pmd, size_t n_missed = 0, n_emc_hit = 0, n_phwol_hit = 0, n_mfex_opt_hit = 0; struct dfc_cache *cache = &pmd->flow_cache; struct dp_packet *packet; + struct dp_packet_batch single_packet; const size_t cnt = dp_packet_batch_size(packets_); uint32_t cur_min = pmd->ctx.emc_insert_min; int i; @@ -7043,6 +7044,11 @@ dfc_processing(struct dp_netdev_pmd_thread *pmd, size_t map_cnt = 0; bool batch_enable = true; + single_packet.count = 1; + + miniflow_extract_func mfex_func; + atomic_read_relaxed(&pmd->miniflow_extract_opt, &mfex_func); + atomic_read_relaxed(&pmd->dp->smc_enable_db, &smc_enable_db); pmd_perf_update_counter(&pmd->perf_stats, md_is_valid ? PMD_STAT_RECIRC : PMD_STAT_RECV, @@ -7093,7 +7099,21 @@ dfc_processing(struct dp_netdev_pmd_thread *pmd, } } - miniflow_extract(packet, &key->mf); + /* Set the count and packet for miniflow_opt with batch_size 1. */ + if ((mfex_func) && (!md_is_valid)) { + single_packet.packets[0] = packet; + int mf_ret; + + mf_ret = mfex_func(&single_packet, key, 1, port_no, pmd); + /* Fallback to original miniflow_extract if there is a miss. */ + if (mf_ret) { + n_mfex_opt_hit++; + } else { + miniflow_extract(packet, &key->mf); + } + } else { + miniflow_extract(packet, &key->mf); + } key->len = 0; /* Not computed yet. */ key->hash = -- 2.25.1 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
