diff mbox series

[ovs-dev,v5,09/12] netdev-offload-tc: Remove redundant ovsthread once

Message ID 20201029112340.14167-10-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
Signed-off-by: Chris Mi <cmi@nvidia.com>
Reviewed-by: Eli Britstein <elibr@nvidia.com>
---
 lib/netdev-offload-tc.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/lib/netdev-offload-tc.c b/lib/netdev-offload-tc.c
index b475cc84e..a81003a98 100644
--- a/lib/netdev-offload-tc.c
+++ b/lib/netdev-offload-tc.c
@@ -2257,8 +2257,7 @@  netdev_tc_register_sflow_upcall_cb(dpif_netlink_sflow_upcall_callback *cb)
 static int
 netdev_tc_init_flow_api(struct netdev *netdev)
 {
-    static struct ovsthread_once multi_mask_once = OVSTHREAD_ONCE_INITIALIZER;
-    static struct ovsthread_once block_once = OVSTHREAD_ONCE_INITIALIZER;
+    static struct ovsthread_once once = OVSTHREAD_ONCE_INITIALIZER;
     enum tc_qdisc_hook hook = get_tc_qdisc_hook(netdev);
     uint32_t block_id = 0;
     struct tcf_id id;
@@ -2283,16 +2282,13 @@  netdev_tc_init_flow_api(struct netdev *netdev)
     /* make sure there is no ingress/egress qdisc */
     tc_add_del_qdisc(ifindex, false, 0, hook);
 
-    if (ovsthread_once_start(&block_once)) {
+    if (ovsthread_once_start(&once)) {
         probe_tc_block_support(ifindex);
         /* Need to re-fetch block id as it depends on feature availability. */
         block_id = get_block_id_from_netdev(netdev);
-        ovsthread_once_done(&block_once);
-    }
 
-    if (ovsthread_once_start(&multi_mask_once)) {
         probe_multi_mask_per_prio(ifindex);
-        ovsthread_once_done(&multi_mask_once);
+        ovsthread_once_done(&once);
     }
 
     error = tc_add_del_qdisc(ifindex, true, block_id, hook);