[ovs-dev] [PATCH ovs V2 02/21] netdev: Adding a new netdev api to be used for offloading flows

Joe Stringer joe at ovn.org
Thu Jan 5 01:02:03 UTC 2017


On 25 December 2016 at 03:39, Paul Blakey <paulb at mellanox.com> wrote:
> Signed-off-by: Paul Blakey <paulb at mellanox.com>
> Reviewed-by: Roi Dayan <roid at mellanox.com>
> ---

<snip>

> @@ -764,6 +772,27 @@ struct netdev_class {
>
>      /* Discards all packets waiting to be received from 'rx'. */
>      int (*rxq_drain)(struct netdev_rxq *rx);
> +
> +/* ## -------------------------------- ## */
> +/* ## netdev flow offloading functions ## */
> +/* ## -------------------------------- ## */
> +
> +/* If a particular netdev class does not support offloading flows, all these
> + * function pointers must be NULL. */
> +
> +    int (*flow_flush)(struct netdev *);
> +    struct netdev_flow_dump *(*flow_dump_create)(struct netdev *);
> +    int (*flow_dump_destroy)(struct netdev_flow_dump *);
> +    bool (*flow_dump_next)(struct netdev_flow_dump *, struct match *,
> +                           struct nlattr **actions,
> +                           struct dpif_flow_stats *stats, ovs_u128 *ufid,
> +                           struct ofpbuf *rbuffer, struct ofpbuf *wbuffer);
> +    int (*flow_put)(struct netdev *, struct match *, struct nlattr *actions,
> +                    size_t actions_len, struct dpif_flow_stats *, ovs_u128 *);
> +    int (*flow_get)(struct netdev *, struct match *, struct nlattr **actions,
> +                    struct dpif_flow_stats *, ovs_u128 *, struct ofpbuf *);
> +    int (*flow_del)(struct netdev *, struct dpif_flow_stats *, ovs_u128 *);
> +    int (*init_flow_api)(struct netdev *);
>  };

Please add comments to describe the constraints on these APIs. Thread
safety. Ordering. etc. See some of the other examples in this file and
dpif-provider.h.

<snip>

> +int
> +netdev_tc_init_flow_api(struct netdev *netdev OVS_UNUSED)
> +{
> +    return 0;
> +}

This function seems pointless. If it's needed later, we can always add
it at that time.


More information about the dev mailing list