mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 14:25:26 +00:00
dpif-netdev: Avoid reading RSS hash when EMC is disabled.
When EMC is disabled the reading of RSS hash is skipped. Also, for packets that are not recirculated it retrieves the hash value without considering the recirc id. Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com> Acked-by: Billy O'Mahony <billy.o.mahony@intel.com> Signed-off-by: Darrell Ball <dlu998@gmail.com>
This commit is contained in:
committed by
Darrell Ball
parent
8c319e8b73
commit
bde94613e6
@@ -4764,6 +4764,22 @@ dp_netdev_upcall(struct dp_netdev_pmd_thread *pmd, struct dp_packet *packet_,
|
||||
actions, wc, put_actions, dp->upcall_aux);
|
||||
}
|
||||
|
||||
static inline uint32_t
|
||||
dpif_netdev_packet_get_rss_hash_orig_pkt(struct dp_packet *packet,
|
||||
const struct miniflow *mf)
|
||||
{
|
||||
uint32_t hash;
|
||||
|
||||
if (OVS_LIKELY(dp_packet_rss_valid(packet))) {
|
||||
hash = dp_packet_get_rss_hash(packet);
|
||||
} else {
|
||||
hash = miniflow_hash_5tuple(mf, 0);
|
||||
dp_packet_set_rss_hash(packet, hash);
|
||||
}
|
||||
|
||||
return hash;
|
||||
}
|
||||
|
||||
static inline uint32_t
|
||||
dpif_netdev_packet_get_rss_hash(struct dp_packet *packet,
|
||||
const struct miniflow *mf)
|
||||
@@ -4902,10 +4918,18 @@ emc_processing(struct dp_netdev_pmd_thread *pmd,
|
||||
}
|
||||
miniflow_extract(packet, &key->mf);
|
||||
key->len = 0; /* Not computed yet. */
|
||||
key->hash = dpif_netdev_packet_get_rss_hash(packet, &key->mf);
|
||||
|
||||
/* If EMC is disabled skip emc_lookup */
|
||||
flow = (cur_min == 0) ? NULL: emc_lookup(flow_cache, key);
|
||||
/* If EMC is disabled skip hash computation and emc_lookup */
|
||||
if (cur_min) {
|
||||
if (!md_is_valid) {
|
||||
key->hash = dpif_netdev_packet_get_rss_hash_orig_pkt(packet,
|
||||
&key->mf);
|
||||
} else {
|
||||
key->hash = dpif_netdev_packet_get_rss_hash(packet, &key->mf);
|
||||
}
|
||||
flow = emc_lookup(flow_cache, key);
|
||||
} else {
|
||||
flow = NULL;
|
||||
}
|
||||
if (OVS_LIKELY(flow)) {
|
||||
dp_netdev_queue_batches(packet, flow, &key->mf, batches,
|
||||
n_batches);
|
||||
|
Reference in New Issue
Block a user