On 14/04/2017 04:01, Joe Stringer wrote:
On 7 April 2017 at 06:12, Roi Dayan <[email protected]> wrote:
From: Paul Blakey <[email protected]>
Signed-off-by: Paul Blakey <[email protected]>
Reviewed-by: Roi Dayan <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
---
<snip>
@@ -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 ## */
+/* ## -------------------------------- ## */
+
+/* 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. */
What is the error status? negative? positive? errno?
Common OVS descriptions say something like:
Returns ___, if successful. On failure, returns a negative errno value.
+ 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);
How does this function expect 'rbuffer' and 'wbuffer' to be prepared?
Are they already allocated? Will this function reallocate them? Who
frees them?
What does this function return?
I think that the equivalent dpif interface describes that the
parameters to flow_dump_next() must be prepared by flow_dump_create().
+
+ /* 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);
Really, it sets the stats? Does it ever retrieve stats (for example,
if you modify the flow)?
that's a mistake. stats not even being used in flow_put and can be removed.
What does it return?
+ /* 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 *, const ovs_u128 *ufid,
+ struct dpif_flow_stats *);
+ /* Initializies the netdev flow api. */
+ int (*init_flow_api)(struct netdev *);
};
Hopefully you're getting a sense for the set of questions I'm asking
around how you describe this API, and can apply that feedback to the
rest of these as well.
Thanks Joe, we'll update the documentation of the api.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev