Skip to content

Commit

Permalink
net: sched: use tc_cls_bind_class() in filter
Browse files Browse the repository at this point in the history
Use tc_cls_bind_class() in filter.

Signed-off-by: Zhengchao Shao <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
zhengchaoshao authored and davem330 committed Oct 2, 2022
1 parent 402963e commit cc9039a
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 54 deletions.
7 changes: 1 addition & 6 deletions net/sched/cls_basic.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,12 +261,7 @@ static void basic_bind_class(void *fh, u32 classid, unsigned long cl, void *q,
{
struct basic_filter *f = fh;

if (f && f->res.classid == classid) {
if (cl)
__tcf_bind_filter(q, &f->res, base);
else
__tcf_unbind_filter(q, &f->res);
}
tc_cls_bind_class(classid, cl, q, &f->res, base);
}

static int basic_dump(struct net *net, struct tcf_proto *tp, void *fh,
Expand Down
7 changes: 1 addition & 6 deletions net/sched/cls_bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,12 +635,7 @@ static void cls_bpf_bind_class(void *fh, u32 classid, unsigned long cl,
{
struct cls_bpf_prog *prog = fh;

if (prog && prog->res.classid == classid) {
if (cl)
__tcf_bind_filter(q, &prog->res, base);
else
__tcf_unbind_filter(q, &prog->res);
}
tc_cls_bind_class(classid, cl, q, &prog->res, base);
}

static void cls_bpf_walk(struct tcf_proto *tp, struct tcf_walker *arg,
Expand Down
7 changes: 1 addition & 6 deletions net/sched/cls_flower.c
Original file line number Diff line number Diff line change
Expand Up @@ -3405,12 +3405,7 @@ static void fl_bind_class(void *fh, u32 classid, unsigned long cl, void *q,
{
struct cls_fl_filter *f = fh;

if (f && f->res.classid == classid) {
if (cl)
__tcf_bind_filter(q, &f->res, base);
else
__tcf_unbind_filter(q, &f->res);
}
tc_cls_bind_class(classid, cl, q, &f->res, base);
}

static bool fl_delete_empty(struct tcf_proto *tp)
Expand Down
7 changes: 1 addition & 6 deletions net/sched/cls_fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,12 +416,7 @@ static void fw_bind_class(void *fh, u32 classid, unsigned long cl, void *q,
{
struct fw_filter *f = fh;

if (f && f->res.classid == classid) {
if (cl)
__tcf_bind_filter(q, &f->res, base);
else
__tcf_unbind_filter(q, &f->res);
}
tc_cls_bind_class(classid, cl, q, &f->res, base);
}

static struct tcf_proto_ops cls_fw_ops __read_mostly = {
Expand Down
7 changes: 1 addition & 6 deletions net/sched/cls_matchall.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,12 +394,7 @@ static void mall_bind_class(void *fh, u32 classid, unsigned long cl, void *q,
{
struct cls_mall_head *head = fh;

if (head && head->res.classid == classid) {
if (cl)
__tcf_bind_filter(q, &head->res, base);
else
__tcf_unbind_filter(q, &head->res);
}
tc_cls_bind_class(classid, cl, q, &head->res, base);
}

static struct tcf_proto_ops cls_mall_ops __read_mostly = {
Expand Down
7 changes: 1 addition & 6 deletions net/sched/cls_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -649,12 +649,7 @@ static void route4_bind_class(void *fh, u32 classid, unsigned long cl, void *q,
{
struct route4_filter *f = fh;

if (f && f->res.classid == classid) {
if (cl)
__tcf_bind_filter(q, &f->res, base);
else
__tcf_unbind_filter(q, &f->res);
}
tc_cls_bind_class(classid, cl, q, &f->res, base);
}

static struct tcf_proto_ops cls_route4_ops __read_mostly = {
Expand Down
7 changes: 1 addition & 6 deletions net/sched/cls_rsvp.h
Original file line number Diff line number Diff line change
Expand Up @@ -733,12 +733,7 @@ static void rsvp_bind_class(void *fh, u32 classid, unsigned long cl, void *q,
{
struct rsvp_filter *f = fh;

if (f && f->res.classid == classid) {
if (cl)
__tcf_bind_filter(q, &f->res, base);
else
__tcf_unbind_filter(q, &f->res);
}
tc_cls_bind_class(classid, cl, q, &f->res, base);
}

static struct tcf_proto_ops RSVP_OPS __read_mostly = {
Expand Down
7 changes: 1 addition & 6 deletions net/sched/cls_tcindex.c
Original file line number Diff line number Diff line change
Expand Up @@ -691,12 +691,7 @@ static void tcindex_bind_class(void *fh, u32 classid, unsigned long cl,
{
struct tcindex_filter_result *r = fh;

if (r && r->res.classid == classid) {
if (cl)
__tcf_bind_filter(q, &r->res, base);
else
__tcf_unbind_filter(q, &r->res);
}
tc_cls_bind_class(classid, cl, q, &r->res, base);
}

static struct tcf_proto_ops cls_tcindex_ops __read_mostly = {
Expand Down
7 changes: 1 addition & 6 deletions net/sched/cls_u32.c
Original file line number Diff line number Diff line change
Expand Up @@ -1250,12 +1250,7 @@ static void u32_bind_class(void *fh, u32 classid, unsigned long cl, void *q,
{
struct tc_u_knode *n = fh;

if (n && n->res.classid == classid) {
if (cl)
__tcf_bind_filter(q, &n->res, base);
else
__tcf_unbind_filter(q, &n->res);
}
tc_cls_bind_class(classid, cl, q, &n->res, base);
}

static int u32_dump(struct net *net, struct tcf_proto *tp, void *fh,
Expand Down

0 comments on commit cc9039a

Please sign in to comment.