[ovs-dev] [PATCH ovs V3 03/25] netdev: Adding a new netdev api to be used for offloading flows
Chandran, Sugesh
sugesh.chandran at intel.com
Mon Feb 13 23:53:01 UTC 2017
Regards
_Sugesh
> -----Original Message-----
> From: Roi Dayan [mailto:roid at mellanox.com]
> Sent: Wednesday, February 8, 2017 3:29 PM
> To: dev at openvswitch.org
> Cc: Paul Blakey <paulb at mellanox.com>; Or Gerlitz
> <ogerlitz at mellanox.com>; Hadar Hen Zion <hadarh at mellanox.com>; Shahar
> Klein <shahark at mellanox.com>; Mark Bloch <markb at mellanox.com>; Rony
> Efraim <ronye at mellanox.com>; Fastabend, John R
> <john.r.fastabend at intel.com>; Joe Stringer <joe at ovn.org>; Andy
> Gospodarek <andy at greyhouse.net>; Lance Richardson
> <lrichard at redhat.com>; Marcelo Ricardo Leitner <mleitner at redhat.com>;
> Simon Horman <simon.horman at netronome.com>; Jiri Pirko
> <jiri at mellanox.com>; Chandran, Sugesh <sugesh.chandran at intel.com>
> Subject: [PATCH ovs V3 03/25] netdev: Adding a new netdev api to be used
> for offloading flows
>
> From: Paul Blakey <paulb at mellanox.com>
>
.....
> +
> /* Network device class structure, to be defined by each implementation of
> a
> * network device.
> *
> @@ -769,6 +777,49 @@ struct netdev_class {
>
> /* Discards all packets waiting to be received from 'rx'. */
> int (*rxq_drain)(struct netdev_rxq *rx);
> +
> +/* ## -------------------------------- ## */
> +/* ## netdev flow offloading functions ## */
> +/* ## -------------------------------- ## */
[Sugesh] The netdev offload api are good to call out offload APIs. Something like hw_offload_flow_flush or offload_flow_flush. Thoughts??
> +
> +/* If a particular netdev class does not support offloading flows, all
> +these
> + * function pointers must be NULL. */
> +
> + /* Deleting all offloaded flows from netdev */
> + int (*flow_flush)(struct netdev *);
> + /* Dumping interface:
> + * Usage is as with dpif_port_dump api (create, next, destory).
> + * Create sets dump on success or returns error status on failure. */
> + int (*flow_dump_create)(struct netdev *, struct netdev_flow_dump
> **dump);
> + int (*flow_dump_destroy)(struct netdev_flow_dump *);
> + /* rbuffer is for use of the implementation (e.g using nl_dump),
> + * and is usually shared for the given thread that runs flow_dump_next.
> + * wbuffer is the buffer that dumped actions will be stored in, and given
> + * pointers to. */
> + 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);
> +
> + /* Offload the given flow (match, actions, stats, ufid) on netdev.
> + * If stats isn't null, sets the given stats for that flow.
> + * To modify the flow, use the same ufid.
> + * actions are in netlink format, as with struct dpif_flow_put.
> + * info is anything else that is need to offload the flow. */
> + int (*flow_put)(struct netdev *, struct match *, struct nlattr *actions,
> + size_t actions_len, struct dpif_flow_stats *,
> + const ovs_u128 *ufid, struct offload_info *info);
> + /* Queries the flow with specified ufid on netdev.
> + * Fills match, actions, stats as with flow_dump_next */
> + int (*flow_get)(struct netdev *, struct match *, struct nlattr **actions,
> + struct dpif_flow_stats *, const ovs_u128 *ufid,
> + struct ofpbuf *);
> + /* Deletes the given flow specified by ufid from netdev.
> + * If stats is not null, fills it with flow stats. */
> + int (*flow_del)(struct netdev *, struct dpif_flow_stats *,
> + const ovs_u128 *ufid);
> + /* Initializies the netdev flow api. */
> + int (*init_flow_api)(struct netdev *);
> };
>
.....
> 2.7.4
More information about the dev
mailing list