diff mbox series

[ovs-dev,ovs-dev,4/7] netdev-offload-provider: Add meter offload struct

Message ID 1577517076-105041-5-git-send-email-xiangxia.m.yue@gmail.com
State Changes Requested
Headers show
Series Support meter action offload | expand

Commit Message

Tonghao Zhang Dec. 28, 2019, 7:11 a.m. UTC
From: Tonghao Zhang <xiangxia.m.yue@gmail.com>

Introduce the meter offload struct and dp_meter use it.

Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
---
 lib/dpif-netdev.h             |  2 ++
 lib/netdev-offload-provider.h | 10 ++++++++++
 2 files changed, 12 insertions(+)
diff mbox series

Patch

diff --git a/lib/dpif-netdev.h b/lib/dpif-netdev.h
index b5f5c12..123cf99 100644
--- a/lib/dpif-netdev.h
+++ b/lib/dpif-netdev.h
@@ -21,6 +21,7 @@ 
 #include <stddef.h>
 #include <stdint.h>
 #include "dpif.h"
+#include "netdev-offload-provider.h"
 #include "openvswitch/types.h"
 #include "dp-packet.h"
 #include "packets.h"
@@ -47,6 +48,7 @@  struct dp_meter {
     uint64_t used;
     uint64_t packet_count;
     uint64_t byte_count;
+    struct netdev_offload_meter *offload;
     struct dp_meter_band bands[];
 };
 
diff --git a/lib/netdev-offload-provider.h b/lib/netdev-offload-provider.h
index d0d3fb2..fb33309 100644
--- a/lib/netdev-offload-provider.h
+++ b/lib/netdev-offload-provider.h
@@ -88,6 +88,16 @@  struct netdev_flow_api {
     int (*init_flow_api)(struct netdev *);
 };
 
+struct netdev_offload_meter_api {
+    void (*meter_destroy)(void *);
+    void (*meter_update)(void *, void *);
+};
+
+struct netdev_offload_meter {
+    void *priv_data;
+    struct netdev_offload_meter_api *meter_ops;
+};
+
 int netdev_register_flow_api_provider(const struct netdev_flow_api *);
 int netdev_unregister_flow_api_provider(const char *type);