On 14/02/2017 01:53, Chandran, Sugesh wrote:


Regards
_Sugesh


-----Original Message-----
From: Roi Dayan [mailto:[email protected]]
Sent: Wednesday, February 8, 2017 3:29 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 03/25] netdev: Adding a new netdev api to be used
for offloading flows

From: Paul Blakey <[email protected]>

.....

+
 /* 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??

to make sure I understand. are you suggesting here to add prefix for offload related 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. */
+    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

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

Reply via email to