net: sched: push cls related args into cls_common structure

As ndo_setup_tc is generic offload op for whole tc subsystem, does not
really make sense to have cls-specific args. So move them under
cls_common structurure which is embedded in all cls structs.

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>
This commit is contained in:
Jiri Pirko
2017-08-07 10:15:29 +02:00
committed by David S. Miller
parent 74897ef0a5
commit 5fd9fc4e20
39 changed files with 101 additions and 144 deletions

View File

@@ -232,14 +232,14 @@ static void fl_hw_destroy_filter(struct tcf_proto *tp, struct cls_fl_filter *f)
if (!tc_can_offload(dev, tp))
return;
tc_cls_common_offload_init(&offload.common, tp);
offload.command = TC_CLSFLOWER_DESTROY;
offload.prio = tp->prio;
offload.cookie = (unsigned long)f;
tc->cls_flower = &offload;
dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_CLSFLOWER, tp->q->handle,
tp->chain->index, tp->protocol, tc);
dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_CLSFLOWER, tc);
}
static int fl_hw_replace_filter(struct tcf_proto *tp,
@@ -264,6 +264,7 @@ static int fl_hw_replace_filter(struct tcf_proto *tp,
f->hw_dev = dev;
}
tc_cls_common_offload_init(&offload.common, tp);
offload.command = TC_CLSFLOWER_REPLACE;
offload.prio = tp->prio;
offload.cookie = (unsigned long)f;
@@ -274,9 +275,7 @@ static int fl_hw_replace_filter(struct tcf_proto *tp,
tc->cls_flower = &offload;
err = dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_CLSFLOWER,
tp->q->handle, tp->chain->index,
tp->protocol, tc);
err = dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_CLSFLOWER, tc);
if (!err)
f->flags |= TCA_CLS_FLAGS_IN_HW;
@@ -294,6 +293,7 @@ static void fl_hw_update_stats(struct tcf_proto *tp, struct cls_fl_filter *f)
if (!tc_can_offload(dev, tp))
return;
tc_cls_common_offload_init(&offload.common, tp);
offload.command = TC_CLSFLOWER_STATS;
offload.prio = tp->prio;
offload.cookie = (unsigned long)f;
@@ -301,8 +301,7 @@ static void fl_hw_update_stats(struct tcf_proto *tp, struct cls_fl_filter *f)
tc->cls_flower = &offload;
dev->netdev_ops->ndo_setup_tc(dev, TC_CLSFLOWER_STATS, tp->q->handle,
tp->chain->index, tp->protocol, tc);
dev->netdev_ops->ndo_setup_tc(dev, TC_CLSFLOWER_STATS, tc);
}
static void __fl_delete(struct tcf_proto *tp, struct cls_fl_filter *f)