Skip to content

Commit

Permalink
netdev-offload: Introduce a function to validate same flow api handle.
Browse files Browse the repository at this point in the history
Signed-off-by: Eli Britstein <elibr@mellanox.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
  • Loading branch information
Eli Britstein authored and igsilya committed Jan 16, 2020
1 parent 2f7f928 commit 65c73b3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/netdev-offload-provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 12 additions & 0 deletions lib/netdev-offload.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 65c73b3

Please sign in to comment.