diff mbox series

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

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

Commit Message

Chris Mi Jan. 27, 2021, 6: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 717a987d1..2b08ea55e 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;
@@ -2003,6 +2005,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)
 {
@@ -2063,5 +2071,6 @@  const struct netdev_flow_api netdev_offload_tc = {
    .flow_get = netdev_tc_flow_get,
    .flow_del = netdev_tc_flow_del,
    .flow_get_n_flows = netdev_tc_get_n_flows,
+   .register_nl_sflow_upcall_cb = netdev_tc_register_sflow_upcall_cb,
    .init_flow_api = netdev_tc_init_flow_api,
 };