get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/807910/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 807910,
    "url": "http://patchwork.ozlabs.org/api/patches/807910/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20170830213036.24250-1-xiyou.wangcong@gmail.com/",
    "project": {
        "id": 7,
        "url": "http://patchwork.ozlabs.org/api/projects/7/?format=api",
        "name": "Linux network development",
        "link_name": "netdev",
        "list_id": "netdev.vger.kernel.org",
        "list_email": "netdev@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20170830213036.24250-1-xiyou.wangcong@gmail.com>",
    "list_archive_url": null,
    "date": "2017-08-30T21:30:36",
    "name": "[net-next] net_sched: add reverse binding for tc class",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "57fbd63a94cb5eff865306da293dd1f48885f4ee",
    "submitter": {
        "id": 211,
        "url": "http://patchwork.ozlabs.org/api/people/211/?format=api",
        "name": "Cong Wang",
        "email": "xiyou.wangcong@gmail.com"
    },
    "delegate": {
        "id": 34,
        "url": "http://patchwork.ozlabs.org/api/users/34/?format=api",
        "username": "davem",
        "first_name": "David",
        "last_name": "Miller",
        "email": "davem@davemloft.net"
    },
    "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/20170830213036.24250-1-xiyou.wangcong@gmail.com/mbox/",
    "series": [
        {
            "id": 702,
            "url": "http://patchwork.ozlabs.org/api/series/702/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=702",
            "date": "2017-08-30T21:30:36",
            "name": "[net-next] net_sched: add reverse binding for tc class",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/702/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/807910/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/807910/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<netdev-owner@vger.kernel.org>",
        "X-Original-To": "patchwork-incoming@ozlabs.org",
        "Delivered-To": "patchwork-incoming@ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"u5I/jjJF\"; dkim-atps=neutral"
        ],
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xjJZz0Bs7z9s8P\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 31 Aug 2017 07:30:50 +1000 (AEST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1750980AbdH3Vas (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tWed, 30 Aug 2017 17:30:48 -0400",
            "from mail-pg0-f67.google.com ([74.125.83.67]:33461 \"EHLO\n\tmail-pg0-f67.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1750814AbdH3Var (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Wed, 30 Aug 2017 17:30:47 -0400",
            "by mail-pg0-f67.google.com with SMTP id m15so5915596pgc.0\n\tfor <netdev@vger.kernel.org>; Wed, 30 Aug 2017 14:30:47 -0700 (PDT)",
            "from tw-172-25-30-113.office.twttr.net ([8.25.197.25])\n\tby smtp.gmail.com with ESMTPSA id\n\tm68sm10773729pfk.15.2017.08.30.14.30.45\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tWed, 30 Aug 2017 14:30:45 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id;\n\tbh=00TGrbrDt+zy/SuJiyLrOGjJdLj7HJz/VxQTLjUqD2s=;\n\tb=u5I/jjJFG0tvRpkrNv1waq5ZAjCypCuV3yihQg4ZZz2DMm8p3Yt5k6v3WuNwE9x6ki\n\tyNlIAaPaEnH7tavk7HH5Cc7D9Fu35aw/jIiGTIoo/Nmd0Om3Y4fcA1vlg7ygyEj/uLCq\n\tlkp1h4odrlure0+uePI2Ks7isUjm8tbcKduInB3g2E5kJ0A/5Y7q+Onjom0yAzYyJeAN\n\tLqbGtAbJSOkULK0z9X2dtH5aBJMbQ+g221arTqytkAJHNsJVjO/2nM/QhTCWd7Kzhgg2\n\tQse4PSPMApLz8rZi16dFsqf4Yvbv9QTbmn7nl/X3qkltIa93qgWsvuRxQwr9vRXV0Riu\n\tjPYw==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id;\n\tbh=00TGrbrDt+zy/SuJiyLrOGjJdLj7HJz/VxQTLjUqD2s=;\n\tb=ej6ksdsc5ZeVbrbjaBCvi9Aa5b8qy/6k6mlPreenE1idtaKJkz5QNrotjZqWLSBMw6\n\tvEvwAVj6xtECmJi18Pu3/Y1bf8BRWtXXOpmLjQEr5CjPgle85/thxLGxiHTG4a+PNdDs\n\tciVRMJpGWiBg5xXYG7Qd7I77raWPVTMQ0VvM9Jr4zAFmwITs2PGrym6esFKtalWyCWmL\n\tNeb5eyXjDnWSYEIFsVogBlfBV4wXO+vOgAWbp/8tz9qKctjJOW1/KmjWbtheth4Y0CyX\n\tJeb7Y+kLE8ccXmSELOT8J3iIc/6yy5OE9Nz4Xa+Eecjjh84OXfrmEnnLPuMX3f8PQfqO\n\tYIUQ==",
        "X-Gm-Message-State": "AHYfb5hkU6k8/XkPxqNkvsZWNjNq6L1vfe6EMquuEbuv3rRS0BKNNssw\n\tECa5PCXWlnA62E61UpA=",
        "X-Received": "by 10.84.216.25 with SMTP id m25mr3582589pli.199.1504128646518; \n\tWed, 30 Aug 2017 14:30:46 -0700 (PDT)",
        "From": "Cong Wang <xiyou.wangcong@gmail.com>",
        "To": "netdev@vger.kernel.org",
        "Cc": "Cong Wang <xiyou.wangcong@gmail.com>, Jamal Hadi Salim <jhs@mojatatu.com>",
        "Subject": "[Patch net-next] net_sched: add reverse binding for tc class",
        "Date": "Wed, 30 Aug 2017 14:30:36 -0700",
        "Message-Id": "<20170830213036.24250-1-xiyou.wangcong@gmail.com>",
        "X-Mailer": "git-send-email 2.9.4",
        "Sender": "netdev-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<netdev.vger.kernel.org>",
        "X-Mailing-List": "netdev@vger.kernel.org"
    },
    "content": "TC filters when used as classifiers are bound to TC classes.\nHowever, there is a hidden difference when adding them in different\norders:\n\n1. If we add tc classes before its filters, everything is fine.\n   Logically, the classes exist before we specify their ID's in\n   filters, it is easy to bind them together, just as in the current\n   code base.\n\n2. If we add tc filters before the tc classes they bind, we have to\n   do dynamic lookup in fast path. What's worse, this happens all\n   the time not just once, because on fast path tcf_result is passed\n   on stack, there is no way to propagate back to the one in tc filters.\n\nThis hidden difference hurts performance silently if we have many tc\nclasses in hierarchy.\n\nThis patch intends to close this gap by doing the reverse binding when\nwe create a new class, in this case we can actually search all the\nfilters in its parent, match and fixup by classid. And because\ntcf_result is specific to each type of tc filter, we have to introduce\na new ops for each filter to tell how to bind the class.\n\nNote, we still can NOT totally get rid of those class lookup in\n->enqueue() because cgroup and flow filters have no way to determine\nthe classid at setup time, they still have to go through dynamic lookup.\n\nCc: Jamal Hadi Salim <jhs@mojatatu.com>\nSigned-off-by: Cong Wang <xiyou.wangcong@gmail.com>\n---\n include/net/sch_generic.h |  1 +\n net/sched/cls_basic.c     |  9 +++++++\n net/sched/cls_bpf.c       |  9 +++++++\n net/sched/cls_flower.c    |  9 +++++++\n net/sched/cls_fw.c        |  9 +++++++\n net/sched/cls_matchall.c  |  9 +++++++\n net/sched/cls_route.c     |  9 +++++++\n net/sched/cls_rsvp.h      |  9 +++++++\n net/sched/cls_tcindex.c   |  9 +++++++\n net/sched/cls_u32.c       |  9 +++++++\n net/sched/sch_api.c       | 68 +++++++++++++++++++++++++++++++++++++++++++++--\n 11 files changed, 148 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h\nindex c30b634c5f82..d6247a3c40df 100644\n--- a/include/net/sch_generic.h\n+++ b/include/net/sch_generic.h\n@@ -217,6 +217,7 @@ struct tcf_proto_ops {\n \t\t\t\t\tvoid **, bool);\n \tint\t\t\t(*delete)(struct tcf_proto*, void *, bool*);\n \tvoid\t\t\t(*walk)(struct tcf_proto*, struct tcf_walker *arg);\n+\tvoid\t\t\t(*bind_class)(void *, u32, unsigned long);\n \n \t/* rtnetlink specific */\n \tint\t\t\t(*dump)(struct net*, struct tcf_proto*, void *,\ndiff --git a/net/sched/cls_basic.c b/net/sched/cls_basic.c\nindex 73cc7f167a38..d89ebafd2239 100644\n--- a/net/sched/cls_basic.c\n+++ b/net/sched/cls_basic.c\n@@ -235,6 +235,14 @@ static void basic_walk(struct tcf_proto *tp, struct tcf_walker *arg)\n \t}\n }\n \n+static void basic_bind_class(void *fh, u32 classid, unsigned long cl)\n+{\n+\tstruct basic_filter *f = fh;\n+\n+\tif (f && f->res.classid == classid)\n+\t\tf->res.class = cl;\n+}\n+\n static int basic_dump(struct net *net, struct tcf_proto *tp, void *fh,\n \t\t      struct sk_buff *skb, struct tcmsg *t)\n {\n@@ -280,6 +288,7 @@ static struct tcf_proto_ops cls_basic_ops __read_mostly = {\n \t.delete\t\t=\tbasic_delete,\n \t.walk\t\t=\tbasic_walk,\n \t.dump\t\t=\tbasic_dump,\n+\t.bind_class\t=\tbasic_bind_class,\n \t.owner\t\t=\tTHIS_MODULE,\n };\n \ndiff --git a/net/sched/cls_bpf.c b/net/sched/cls_bpf.c\nindex 6f2dffe30f25..520c5027646a 100644\n--- a/net/sched/cls_bpf.c\n+++ b/net/sched/cls_bpf.c\n@@ -607,6 +607,14 @@ static int cls_bpf_dump(struct net *net, struct tcf_proto *tp, void *fh,\n \treturn -1;\n }\n \n+static void cls_bpf_bind_class(void *fh, u32 classid, unsigned long cl)\n+{\n+\tstruct cls_bpf_prog *prog = fh;\n+\n+\tif (prog && prog->res.classid == classid)\n+\t\tprog->res.class = cl;\n+}\n+\n static void cls_bpf_walk(struct tcf_proto *tp, struct tcf_walker *arg)\n {\n \tstruct cls_bpf_head *head = rtnl_dereference(tp->root);\n@@ -635,6 +643,7 @@ static struct tcf_proto_ops cls_bpf_ops __read_mostly = {\n \t.delete\t\t=\tcls_bpf_delete,\n \t.walk\t\t=\tcls_bpf_walk,\n \t.dump\t\t=\tcls_bpf_dump,\n+\t.bind_class\t=\tcls_bpf_bind_class,\n };\n \n static int __init cls_bpf_init_mod(void)\ndiff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c\nindex bd9dab41f8af..23832d8862c0 100644\n--- a/net/sched/cls_flower.c\n+++ b/net/sched/cls_flower.c\n@@ -1360,6 +1360,14 @@ static int fl_dump(struct net *net, struct tcf_proto *tp, void *fh,\n \treturn -1;\n }\n \n+static void fl_bind_class(void *fh, u32 classid, unsigned long cl)\n+{\n+\tstruct cls_fl_filter *f = fh;\n+\n+\tif (f && f->res.classid == classid)\n+\t\tf->res.class = cl;\n+}\n+\n static struct tcf_proto_ops cls_fl_ops __read_mostly = {\n \t.kind\t\t= \"flower\",\n \t.classify\t= fl_classify,\n@@ -1370,6 +1378,7 @@ static struct tcf_proto_ops cls_fl_ops __read_mostly = {\n \t.delete\t\t= fl_delete,\n \t.walk\t\t= fl_walk,\n \t.dump\t\t= fl_dump,\n+\t.bind_class\t= fl_bind_class,\n \t.owner\t\t= THIS_MODULE,\n };\n \ndiff --git a/net/sched/cls_fw.c b/net/sched/cls_fw.c\nindex 192255ec50bd..941245ad07fd 100644\n--- a/net/sched/cls_fw.c\n+++ b/net/sched/cls_fw.c\n@@ -412,6 +412,14 @@ static int fw_dump(struct net *net, struct tcf_proto *tp, void *fh,\n \treturn -1;\n }\n \n+static void fw_bind_class(void *fh, u32 classid, unsigned long cl)\n+{\n+\tstruct fw_filter *f = fh;\n+\n+\tif (f && f->res.classid == classid)\n+\t\tf->res.class = cl;\n+}\n+\n static struct tcf_proto_ops cls_fw_ops __read_mostly = {\n \t.kind\t\t=\t\"fw\",\n \t.classify\t=\tfw_classify,\n@@ -422,6 +430,7 @@ static struct tcf_proto_ops cls_fw_ops __read_mostly = {\n \t.delete\t\t=\tfw_delete,\n \t.walk\t\t=\tfw_walk,\n \t.dump\t\t=\tfw_dump,\n+\t.bind_class\t=\tfw_bind_class,\n \t.owner\t\t=\tTHIS_MODULE,\n };\n \ndiff --git a/net/sched/cls_matchall.c b/net/sched/cls_matchall.c\nindex d4dc387f7a56..21cc45caf842 100644\n--- a/net/sched/cls_matchall.c\n+++ b/net/sched/cls_matchall.c\n@@ -251,6 +251,14 @@ static int mall_dump(struct net *net, struct tcf_proto *tp, void *fh,\n \treturn -1;\n }\n \n+static void mall_bind_class(void *fh, u32 classid, unsigned long cl)\n+{\n+\tstruct cls_mall_head *head = fh;\n+\n+\tif (head && head->res.classid == classid)\n+\t\thead->res.class = cl;\n+}\n+\n static struct tcf_proto_ops cls_mall_ops __read_mostly = {\n \t.kind\t\t= \"matchall\",\n \t.classify\t= mall_classify,\n@@ -261,6 +269,7 @@ static struct tcf_proto_ops cls_mall_ops __read_mostly = {\n \t.delete\t\t= mall_delete,\n \t.walk\t\t= mall_walk,\n \t.dump\t\t= mall_dump,\n+\t.bind_class\t= mall_bind_class,\n \t.owner\t\t= THIS_MODULE,\n };\n \ndiff --git a/net/sched/cls_route.c b/net/sched/cls_route.c\nindex 3b70982394ce..9ddde65915d2 100644\n--- a/net/sched/cls_route.c\n+++ b/net/sched/cls_route.c\n@@ -624,6 +624,14 @@ static int route4_dump(struct net *net, struct tcf_proto *tp, void *fh,\n \treturn -1;\n }\n \n+static void route4_bind_class(void *fh, u32 classid, unsigned long cl)\n+{\n+\tstruct route4_filter *f = fh;\n+\n+\tif (f && f->res.classid == classid)\n+\t\tf->res.class = cl;\n+}\n+\n static struct tcf_proto_ops cls_route4_ops __read_mostly = {\n \t.kind\t\t=\t\"route\",\n \t.classify\t=\troute4_classify,\n@@ -634,6 +642,7 @@ static struct tcf_proto_ops cls_route4_ops __read_mostly = {\n \t.delete\t\t=\troute4_delete,\n \t.walk\t\t=\troute4_walk,\n \t.dump\t\t=\troute4_dump,\n+\t.bind_class\t=\troute4_bind_class,\n \t.owner\t\t=\tTHIS_MODULE,\n };\n \ndiff --git a/net/sched/cls_rsvp.h b/net/sched/cls_rsvp.h\nindex 26203ff817f3..98c05db85bcb 100644\n--- a/net/sched/cls_rsvp.h\n+++ b/net/sched/cls_rsvp.h\n@@ -723,6 +723,14 @@ static int rsvp_dump(struct net *net, struct tcf_proto *tp, void *fh,\n \treturn -1;\n }\n \n+static void rsvp_bind_class(void *fh, u32 classid, unsigned long cl)\n+{\n+\tstruct rsvp_filter *f = fh;\n+\n+\tif (f && f->res.classid == classid)\n+\t\tf->res.class = cl;\n+}\n+\n static struct tcf_proto_ops RSVP_OPS __read_mostly = {\n \t.kind\t\t=\tRSVP_ID,\n \t.classify\t=\trsvp_classify,\n@@ -733,6 +741,7 @@ static struct tcf_proto_ops RSVP_OPS __read_mostly = {\n \t.delete\t\t=\trsvp_delete,\n \t.walk\t\t=\trsvp_walk,\n \t.dump\t\t=\trsvp_dump,\n+\t.bind_class\t=\trsvp_bind_class,\n \t.owner\t\t=\tTHIS_MODULE,\n };\n \ndiff --git a/net/sched/cls_tcindex.c b/net/sched/cls_tcindex.c\nindex fb281b9b2c52..14a7e08b2fa9 100644\n--- a/net/sched/cls_tcindex.c\n+++ b/net/sched/cls_tcindex.c\n@@ -606,6 +606,14 @@ static int tcindex_dump(struct net *net, struct tcf_proto *tp, void *fh,\n \treturn -1;\n }\n \n+static void tcindex_bind_class(void *fh, u32 classid, unsigned long cl)\n+{\n+\tstruct tcindex_filter_result *r = fh;\n+\n+\tif (r && r->res.classid == classid)\n+\t\tr->res.class = cl;\n+}\n+\n static struct tcf_proto_ops cls_tcindex_ops __read_mostly = {\n \t.kind\t\t=\t\"tcindex\",\n \t.classify\t=\ttcindex_classify,\n@@ -616,6 +624,7 @@ static struct tcf_proto_ops cls_tcindex_ops __read_mostly = {\n \t.delete\t\t=\ttcindex_delete,\n \t.walk\t\t=\ttcindex_walk,\n \t.dump\t\t=\ttcindex_dump,\n+\t.bind_class\t=\ttcindex_bind_class,\n \t.owner\t\t=\tTHIS_MODULE,\n };\n \ndiff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c\nindex 99ea4c74dd5b..10b8d851fc6b 100644\n--- a/net/sched/cls_u32.c\n+++ b/net/sched/cls_u32.c\n@@ -1112,6 +1112,14 @@ static void u32_walk(struct tcf_proto *tp, struct tcf_walker *arg)\n \t}\n }\n \n+static void u32_bind_class(void *fh, u32 classid, unsigned long cl)\n+{\n+\tstruct tc_u_knode *n = fh;\n+\n+\tif (n && n->res.classid == classid)\n+\t\tn->res.class = cl;\n+}\n+\n static int u32_dump(struct net *net, struct tcf_proto *tp, void *fh,\n \t\t    struct sk_buff *skb, struct tcmsg *t)\n {\n@@ -1242,6 +1250,7 @@ static struct tcf_proto_ops cls_u32_ops __read_mostly = {\n \t.delete\t\t=\tu32_delete,\n \t.walk\t\t=\tu32_walk,\n \t.dump\t\t=\tu32_dump,\n+\t.bind_class\t=\tu32_bind_class,\n \t.owner\t\t=\tTHIS_MODULE,\n };\n \ndiff --git a/net/sched/sch_api.c b/net/sched/sch_api.c\nindex e7f8e4bfd4ec..929b024f41ba 100644\n--- a/net/sched/sch_api.c\n+++ b/net/sched/sch_api.c\n@@ -35,6 +35,7 @@\n #include <net/sock.h>\n #include <net/netlink.h>\n #include <net/pkt_sched.h>\n+#include <net/pkt_cls.h>\n \n /*\n \n@@ -1648,6 +1649,64 @@ static int tclass_del_notify(struct net *net,\n \t\t\t      n->nlmsg_flags & NLM_F_ECHO);\n }\n \n+#ifdef CONFIG_NET_CLS\n+\n+struct tcf_bind_args {\n+\tstruct tcf_walker w;\n+\tu32 classid;\n+\tunsigned long cl;\n+};\n+\n+static int tcf_node_bind(struct tcf_proto *tp, void *n, struct tcf_walker *arg)\n+{\n+\tstruct tcf_bind_args *a = (void *)arg;\n+\n+\tif (tp->ops->bind_class) {\n+\t\ttcf_tree_lock(tp);\n+\t\ttp->ops->bind_class(n, a->classid, a->cl);\n+\t\ttcf_tree_unlock(tp);\n+\t}\n+\treturn 0;\n+}\n+\n+static void tc_bind_tclass(struct Qdisc *q, u32 portid, u32 clid,\n+\t\t\t   unsigned long new_cl)\n+{\n+\tconst struct Qdisc_class_ops *cops = q->ops->cl_ops;\n+\tstruct tcf_block *block;\n+\tstruct tcf_chain *chain;\n+\tunsigned long cl;\n+\n+\tcl = cops->find(q, portid);\n+\tif (!cl)\n+\t\treturn;\n+\tblock = cops->tcf_block(q, cl);\n+\tif (!block)\n+\t\treturn;\n+\tlist_for_each_entry(chain, &block->chain_list, list) {\n+\t\tstruct tcf_proto *tp;\n+\n+\t\tfor (tp = rtnl_dereference(chain->filter_chain);\n+\t\t     tp; tp = rtnl_dereference(tp->next)) {\n+\t\t\tstruct tcf_bind_args arg = {};\n+\n+\t\t\targ.w.fn = tcf_node_bind;\n+\t\t\targ.classid = clid;\n+\t\t\targ.cl = new_cl;\n+\t\t\ttp->ops->walk(tp, &arg.w);\n+\t\t}\n+\t}\n+}\n+\n+#else\n+\n+static void tc_bind_tclass(struct Qdisc *q, u32 portid, u32 clid,\n+\t\t\t   unsigned long new_cl)\n+{\n+}\n+\n+#endif\n+\n static int tc_ctl_tclass(struct sk_buff *skb, struct nlmsghdr *n,\n \t\t\t struct netlink_ext_ack *extack)\n {\n@@ -1753,6 +1812,8 @@ static int tc_ctl_tclass(struct sk_buff *skb, struct nlmsghdr *n,\n \t\t\tbreak;\n \t\tcase RTM_DELTCLASS:\n \t\t\terr = tclass_del_notify(net, cops, skb, n, q, cl);\n+\t\t\t/* Unbind the class with flilters with 0 */\n+\t\t\ttc_bind_tclass(q, portid, clid, 0);\n \t\t\tgoto out;\n \t\tcase RTM_GETTCLASS:\n \t\t\terr = tclass_notify(net, skb, n, q, cl, RTM_NEWTCLASS);\n@@ -1767,9 +1828,12 @@ static int tc_ctl_tclass(struct sk_buff *skb, struct nlmsghdr *n,\n \terr = -EOPNOTSUPP;\n \tif (cops->change)\n \t\terr = cops->change(q, clid, portid, tca, &new_cl);\n-\tif (err == 0)\n+\tif (err == 0) {\n \t\ttclass_notify(net, skb, n, q, new_cl, RTM_NEWTCLASS);\n-\n+\t\t/* We just create a new class, need to do reverse binding. */\n+\t\tif (cl != new_cl)\n+\t\t\ttc_bind_tclass(q, portid, clid, new_cl);\n+\t}\n out:\n \treturn err;\n }\n",
    "prefixes": [
        "net-next"
    ]
}