[ovs-dev] [ovs-dev 4/7] netdev-offload-provider: Add meter offload struct
xiangxia.m.yue at gmail.com
xiangxia.m.yue at gmail.com
Sat Dec 28 07:11:13 UTC 2019
From: Tonghao Zhang <xiangxia.m.yue at gmail.com>
Introduce the meter offload struct and dp_meter use it.
Signed-off-by: Tonghao Zhang <xiangxia.m.yue at gmail.com>
---
lib/dpif-netdev.h | 2 ++
lib/netdev-offload-provider.h | 10 ++++++++++
2 files changed, 12 insertions(+)
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);
--
1.8.3.1
More information about the dev
mailing list