summaryrefslogtreecommitdiff
path: root/lib/flow.c
diff options
context:
space:
mode:
authorKumar Amber <kumar.amber@intel.com>2022-04-12 19:23:08 +0530
committerIan Stokes <ian.stokes@intel.com>2022-05-04 14:24:04 +0100
commitaf864cedb0c893bad0c54b7f7f6a73627965b358 (patch)
tree679178c51ae2bdb85c62f5f92d5248a098bda013 /lib/flow.c
parentdc808227612dead404415d9566c6455a2d8d305e (diff)
downloadopenvswitch-af864cedb0c893bad0c54b7f7f6a73627965b358.tar.gz
dpif-netdev/mfex: Add ipv4 profile based hashing.
For packets which don't already have a hash calculated, miniflow_hash_5tuple() calculates the hash of a packet using the previously built miniflow. This commit adds IPv4 profile specific hashing which uses fixed offsets into the packet to improve hashing performance. Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com> Co-authored-by: Harry van Haaren <harry.van.haaren@intel.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org> Co-authored-by: Ilya Maximets <i.maximets@ovn.org> Signed-off-by: Kumar Amber <kumar.amber@intel.com> Acked-by: Cian Ferriter <cian.ferriter@intel.com> Acked-by: David Marchand <david.marchand@redhat.com> Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Diffstat (limited to 'lib/flow.c')
-rw-r--r--lib/flow.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/flow.c b/lib/flow.c
index dd523c889..8ab9df3fc 100644
--- a/lib/flow.c
+++ b/lib/flow.c
@@ -1017,6 +1017,9 @@ miniflow_extract(struct dp_packet *packet, struct miniflow *dst)
miniflow_push_be16(mf, tp_dst, tcp->tcp_dst);
miniflow_push_be16(mf, ct_tp_src, ct_tp_src);
miniflow_push_be16(mf, ct_tp_dst, ct_tp_dst);
+ if (dl_type == htons(ETH_TYPE_IP)) {
+ dp_packet_update_rss_hash_ipv4_tcp_udp(packet);
+ }
}
}
} else if (OVS_LIKELY(nw_proto == IPPROTO_UDP)) {
@@ -1027,6 +1030,9 @@ miniflow_extract(struct dp_packet *packet, struct miniflow *dst)
miniflow_push_be16(mf, tp_dst, udp->udp_dst);
miniflow_push_be16(mf, ct_tp_src, ct_tp_src);
miniflow_push_be16(mf, ct_tp_dst, ct_tp_dst);
+ if (dl_type == htons(ETH_TYPE_IP)) {
+ dp_packet_update_rss_hash_ipv4_tcp_udp(packet);
+ }
}
} else if (OVS_LIKELY(nw_proto == IPPROTO_SCTP)) {
if (OVS_LIKELY(size >= SCTP_HEADER_LEN)) {