summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEli Britstein <elibr@mellanox.com>2020-01-09 07:46:50 +0000
committerIlya Maximets <i.maximets@ovn.org>2020-01-16 13:34:10 +0100
commit65c73b3f8c2833d4693cca9cf7058a72cb6e6f66 (patch)
treeefe47ce59136f828efd29e637a2ced22e52db6a4 /lib
parent2f7f9284bd648b4d1e429a85fd803796d4238808 (diff)
downloadopenvswitch-65c73b3f8c2833d4693cca9cf7058a72cb6e6f66.tar.gz
netdev-offload: Introduce a function to validate same flow api handle.
Signed-off-by: Eli Britstein <elibr@mellanox.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/netdev-offload-provider.h1
-rw-r--r--lib/netdev-offload.c12
2 files changed, 13 insertions, 0 deletions
diff --git a/lib/netdev-offload-provider.h b/lib/netdev-offload-provider.h
index 4e1c4251d..5a809c0cd 100644
--- a/lib/netdev-offload-provider.h
+++ b/lib/netdev-offload-provider.h
@@ -89,6 +89,7 @@ struct netdev_flow_api {
int netdev_register_flow_api_provider(const struct netdev_flow_api *);
int netdev_unregister_flow_api_provider(const char *type);
+bool netdev_flow_api_equals(const struct netdev *, const struct netdev *);
#ifdef __linux__
extern const struct netdev_flow_api netdev_offload_tc;
diff --git a/lib/netdev-offload.c b/lib/netdev-offload.c
index ae01acda6..32eab5910 100644
--- a/lib/netdev-offload.c
+++ b/lib/netdev-offload.c
@@ -156,6 +156,18 @@ netdev_unregister_flow_api_provider(const char *type)
return error;
}
+bool
+netdev_flow_api_equals(const struct netdev *netdev1,
+ const struct netdev *netdev2)
+{
+ const struct netdev_flow_api *netdev_flow_api1 =
+ ovsrcu_get(const struct netdev_flow_api *, &netdev1->flow_api);
+ const struct netdev_flow_api *netdev_flow_api2 =
+ ovsrcu_get(const struct netdev_flow_api *, &netdev2->flow_api);
+
+ return netdev_flow_api1 == netdev_flow_api2;
+}
+
static int
netdev_assign_flow_api(struct netdev *netdev)
{