On 3 Jun 2026, at 14:55, Eelco Chaudron via dev wrote:
> This patch introduces a new API to the offload provider framework that
> allows hardware offload implementations to control UDP tunnel source port
> selection during tunnel encapsulation.
>
> Background and Motivation
> =========================
>
> UDP-based tunnels (VXLAN, Geneve, etc.) use the UDP source port as an
> entropy field to enable ECMP load balancing across multiple paths in the
> network. The source port is typically calculated by hashing packet header
> fields (5-tuple or inner packet headers) to distribute flows across
> different paths.
>
> However, hardware offload implementations may require different approaches
> to source port calculation:
>
> 1. Hardware NICs may use different hash functions or hash inputs than
> the software datapath, which can lead to inconsistent flow distribution
> when mixing hardware and software paths.
>
> 2. Some hardware may support enhanced entropy mechanisms (e.g., using
> additional packet fields 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_udp_tnl_get_src_port)(const struct dpif_offload *,
> const struct netdev *ingress_netdev,
> struct dp_packet *packet,
> ovs_be16 *src_port);
>
> The callback is invoked during tunnel push operations when hardware offload
> is enabled and the original ingress port is known. It receives:
> - ingress_netdev: The original ingress port where the packet was received
> - packet: The inner packet to be encapsulated
>
> If the provider implements this callback and returns true, the returned
> src_port value is used. Otherwise, OVS falls back to the standard hash-based
> source port calculation.
>
> Acked-by: Eli Britstein <[email protected]>
> Signed-off-by: Eelco Chaudron <[email protected]>
> ---
Thank Eli, for the review a while ago. Now that the
dependent patch went in, I applied this to main.
//Eelco
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev