mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 06:15:47 +00:00
odp-execute: Reuse rss hash in OVS_ACTION_ATTR_HASH.
If RSS hash exists in a packet it can be reused instead of 5 tuple hash re-calculation in OVS_ACTION_ATTR_HASH. This leads to increasing the performance of sending packets to the OVS bonding in userspace datapath up to 10-15%. Additionally fixed unit test 'select group with dp_hash selection method' to not depend on dp_hash value. Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Acked-by: Darrell Ball <dlu998@gmail.com> Signed-off-by: Andy Zhou <azhou@ovn.org>
This commit is contained in:
@@ -646,8 +646,15 @@ odp_execute_actions(void *dp, struct dp_packet_batch *batch, bool steal,
|
||||
uint32_t hash;
|
||||
|
||||
DP_PACKET_BATCH_FOR_EACH (packet, batch) {
|
||||
flow_extract(packet, &flow);
|
||||
hash = flow_hash_5tuple(&flow, hash_act->hash_basis);
|
||||
/* RSS hash can be used here instead of 5tuple for
|
||||
* performance reasons. */
|
||||
if (dp_packet_rss_valid(packet)) {
|
||||
hash = dp_packet_get_rss_hash(packet);
|
||||
hash = hash_int(hash, hash_act->hash_basis);
|
||||
} else {
|
||||
flow_extract(packet, &flow);
|
||||
hash = flow_hash_5tuple(&flow, hash_act->hash_basis);
|
||||
}
|
||||
packet->md.dp_hash = hash;
|
||||
}
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user