Eelco Chaudron <[email protected]> writes: > This patch introduces a new API to the offload provider framework that > allows hardware offload implementations to control hash value calculation > for the OVS_ACTION_ATTR_HASH action. n> > Background and Motivation > ========================= > > The OVS hash action (OVS_ACTION_ATTR_HASH) is used to compute a hash value > from packet header fields, primarily for load balancing across multiple > paths using the select group action. The hash value is stored in the > packet's metadata and used by subsequent actions to distribute flows > across multiple output ports. > > However, hardware offload implementations may require different approaches > to hash calculation: > > 1. Hardware NICs may use different hash functions or hash inputs than > the software datapath, which can lead to inconsistent load distribution > when mixing hardware and software paths. > > 2. Some hardware may support enhanced hashing mechanisms (e.g., using > symmetric hashing for bidirectional flows or hardware-specific hash > engines) that provide better load distribution than the default > software implementation. > > Design > ====== > > This patch adds a new optional callback to the dpif_offload_class: > > bool (*netdev_get_dp_hash)(const struct dpif_offload *, > const struct netdev *ingress_netdev, > struct dp_packet *, > const struct ovs_action_hash *, uint32_t *hash); > > To integrate this into the action execution path, a new optional callback > type, odp_hash_cb, is passed to odp_execute_actions() to allow per-packet > hash overrides during OVS_ACTION_ATTR_HASH processing. The dpif-netdev > datapath provides an implementation that calls the offload provider's > netdev_get_dp_hash when hardware offload is enabled and the original > ingress port is known. If the provider returns true, the returned hash > value is used; otherwise, OVS falls back to the standard hash calculation. > > Signed-off-by: Eelco Chaudron <[email protected]> > ---
Acked-by: Aaron Conole <[email protected]> _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
