Regards
_Sugesh


> -----Original Message-----
> From: Roi Dayan [mailto:[email protected]]
> Sent: Wednesday, February 8, 2017 3:30 PM
> To: [email protected]
> Cc: Paul Blakey <[email protected]>; Or Gerlitz
> <[email protected]>; Hadar Hen Zion <[email protected]>; Shahar
> Klein <[email protected]>; Mark Bloch <[email protected]>; Rony
> Efraim <[email protected]>; Fastabend, John R
> <[email protected]>; Joe Stringer <[email protected]>; Andy
> Gospodarek <[email protected]>; Lance Richardson
> <[email protected]>; Marcelo Ricardo Leitner <[email protected]>;
> Simon Horman <[email protected]>; Jiri Pirko
> <[email protected]>; Chandran, Sugesh <[email protected]>
> Subject: [PATCH ovs V3 17/25] dpif-netlink: Use netdev flow get api to query
> a flow
> 
> From: Paul Blakey <[email protected]>
> 
> Search all datapath added netdevs for a given flow using netdev flow api and
> parse it back to dpif flow.
> 
> Signed-off-by: Paul Blakey <[email protected]>
> Reviewed-by: Roi Dayan <[email protected]>
> ---
>  lib/dpif-netlink.c | 11 ++++++++++-
>  lib/netdev.c       | 16 ++++++++++++++++
>  2 files changed, 26 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/dpif-netlink.c b/lib/dpif-netlink.c index b5f5694..a9eb25f
> 100644
> --- a/lib/dpif-netlink.c
> +++ b/lib/dpif-netlink.c
> @@ -2097,7 +2097,16 @@ try_send_to_netdev(struct dpif_netlink *dpif,
> struct dpif_op *op)
>          return netdev_ports_flow_del(DPIF_HMAP_KEY(&dpif->dpif), del-
> >ufid,
>                                       del->stats);
>      }
> -    case DPIF_OP_FLOW_GET:
> +    case DPIF_OP_FLOW_GET: {
> +        struct dpif_flow_get *get = &op->u.flow_get;
> +
> +        if (!op->u.flow_get.ufid) {
> +            break;
> +        }
> +        dbg_print_flow(get->key, get->key_len, NULL, 0, NULL, 0,
> +                       get->ufid, "GET");
> +        return parse_flow_get(dpif, get);
> +    }
>      case DPIF_OP_EXECUTE:
>      default:
>          break;
> diff --git a/lib/netdev.c b/lib/netdev.c index c6a4582..fd77d55 100644
> --- a/lib/netdev.c
> +++ b/lib/netdev.c
> @@ -2284,6 +2284,22 @@ netdev_ports_flow_del(const void *obj, const
> ovs_u128 *ufid,
>      return ENOENT;
>  }
> 
> +int
> +netdev_ports_flow_get(const void *obj, struct match *match,
> +                      struct nlattr **actions, struct dpif_flow_stats *stats,
> +                      const ovs_u128 *ufid, struct ofpbuf *buf) {
> +    struct port_to_netdev_data *data;
> +
[Sugesh] Same comment here, I feel its good to keep track of installed flow as 
well with the netdev. 
> +    HMAP_FOR_EACH(data, node, &port_to_netdev) {
> +        if (data->obj == obj && !netdev_flow_get(data->netdev, match,
> actions,
> +                                                 stats, ufid, buf)) {
> +            return 0;
> +        }
> +    }
> +    return ENOENT;
> +}
> +
>  bool netdev_flow_api_enabled = false;
> 
>  void
> --
> 2.7.4

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

Reply via email to