2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

netdev: Adding a new netdev API to be used for offloading flows

Add a new API interface for offloading dpif flows to netdev.
The API consist on the following:
  flow_put - offload a new flow
  flow_get - query an offloaded flow
  flow_del - delete an offloaded flow
  flow_flush - flush all offloaded flows
  flow_dump_* - dump all offloaded flows

In upcoming commits we will introduce an implementation of this
API for netdev-linux.

Signed-off-by: Paul Blakey <paulb@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
This commit is contained in:
Paul Blakey
2017-06-13 18:03:28 +03:00
committed by Simon Horman
parent f98e418fbd
commit 18ebd48cfb
12 changed files with 379 additions and 5 deletions

View File

@@ -54,6 +54,7 @@
#include "hash.h"
#include "openvswitch/hmap.h"
#include "netdev-provider.h"
#include "netdev-tc-offloads.h"
#include "netdev-vport.h"
#include "netlink-notifier.h"
#include "netlink-socket.h"
@@ -2796,7 +2797,8 @@ netdev_linux_update_flags(struct netdev *netdev_, enum netdev_flags off,
}
#define NETDEV_LINUX_CLASS(NAME, CONSTRUCT, GET_STATS, \
GET_FEATURES, GET_STATUS) \
GET_FEATURES, GET_STATUS, \
FLOW_OFFLOAD_API) \
{ \
NAME, \
false, /* is_pmd */ \
@@ -2865,6 +2867,8 @@ netdev_linux_update_flags(struct netdev *netdev_, enum netdev_flags off,
netdev_linux_rxq_recv, \
netdev_linux_rxq_wait, \
netdev_linux_rxq_drain, \
\
FLOW_OFFLOAD_API \
}
const struct netdev_class netdev_linux_class =
@@ -2873,7 +2877,8 @@ const struct netdev_class netdev_linux_class =
netdev_linux_construct,
netdev_linux_get_stats,
netdev_linux_get_features,
netdev_linux_get_status);
netdev_linux_get_status,
LINUX_FLOW_OFFLOAD_API);
const struct netdev_class netdev_tap_class =
NETDEV_LINUX_CLASS(
@@ -2881,7 +2886,8 @@ const struct netdev_class netdev_tap_class =
netdev_linux_construct_tap,
netdev_tap_get_stats,
netdev_linux_get_features,
netdev_linux_get_status);
netdev_linux_get_status,
NO_OFFLOAD_API);
const struct netdev_class netdev_internal_class =
NETDEV_LINUX_CLASS(
@@ -2889,7 +2895,8 @@ const struct netdev_class netdev_internal_class =
netdev_linux_construct,
netdev_internal_get_stats,
NULL, /* get_features */
netdev_internal_get_status);
netdev_internal_get_status,
NO_OFFLOAD_API);
#define CODEL_N_QUEUES 0x0000