aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/cls_u32.c
diff options
context:
space:
mode:
authorJiri Pirko <jiri@mellanox.com>2017-08-07 10:15:17 +0200
committerDavid S. Miller <davem@davemloft.net>2017-08-07 09:42:35 -0700
commit2572ac53c46f58e500b9d8d0f99785666038c590 (patch)
treead615f1fdda541358540a2d1dd5a385fc39332bc /net/sched/cls_u32.c
parentMerge branch 'sctp-remove-typedefs-from-structures-part-5' (diff)
downloadlinux-dev-2572ac53c46f58e500b9d8d0f99785666038c590.tar.xz
linux-dev-2572ac53c46f58e500b9d8d0f99785666038c590.zip
net: sched: make type an argument for ndo_setup_tc
Since the type is always present, push it to be a separate argument to ndo_setup_tc. On the way, name the type enum and use it for arg type. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/cls_u32.c')
-rw-r--r--net/sched/cls_u32.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c
index 9fd243799fe7..d1bae4cc749f 100644
--- a/net/sched/cls_u32.c
+++ b/net/sched/cls_u32.c
@@ -434,15 +434,14 @@ static void u32_remove_hw_knode(struct tcf_proto *tp, u32 handle)
struct tc_cls_u32_offload u32_offload = {0};
struct tc_to_netdev offload;
- offload.type = TC_SETUP_CLSU32;
offload.cls_u32 = &u32_offload;
if (tc_should_offload(dev, tp, 0)) {
offload.cls_u32->command = TC_CLSU32_DELETE_KNODE;
offload.cls_u32->knode.handle = handle;
- dev->netdev_ops->ndo_setup_tc(dev, tp->q->handle,
- tp->chain->index, tp->protocol,
- &offload);
+ dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_CLSU32,
+ tp->q->handle, tp->chain->index,
+ tp->protocol, &offload);
}
}
@@ -457,7 +456,6 @@ static int u32_replace_hw_hnode(struct tcf_proto *tp, struct tc_u_hnode *h,
if (!tc_should_offload(dev, tp, flags))
return tc_skip_sw(flags) ? -EINVAL : 0;
- offload.type = TC_SETUP_CLSU32;
offload.cls_u32 = &u32_offload;
offload.cls_u32->command = TC_CLSU32_NEW_HNODE;
@@ -465,7 +463,7 @@ static int u32_replace_hw_hnode(struct tcf_proto *tp, struct tc_u_hnode *h,
offload.cls_u32->hnode.handle = h->handle;
offload.cls_u32->hnode.prio = h->prio;
- err = dev->netdev_ops->ndo_setup_tc(dev, tp->q->handle,
+ err = dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_CLSU32, tp->q->handle,
tp->chain->index, tp->protocol,
&offload);
if (tc_skip_sw(flags))
@@ -480,7 +478,6 @@ static void u32_clear_hw_hnode(struct tcf_proto *tp, struct tc_u_hnode *h)
struct tc_cls_u32_offload u32_offload = {0};
struct tc_to_netdev offload;
- offload.type = TC_SETUP_CLSU32;
offload.cls_u32 = &u32_offload;
if (tc_should_offload(dev, tp, 0)) {
@@ -489,9 +486,9 @@ static void u32_clear_hw_hnode(struct tcf_proto *tp, struct tc_u_hnode *h)
offload.cls_u32->hnode.handle = h->handle;
offload.cls_u32->hnode.prio = h->prio;
- dev->netdev_ops->ndo_setup_tc(dev, tp->q->handle,
- tp->chain->index, tp->protocol,
- &offload);
+ dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_CLSU32,
+ tp->q->handle, tp->chain->index,
+ tp->protocol, &offload);
}
}
@@ -503,7 +500,6 @@ static int u32_replace_hw_knode(struct tcf_proto *tp, struct tc_u_knode *n,
struct tc_to_netdev offload;
int err;
- offload.type = TC_SETUP_CLSU32;
offload.cls_u32 = &u32_offload;
if (!tc_should_offload(dev, tp, flags))
@@ -524,7 +520,7 @@ static int u32_replace_hw_knode(struct tcf_proto *tp, struct tc_u_knode *n,
if (n->ht_down)
offload.cls_u32->knode.link_handle = n->ht_down->handle;
- err = dev->netdev_ops->ndo_setup_tc(dev, tp->q->handle,
+ err = dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_CLSU32, tp->q->handle,
tp->chain->index, tp->protocol,
&offload);