On 7/12/24 15:47, Dumitru Ceara wrote:
> It improves the debugging experience if we can easily get a list of
> OpenFlow rules and groups that contribute to the creation of a datapath
> flow.
> 
> The suggested workflow is:
> a. dump datapath flows (along with UUIDs), this also prints the core IDs
> (PMD IDs) when applicable.
> 
>   $ ovs-appctl dpctl/dump-flows -m
>   flow-dump from pmd on cpu core: 7
>   ufid:7460db8f..., recirc_id(0), ....
> 
> b. dump related OpenFlow rules and groups:
>   $ ovs-appctl ofproto/detrace ufid:7460db8f... pmd=7
>   cookie=0x12345678, table=0 
> priority=100,ip,in_port=2,nw_dst=10.0.0.2,actions=resubmit(,1)
>   cookie=0x0, table=1 priority=200,actions=group:1
>   group_id=1,bucket=bucket_id:0,actions=ct(commit,table=2,nat(dst=20.0.0.2))
>   cookie=0x0, table=2 actions=output:1
> 
> The new command only shows rules and groups attached to ukeys that are
> in states UKEY_VISIBLE or UKEY_OPERATIONAL.  That should be fine as all
> other ukeys should not be relevant for the use case presented above.
> 
> This commit tries to mimic the output format of the ovs-ofctl
> dump-flows/dump-groups commands.
> 
> Signed-off-by: Dumitru Ceara <[email protected]>
> ---
> V6:
> - Removed group_dpif_format().
> - Cleaned up test.
> V5:
> - Addressed Ilya's comments:
>   - I addressed all from here
>     https://mail.openvswitch.org/pipermail/ovs-dev/2024-June/415144.html
>     except the one about adding -m/-mm.  It felt OK to always dump
>     statistics.
> V4:
> - Addressed Mike's comment:
>   - use predictable port IDs.
> V3:
> - Addressed Mike's comments:
>   - use ds_put_char()
>   - make the test less flaky
> V2:
> - Addressed Adrian's comments:
>   - check return value of populate_xcache()
>   - use flow_stats_ds() (renamed to ofproto_rule_stats_ds()) instead of
>     custom printing
>   - move ukey->state check to caller
>   - handle case when group bucket is not available
>   - update test case to cover the point above
> ---
>  NEWS                               |   2 +
>  include/openvswitch/ofp-group.h    |  14 +++
>  lib/ofp-group.c                    | 131 +++++++++++++++++------------
>  ofproto/ofproto-dpif-upcall.c      |  51 +++++++++++
>  ofproto/ofproto-dpif-xlate-cache.c |  34 ++++++++
>  ofproto/ofproto-dpif-xlate-cache.h |   2 +
>  ofproto/ofproto-provider.h         |   2 +
>  ofproto/ofproto.c                  |  11 +--
>  tests/ofproto-dpif.at              |  56 ++++++++++++
>  tests/ofproto-macros.at            |  14 ++-
>  10 files changed, 257 insertions(+), 60 deletions(-)

Thanks, Dumitru!  Applied.

Best regards, Ilya Maximets.

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to