On 12/17/20 3:47 AM, Jianbo Liu wrote:
> The n_offloaded_flows counter is saved in dpif, and this is the first
> one when ofproto is created. When flow operation is done by ovs-appctl
> commands, such as, dpctl/add-flow, a new dpif is opened, and the
> n_offloaded_flows in it can't be used. So, instead of using counter,
> the number of offloaded flows is queried from each netdev, then sum
> them up. To achieve this, a new API is added in netdev_flow_api to get
> how many flows assigned to a netdev.
> 
> In order to get better performance, this number is calculated directly
> from tc_to_ufid hmap for netdev-offload-tc, because flow dumping by tc
> takes much time if there are many flows offloaded.
> 
> Fixes: af0618470507 ("dpif-netlink: Count the number of offloaded rules")
> Signed-off-by: Jianbo Liu <[email protected]>
> ---
>  lib/dpif-netlink.c               |  9 ---------
>  lib/dpif.c                       | 23 +++++++++++++++++++++++
>  lib/dpif.h                       |  3 ++-
>  lib/netdev-offload-provider.h    |  4 ++++
>  lib/netdev-offload-tc.c          | 19 +++++++++++++++++++
>  lib/netdev-offload.c             | 27 +++++++++++++++++++++++++++
>  lib/netdev-offload.h             |  3 +++
>  ofproto/ofproto-dpif-upcall.c    | 11 +++++------
>  tests/system-offloads-traffic.at |  4 ++++
>  9 files changed, 87 insertions(+), 16 deletions(-)
> 

Thanks!

I fixed the indentation in netdev_tc_get_n_flows() and applied to master.

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

Reply via email to