]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - net/sched/cls_u32.c
Merge tag 'intel-pinctrl-fixes-v5.4-2' of git://git.kernel.org/pub/scm/linux/kernel...
[linux.git] / net / sched / cls_u32.c
index 8614088edd1be0cad1a9755ce11fac94304a65f0..a0e6fac613de215bd2ca588624e2f3edda7c19ff 100644 (file)
@@ -480,7 +480,7 @@ static void u32_clear_hw_hnode(struct tcf_proto *tp, struct tc_u_hnode *h,
        cls_u32.hnode.handle = h->handle;
        cls_u32.hnode.prio = h->prio;
 
-       tc_setup_cb_call(block, TC_SETUP_CLSU32, &cls_u32, false);
+       tc_setup_cb_call(block, TC_SETUP_CLSU32, &cls_u32, false, true);
 }
 
 static int u32_replace_hw_hnode(struct tcf_proto *tp, struct tc_u_hnode *h,
@@ -498,7 +498,7 @@ static int u32_replace_hw_hnode(struct tcf_proto *tp, struct tc_u_hnode *h,
        cls_u32.hnode.handle = h->handle;
        cls_u32.hnode.prio = h->prio;
 
-       err = tc_setup_cb_call(block, TC_SETUP_CLSU32, &cls_u32, skip_sw);
+       err = tc_setup_cb_call(block, TC_SETUP_CLSU32, &cls_u32, skip_sw, true);
        if (err < 0) {
                u32_clear_hw_hnode(tp, h, NULL);
                return err;
@@ -522,8 +522,8 @@ static void u32_remove_hw_knode(struct tcf_proto *tp, struct tc_u_knode *n,
        cls_u32.command = TC_CLSU32_DELETE_KNODE;
        cls_u32.knode.handle = n->handle;
 
-       tc_setup_cb_call(block, TC_SETUP_CLSU32, &cls_u32, false);
-       tcf_block_offload_dec(block, &n->flags);
+       tc_setup_cb_destroy(block, tp, TC_SETUP_CLSU32, &cls_u32, false,
+                           &n->flags, &n->in_hw_count, true);
 }
 
 static int u32_replace_hw_knode(struct tcf_proto *tp, struct tc_u_knode *n,
@@ -552,13 +552,11 @@ static int u32_replace_hw_knode(struct tcf_proto *tp, struct tc_u_knode *n,
        if (n->ht_down)
                cls_u32.knode.link_handle = ht->handle;
 
-       err = tc_setup_cb_call(block, TC_SETUP_CLSU32, &cls_u32, skip_sw);
-       if (err < 0) {
+       err = tc_setup_cb_add(block, tp, TC_SETUP_CLSU32, &cls_u32, skip_sw,
+                             &n->flags, &n->in_hw_count, true);
+       if (err) {
                u32_remove_hw_knode(tp, n, NULL);
                return err;
-       } else if (err > 0) {
-               n->in_hw_count = err;
-               tcf_block_offload_inc(block, &n->flags);
        }
 
        if (skip_sw && !(n->flags & TCA_CLS_FLAGS_IN_HW))
@@ -1201,14 +1199,11 @@ static int u32_reoffload_knode(struct tcf_proto *tp, struct tc_u_knode *n,
                        cls_u32.knode.link_handle = ht->handle;
        }
 
-       err = cb(TC_SETUP_CLSU32, &cls_u32, cb_priv);
-       if (err) {
-               if (add && tc_skip_sw(n->flags))
-                       return err;
-               return 0;
-       }
-
-       tc_cls_offload_cnt_update(block, &n->in_hw_count, &n->flags, add);
+       err = tc_setup_cb_reoffload(block, tp, add, cb, TC_SETUP_CLSU32,
+                                   &cls_u32, cb_priv, &n->flags,
+                                   &n->in_hw_count);
+       if (err)
+               return err;
 
        return 0;
 }