On 2/2/26 11:29 AM, Eelco Chaudron wrote:
> Previously, dpif_offload_set_config() was skipped if the dpif
> provider did not implement the corresponding class function.
> This was incorrect: the offload configuration function should be
> called regardless of whether the dpif-provider-specific function
> exists.
> 
> Fixes: bd6543466dc6 ("dpif-offload: Add offload provider set_config API.")
> Signed-off-by: Eelco Chaudron <[email protected]>
> ---
> 
> v2: Added a self-test.
> ---
>  lib/dpif.c                       |  2 +-
>  tests/system-offloads-traffic.at | 35 ++++++++++++++++++++++++++++++++
>  2 files changed, 36 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/dpif.c b/lib/dpif.c
> index 88b5edfad5..cab5884254 100644
> --- a/lib/dpif.c
> +++ b/lib/dpif.c
> @@ -1609,8 +1609,8 @@ dpif_set_config(struct dpif *dpif, const struct smap 
> *cfg)
>          if (error) {
>              log_operation(dpif, "set_config", error);
>          }
> -        dpif_offload_set_config(dpif, cfg);
>      }
> +    dpif_offload_set_config(dpif, cfg);
>  
>      return error;
>  }
> diff --git a/tests/system-offloads-traffic.at 
> b/tests/system-offloads-traffic.at
> index ba1f9fe5e8..6e71f672f9 100644
> --- a/tests/system-offloads-traffic.at
> +++ b/tests/system-offloads-traffic.at
> @@ -93,6 +93,41 @@ AT_CHECK([ovs-appctl upcall/show | grep -E "offloaded 
> flows : [[1-9]]"], [0], [i
>  OVS_TRAFFIC_VSWITCHD_STOP
>  AT_CLEANUP
>  
> +AT_SETUP([offloads - tc-policy configuration])
> +OVS_TRAFFIC_VSWITCHD_START([], [],
> +  [-- set Open_vSwitch . other_config:hw-offload=true \
> +   -- set Open_vSwitch . other_config:tc-policy=skip_hw])
> +
> +AT_CHECK([ovs-ofctl add-flow br0 "actions=normal"])
> +
> +ADD_NAMESPACES(at_ns0, at_ns1)
> +
> +ADD_VETH(p0, at_ns0, br0, "10.1.1.1/24")
> +ADD_VETH(p1, at_ns1, br0, "10.1.1.2/24")
> +AT_CHECK([ovs-appctl dpctl/dump-flows], [0], [ignore])
> +
> +NS_CHECK_EXEC([at_ns0], [ping -q -c 10 -i 0.1 -W 2 10.1.1.2 | FORMAT_PING], 
> [0], [dnl
> +10 packets transmitted, 10 received, 0% packet loss, time 0ms
> +])
> +
> +AT_CHECK([ovs-appctl dpctl/dump-flows | grep "eth_type(0x0800)" | 
> DUMP_CLEAN_SORTED], [0], [dnl
> +in_port(2),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:9, bytes:756, 
> used:0.001s, actions:output
> +in_port(3),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:9, bytes:756, 
> used:0.001s, actions:output
> +])
> +
> +AT_CHECK([ovs-appctl dpctl/dump-flows type=ovs | grep "eth_type(0x0800)" | 
> DUMP_CLEAN_SORTED], [0], [])
> +
> +AT_CHECK([ovs-appctl dpctl/dump-flows type=tc,offloaded | grep 
> "eth_type(0x0800)" | DUMP_CLEAN_SORTED], [0], [dnl
> +in_port(2),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:9, bytes:756, 
> used:0.001s, actions:output
> +in_port(3),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:9, bytes:756, 
> used:0.001s, actions:output
> +])
> +
> +AT_CHECK([ovs-appctl upcall/show | grep -E "offloaded flows : [[1-9]]"], 
> [0], [ignore])
> +AT_CHECK([tc -d filter show dev ovs-p0 ingress | grep -q "skip_hw"], [0])

nit: The [0] at the end is redundant, it's the default.

Otherwise, LGTM!

Acked-by: Ilya Maximets <[email protected]>
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to