From af864cedb0c893bad0c54b7f7f6a73627965b358 Mon Sep 17 00:00:00 2001 From: Kumar Amber Date: Tue, 12 Apr 2022 19:23:08 +0530 Subject: 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 Co-authored-by: Harry van Haaren Signed-off-by: Ilya Maximets Co-authored-by: Ilya Maximets Signed-off-by: Kumar Amber Acked-by: Cian Ferriter Acked-by: David Marchand Signed-off-by: Ian Stokes --- lib/flow.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/flow.c') 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)) { -- cgit v1.2.1