netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cong Wang <xiyou.wangcong@gmail.com>
To: Vlad Buslov <vladbu@mellanox.com>
Cc: Linux Kernel Network Developers <netdev@vger.kernel.org>,
	Jamal Hadi Salim <jhs@mojatatu.com>,
	Jiri Pirko <jiri@resnulli.us>, David Miller <davem@davemloft.net>,
	Stephen Hemminger <stephen@networkplumber.org>,
	Kirill Tkhai <ktkhai@virtuozzo.com>,
	Nicolas Dichtel <nicolas.dichtel@6wind.com>,
	Greg KH <gregkh@linuxfoundation.org>,
	mark.rutland@arm.com, Leon Romanovsky <leon@kernel.org>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	Florian Westphal <fw@strlen.de>, David Ahern <dsahern@gmail.com>,
	christian@brauner.io, lucien xin <lucien.xin@gmail.com>,
	Jakub Kicinski <jakub.kicinski@netronome.com>,
	Jiri Benc <jbenc@redhat.com>
Subject: Re: [PATCH net-next v2 05/10] net: sched: use Qdisc rcu API instead of relying on rtnl lock
Date: Wed, 19 Sep 2018 15:04:47 -0700	[thread overview]
Message-ID: <CAM_iQpVKEU_RqxDPaTEo2KShKNATsHGJEa64afT-m6iadptNGw@mail.gmail.com> (raw)
In-Reply-To: <1537168660-24032-6-git-send-email-vladbu@mellanox.com>

On Mon, Sep 17, 2018 at 12:19 AM Vlad Buslov <vladbu@mellanox.com> wrote:
> +static void tcf_qdisc_put(struct Qdisc *q, bool rtnl_held)
> +{
> +       if (!q)
> +               return;
> +
> +       if (rtnl_held)
> +               qdisc_put(q);
> +       else
> +               qdisc_put_unlocked(q);
> +}

This is very ugly. You should know whether RTNL is held or
not when calling it.

What's more, all of your code passes true, so why do you
need a parameter for rtnl_held?

  reply	other threads:[~2018-09-20  3:44 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-17  7:17 [PATCH net-next v2 00/10] Refactor classifier API to work with Qdisc/blocks without rtnl lock Vlad Buslov
2018-09-17  7:17 ` [PATCH net-next v2 01/10] net: core: netlink: add helper refcount dec and lock function Vlad Buslov
2018-09-19 21:46   ` Cong Wang
2018-09-17  7:17 ` [PATCH net-next v2 02/10] net: sched: rename qdisc_destroy() to qdisc_put() Vlad Buslov
2018-09-17  7:17 ` [PATCH net-next v2 03/10] net: sched: extend Qdisc with rcu Vlad Buslov
2018-09-19  2:45   ` David Miller
2018-09-17  7:17 ` [PATCH net-next v2 04/10] net: sched: add helper function to take reference to Qdisc Vlad Buslov
2018-09-17  7:17 ` [PATCH net-next v2 05/10] net: sched: use Qdisc rcu API instead of relying on rtnl lock Vlad Buslov
2018-09-19 22:04   ` Cong Wang [this message]
2018-09-20  7:20     ` Vlad Buslov
2018-09-21 19:29       ` Cong Wang
2018-09-17  7:17 ` [PATCH net-next v2 06/10] net: sched: change tcf block reference counter type to refcount_t Vlad Buslov
2018-09-17  7:17 ` [PATCH net-next v2 07/10] net: sched: implement functions to put and flush all chains Vlad Buslov
2018-09-17  7:17 ` [PATCH net-next v2 08/10] net: sched: protect block idr with spinlock Vlad Buslov
2018-09-19 22:09   ` Cong Wang
2018-09-20  7:36     ` Vlad Buslov
2018-09-21 19:33       ` Cong Wang
2018-09-17  7:17 ` [PATCH net-next v2 09/10] net: sched: implement tcf_block_refcnt_{get|put}() Vlad Buslov
2018-09-17  7:17 ` [PATCH net-next v2 10/10] net: sched: use reference counting for tcf blocks on rules update Vlad Buslov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAM_iQpVKEU_RqxDPaTEo2KShKNATsHGJEa64afT-m6iadptNGw@mail.gmail.com \
    --to=xiyou.wangcong@gmail.com \
    --cc=christian@brauner.io \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=fw@strlen.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=jakub.kicinski@netronome.com \
    --cc=jbenc@redhat.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=ktkhai@virtuozzo.com \
    --cc=leon@kernel.org \
    --cc=lucien.xin@gmail.com \
    --cc=mark.rutland@arm.com \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.dichtel@6wind.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=stephen@networkplumber.org \
    --cc=vladbu@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).