On 12/14/25 11:22 PM, Alexandra Rukomoinikova wrote:
> From Open vSwitch 2.10 onwards, dp_hash is the default selection method
> for select groups. When this method is used, packet recirculation occurs
> to compute the hash at the datapath level. Previously, this case was
> logged as "no live bucket", which was misleading.
> 
> Reported-at: 
> https://mail.openvswitch.org/pipermail/ovs-discuss/2023-December/052860.html
> Fixes: 53cc166ae5fe ("xlate: Use dp_hash for select groups.")
> Signed-off-by: Alexandra Rukomoinikova <[email protected]>
> ---
>  ofproto/ofproto-dpif-xlate.c |  6 +++++-
>  tests/ofproto-dpif.at        | 29 +++++++++++++++++++++++++++++
>  2 files changed, 34 insertions(+), 1 deletion(-)
> 
> diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
> index 2c8197fb7..920d998e6 100644
> --- a/ofproto/ofproto-dpif-xlate.c
> +++ b/ofproto/ofproto-dpif-xlate.c
> @@ -4988,6 +4988,8 @@ pick_dp_hash_select_group(struct xlate_ctx *ctx, struct 
> group_dpif *group)
>              hash_alg = OVS_HASH_ALG_L4;
>          }
>          ctx_trigger_recirculate_with_hash(ctx, hash_alg, group->hash_basis);
> +        xlate_report(ctx, OFT_DETAIL,
> +                     "selection method in use: dp_hash, recirculating");
>          return NULL;
>      } else {
>          uint32_t hash_mask = group->hash_mask;
> @@ -5067,7 +5069,9 @@ xlate_group_action__(struct xlate_ctx *ctx, struct 
> group_dpif *group,
>              xlate_group_bucket(ctx, bucket, is_last_action);
>              xlate_group_stats(ctx, group, bucket);
>          } else {
> -            xlate_report(ctx, OFT_DETAIL, "no live bucket");
> +            if (!ctx->freezing) {
> +                xlate_report(ctx, OFT_DETAIL, "no live bucket");
> +            }
>              if (ctx->xin->xcache) {
>                  ofproto_group_unref(&group->up);
>              }
> diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at
> index 7ebbee56d..32c6ccfbd 100644
> --- a/tests/ofproto-dpif.at
> +++ b/tests/ofproto-dpif.at
> @@ -1570,6 +1570,35 @@ AT_CHECK([tail -1 stdout], [0],
>  OVS_VSWITCHD_STOP
>  AT_CLEANUP
>  
> +AT_SETUP([ofproto-dpif - select group with dp_hash, tracing])
> +OVS_VSWITCHD_START
> +add_of_ports br0 1 2
> +
> +AT_CHECK([ovs-ofctl -O OpenFlow15 add-group br0 \
> +  'group_id=1,type=select,bucket=bucket_id:0,weight:10,actions=output:p1'])
> +
> +AT_CHECK([ovs-ofctl -O OpenFlow15 add-flow br0 \
> +  
> 'in_port=p1,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,actions=group:1'])
> +
> +AT_CHECK([ovs-appctl ofproto/trace br0 \
> +  
> in_port=p1,tcp,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.2.0.2,nw_dst=10.2.0.3
>  | grep -e '->'], [0], [dnl
> +     -> selection method in use: dp_hash, recirculating
> +])
> +
> +AT_CHECK([ovs-ofctl -O OpenFlow15 add-group br0 \
> +  'group_id=2,type=select,selection_method=dp_hash'])
> +
> +AT_CHECK([ovs-ofctl -O OpenFlow15 add-flow br0 \
> +  
> 'in_port=p2,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,actions=group:2'])
> +
> +AT_CHECK([ovs-appctl ofproto/trace br0 \
> +  
> in_port=p2,tcp,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.2.0.2,nw_dst=10.2.0.3
>  | grep -e '->'], [0], [dnl

Thanks for the update!

I replaced the '-e' here with '--' as we don't really need to use extended
regular expressions, just need to make sure the argument is not treated as
a flag, which is what '--' is for.

With that, applied and backported down to 3.3.

Best regards, Ilya Maximets.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to