[{"id":1766866,"web_url":"http://patchwork.ozlabs.org/comment/1766866/","msgid":"<20170912104312.GF2036@nanopsycho>","list_archive_url":null,"date":"2017-09-12T10:43:12","subject":"Re: [Patch net v3 2/3] net_sched: fix reference counting of tc\n\tfilter chain","submitter":{"id":15321,"url":"http://patchwork.ozlabs.org/api/people/15321/","name":"Jiri Pirko","email":"jiri@resnulli.us"},"content":"Tue, Sep 12, 2017 at 01:33:31AM CEST, xiyou.wangcong@gmail.com wrote:\n>This patch fixes the following ugliness of tc filter chain refcnt:\n>\n>a) tp proto should hold a refcnt to the chain too. This significantly\n>   simplifies the logic.\n>\n>b) Chain 0 is no longer special, it is created with refcnt=1 like any\n>   other chains. All the ugliness in tcf_chain_put() can be gone!\n>\n>c) No need to handle the flushing oddly, because block still holds\n>   chain 0, it can not be released, this guarantees block is the last\n>   user.\n>\n>d) The race condition with RCU callbacks is easier to handle with just\n>   a rcu_barrier(). Much easier to understand, nothing to hide. Thanks\n>   to the previous patch. Please see also the comments in code.\n>\n>e) Make the code understandable by humans, much less error-prone.\n>\n>Fixes: 744a4cf63e52 (\"net: sched: fix use after free when tcf_chain_destroy is called multiple times\")\n>Fixes: 5bc1701881e3 (\"net: sched: introduce multichain support for filters\")\n>Cc: Jiri Pirko <jiri@mellanox.com>\n>Cc: Jamal Hadi Salim <jhs@mojatatu.com>\n>Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>\n\nLooking good to me. Thanks!\n\nAcked-by: Jiri Pirko <jiri@mellanox.com>","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=resnulli-us.20150623.gappssmtp.com\n\theader.i=@resnulli-us.20150623.gappssmtp.com\n\theader.b=\"2Ti7sbDL\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xs1bp5zBDz9sRg\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 12 Sep 2017 20:43:18 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751404AbdILKnQ (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tTue, 12 Sep 2017 06:43:16 -0400","from mail-wr0-f193.google.com ([209.85.128.193]:36683 \"EHLO\n\tmail-wr0-f193.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751375AbdILKnP (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Tue, 12 Sep 2017 06:43:15 -0400","by mail-wr0-f193.google.com with SMTP id g50so5799062wra.3\n\tfor <netdev@vger.kernel.org>; Tue, 12 Sep 2017 03:43:14 -0700 (PDT)","from localhost (ip-89-177-125-82.net.upcbroadband.cz.\n\t[89.177.125.82]) by smtp.gmail.com with ESMTPSA id\n\ti131sm4418111wmf.31.2017.09.12.03.43.13\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tTue, 12 Sep 2017 03:43:13 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=resnulli-us.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:in-reply-to:user-agent;\n\tbh=dyqwDV3o/O2vFBpwPjUXwPQqgNkETSR8rQ4N+g20Q5c=;\n\tb=2Ti7sbDLDZjJLXjDlOO17G1akHo0NzHeqIHnSHnjB2dm5CGgizMaO/mClJV7a0v4Qt\n\twU3nlt/MHbzLD8vojrHnOD3m1YGnxmhH2WRZIxc8kdc79zyx3MSgtS4RFWwsk+a/6QNi\n\tiWkgJJLNOrNDhklFm9JwUZ7Ppbje8t9JGIQ6aUF+BTlCAapu75DnKIRGsM+aWSj1hwyd\n\t7Tn/3Rn/v0HfLAdvqP/hmstugSjlTJc8Cfb0KOJxLgtlqSQI+uxBLCscXrhACn3k8WYc\n\twSOr+G2UA9yrtN3Uw2GhoFcT+FZrGdSeNllwTQfxqGkoRXUK7rzInzLFGhny4vLj8A22\n\t8S4g==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:in-reply-to:user-agent;\n\tbh=dyqwDV3o/O2vFBpwPjUXwPQqgNkETSR8rQ4N+g20Q5c=;\n\tb=V4vNKPbyFkIa3GCzYT4UFtlk+GvtNC6ZW6sngkLGYrZZ2mw7S/cyj+hZGWodms+bVn\n\tg6GTcjs8CDcWIMDNbFeNUS9NmAd6ocKQ6HQB0GW2LpUM2R8SWusk9W4X2X028TBcE+97\n\t44oZUi64CpIor2TlOPloYightdUh6FrI5cDy4HM3kYw5UYHmhNnu8P1X3rHxlS6SBzY3\n\tcgUmCgXBMVVMO1cS9W00MGeP9jg6m+uKYfxpQpRqHlz9qiEQ0M1lZFdK30bsqWgCJqho\n\tvW4P+03r3mRtsTDDx2tNhYT8t2/t6n3etTSMFkBDcTzWC6vW6Qc6r0ZYedNoo81hoIdG\n\t2I6w==","X-Gm-Message-State":"AHPjjUja20I7FpiZgPU/TlwK/fJEgab3+EhoGpRF7jrITKcauNYctKoK\n\tpQXLf4abHIdDpUdd","X-Google-Smtp-Source":"ADKCNb6sAwlKvIp6CCgTvMwVUFl1Y9QzZzhTbA7X6vrL9LwpCbFcyN2WUwyvsEU/fffg9KYZMvFPvQ==","X-Received":"by 10.223.163.71 with SMTP id d7mr12491014wrb.161.1505212994027; \n\tTue, 12 Sep 2017 03:43:14 -0700 (PDT)","Date":"Tue, 12 Sep 2017 12:43:12 +0200","From":"Jiri Pirko <jiri@resnulli.us>","To":"Cong Wang <xiyou.wangcong@gmail.com>","Cc":"netdev@vger.kernel.org, jiri@mellanox.com,\n\tjakub.kicinski@netronome.com, jhs@mojatatu.com","Subject":"Re: [Patch net v3 2/3] net_sched: fix reference counting of tc\n\tfilter chain","Message-ID":"<20170912104312.GF2036@nanopsycho>","References":"<20170911233332.7594-1-xiyou.wangcong@gmail.com>\n\t<20170911233332.7594-3-xiyou.wangcong@gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170911233332.7594-3-xiyou.wangcong@gmail.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}}]