On Tue, Aug 29, 2017 at 08:21:20AM +0000, Darrell Ball wrote:
> On 8/22/17, 11:24 PM, "Yuanhan Liu" <y...@fridaylinux.org> wrote:
>     
>         Inovke netdev class '->flow_del' method on flow deletion. The dpdk 
> netdev
>         implementation will then remove the rte flow associated with the ufid.
>         
>         Signed-off-by: Yuanhan Liu <y...@fridaylinux.org>
>         Signed-off-by: Finn Christensen <f...@napatech.com>
>         ---
>          lib/dpif-netdev.c |  5 +++++
>          lib/netdev-dpdk.c | 17 ++++++++++++++++-
>          2 files changed, 21 insertions(+), 1 deletion(-)
>         
>         diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
>         index b5f157e..1957789 100644
>         --- a/lib/dpif-netdev.c
>         +++ b/lib/dpif-netdev.c
>         @@ -1783,6 +1783,10 @@ dp_netdev_pmd_remove_flow(struct 
> dp_netdev_pmd_thread *pmd,
>              dpcls_remove(cls, &flow->cr);
>              cmap_remove(&pmd->flow_table, node, 
> dp_netdev_flow_hash(&flow->ufid));
>              if (flow->has_mark) {
>         +        struct dp_netdev_port *port;
>         +
>         +        port = dp_netdev_lookup_port(pmd->dp, in_port);
> 
> check for NULL ?

Will do.

> 
>         +        netdev_flow_del(port->netdev, &flow->ufid, NULL);
>                  cmap_remove(&pmd->mark_to_flow, mark_node, flow->mark);
>                  flow->has_mark = false;
>              }
>         @@ -2681,6 +2685,7 @@ flow_del_on_pmd(struct dp_netdev_pmd_thread 
> *pmd,
>                  if (stats) {
>                      get_dpif_flow_stats(netdev_flow, stats);
>                  }
>         +
>                  dp_netdev_pmd_remove_flow(pmd, netdev_flow);
>              } else {
>                  error = ENOENT;
>         diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
>         index 230d506..8217184 100644
>         --- a/lib/netdev-dpdk.c
>         +++ b/lib/netdev-dpdk.c
>         @@ -3790,6 +3790,21 @@ netdev_dpdk_flow_put(struct netdev *netdev, 
> struct match *match,
>                                                      actions_len, ufid, info);
>          }
>          
>         +static int
>         +netdev_dpdk_flow_del(struct netdev *netdev, const ovs_u128 *ufid,
>         +                     struct dpif_flow_stats *stats OVS_UNUSED)
>         +{
>         +
>         +    struct rte_flow *rte_flow = get_rte_flow_by_ufid(ufid);
>         +
>         +    if (!rte_flow) {
>         +        return -1;
>         +    }
> 
> error vlog ?
> 

Will do.

        --yliu
> 
>         +
>         +    return netdev_dpdk_destroy_rte_flow(netdev_dpdk_cast(netdev),
>         +                                        ufid, rte_flow);
>         +}
>         +
>          #define DPDK_FLOW_OFFLOAD_API                                 \
>              NULL,                                                     \
>              NULL,                                                     \
>         @@ -3797,7 +3812,7 @@ netdev_dpdk_flow_put(struct netdev *netdev, 
> struct match *match,
>              NULL,                                                     \
>              netdev_dpdk_flow_put,                                     \
>              NULL,                                                     \
>         -    NULL,                                                     \
>         +    netdev_dpdk_flow_del,                                     \
>              NULL
>          
>          
>         -- 
>         2.7.4
>         
>         
>     
>     
> 
> _______________________________________________
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to