diff mbox series

[ovs-dev,v5,06/12] netdev-offload-tc: Implement register sFlow upcall callback API

Message ID 20201029112340.14167-7-cmi@nvidia.com
State New
Headers show
Series Add offload support for sFlow | expand

Commit Message

Chris Mi Oct. 29, 2020, 11:23 a.m. UTC
Save the upcall callback as a pre-step towards offloading sample
action to TC.

Signed-off-by: Chris Mi <cmi@nvidia.com>
Reviewed-by: Eli Britstein <elibr@nvidia.com>
---
 lib/netdev-offload-tc.c | 9 +++++++++
 1 file changed, 9 insertions(+)
diff mbox series

Patch

diff --git a/lib/netdev-offload-tc.c b/lib/netdev-offload-tc.c
index e828a8683..8299e6a8a 100644
--- a/lib/netdev-offload-tc.c
+++ b/lib/netdev-offload-tc.c
@@ -49,6 +49,8 @@  static struct hmap tc_to_ufid = HMAP_INITIALIZER(&tc_to_ufid);
 static bool multi_mask_per_prio = false;
 static bool block_support = false;
 
+static dpif_netlink_sflow_upcall_callback *upcall_cb;
+
 struct netlink_field {
     int offset;
     int flower_offset;
@@ -1985,6 +1987,12 @@  probe_tc_block_support(int ifindex)
     }
 }
 
+static void
+netdev_tc_register_sflow_upcall_cb(dpif_netlink_sflow_upcall_callback *cb)
+{
+    upcall_cb = cb;
+}
+
 static int
 netdev_tc_init_flow_api(struct netdev *netdev)
 {
@@ -2048,5 +2056,6 @@  const struct netdev_flow_api netdev_offload_tc = {
    .flow_put = netdev_tc_flow_put,
    .flow_get = netdev_tc_flow_get,
    .flow_del = netdev_tc_flow_del,
+   .register_nl_sflow_upcall_cb = netdev_tc_register_sflow_upcall_cb,
    .init_flow_api = netdev_tc_init_flow_api,
 };