mirror of
https://github.com/openvswitch/ovs
synced 2025-10-09 13:49:05 +00:00
packet-dpif: Add dpif_packet_{get, set}_hash()
These function are used to stored the packet hash. 'netdev-dpdk' automatically set this value to the RSS hash returned by the NIC. Other 'netdev's set it to 0 (which is an invalid hash value), so that callers can compute the hash on their own. If DPDK support is enabled, struct dpif_packet's member 'dp_hash' is removed and 'pkt.hash.rss' from DPDK mbuf is used This commit also configure DPDK devices to compute RSS hash for UDP and IPv6 packets Signed-off-by: Daniele Di Proietto <ddiproietto@vmware.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
This commit is contained in:
committed by
Pravin B Shelar
parent
9230662a87
commit
61a2647e15
@@ -136,7 +136,8 @@ odp_execute_set_action(struct dpif_packet *packet, const struct nlattr *a,
|
||||
break;
|
||||
|
||||
case OVS_KEY_ATTR_DP_HASH:
|
||||
packet->dp_hash = md->dp_hash = nl_attr_get_u32(a);
|
||||
md->dp_hash = nl_attr_get_u32(a);
|
||||
dpif_packet_set_dp_hash(packet, md->dp_hash);
|
||||
break;
|
||||
|
||||
case OVS_KEY_ATTR_RECIRC_ID:
|
||||
@@ -251,7 +252,7 @@ odp_execute_actions__(void *dp, struct dpif_packet **packets, int cnt,
|
||||
}
|
||||
|
||||
/* We also store the hash value with each packet */
|
||||
packets[i]->dp_hash = hash ? hash : 1;
|
||||
dpif_packet_set_dp_hash(packets[i], hash ? hash : 1);
|
||||
}
|
||||
} else {
|
||||
/* Assert on unknown hash algorithm. */
|
||||
|
Reference in New Issue
Block a user