On 09.01.2020 08:46, Eli Britstein wrote:
> From: Ophir Munk <[email protected]>
> 
> In case a flow is HW offloaded, packets do not reach the SW, thus not
> counted for statistics. Use netdev flow get API in order to update the
> statistics of flows by the HW statistics.
> 
> Co-authored-by: Eli Britstein <[email protected]>
> Signed-off-by: Ophir Munk <[email protected]>
> Reviewed-by: Oz Shlomo <[email protected]>
> Signed-off-by: Eli Britstein <[email protected]>
> ---
>  lib/dpif-netdev.c | 79 
> ++++++++++++++++++++++++++++++++++++++++++++++---------
>  1 file changed, 66 insertions(+), 13 deletions(-)
> 
> diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
> index 24218210d..7ec217f39 100644
> --- a/lib/dpif-netdev.c
> +++ b/lib/dpif-netdev.c
> @@ -3030,10 +3030,49 @@ dp_netdev_pmd_find_flow(const struct 
> dp_netdev_pmd_thread *pmd,
>      return NULL;
>  }
>  
> +static bool
> +dpif_netdev_get_flow_offload_status(const struct dp_netdev *dp,
> +                                    const struct dp_netdev_flow *netdev_flow,
> +                                    struct dpif_flow_stats *stats,
> +                                    struct dpif_flow_attrs *attrs)
> +{
> +    struct nlattr *actions;
> +    struct ofpbuf wbuffer;
> +    struct netdev *netdev;
> +    struct match match;
> +
> +    int ret = 0;
> +
> +    if (!netdev_is_flow_api_enabled()) {
> +        return false;
> +    }
> +
> +    netdev = netdev_ports_get(netdev_flow->flow.in_port.odp_port, dp->class);
> +    if (!netdev) {
> +        return false;
> +    }
> +    /* Taking a global 'port_mutex' to fulfill thread safety
> +     * restrictions for the netdev-offload-dpdk module. */
> +    ovs_mutex_lock(&dp->port_mutex);

Found a bug with taking a mutex here.
Please, take a look at the fix: https://patchwork.ozlabs.org/patch/1223746/

Ian, I'd like to here your opinion on the fix too, if possible.

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

Reply via email to