Netdev List
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Vlad Buslov <vladbu@mellanox.com>
Cc: Cong Wang <xiyou.wangcong@gmail.com>,
	Linux Kernel Network Developers <netdev@vger.kernel.org>,
	Jamal Hadi Salim <jhs@mojatatu.com>,
	David Miller <davem@davemloft.net>,
	Stephen Hemminger <stephen@networkplumber.org>,
	Kirill Tkhai <ktkhai@virtuozzo.com>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	Nicolas Dichtel <nicolas.dichtel@6wind.com>,
	Leon Romanovsky <leon@kernel.org>,
	Greg KH <gregkh@linuxfoundation.org>,
	mark.rutland@arm.com, Florian Westphal <fw@strlen.de>,
	David Ahern <dsahern@gmail.com>,
	lucien xin <lucien.xin@gmail.com>,
	Jakub Kicinski <jakub.kicinski@netronome.com>,
	Christian Brauner <christian.brauner@ubuntu.com>,
	Jiri Benc <jbenc@redhat.com>
Subject: Re: [PATCH net-next 08/13] net: sched: rename tcf_block_get{_ext}() and tcf_block_put{_ext}()
Date: Fri, 14 Sep 2018 17:24:05 +0200	[thread overview]
Message-ID: <20180914152405.GO25110@nanopsycho> (raw)
In-Reply-To: <vbfo9d0nz3j.fsf@reg-r-vrt-018-180.mtr.labs.mlnx>

Fri, Sep 14, 2018 at 12:38:08PM CEST, vladbu@mellanox.com wrote:
>
>On Thu 13 Sep 2018 at 17:21, Cong Wang <xiyou.wangcong@gmail.com> wrote:
>> On Wed, Sep 12, 2018 at 1:24 AM Vlad Buslov <vladbu@mellanox.com> wrote:
>>>
>>>
>>> On Fri 07 Sep 2018 at 20:09, Cong Wang <xiyou.wangcong@gmail.com> wrote:
>>> > On Thu, Sep 6, 2018 at 12:59 AM Vlad Buslov <vladbu@mellanox.com> wrote:
>>> >>
>>> >> Functions tcf_block_get{_ext}() and tcf_block_put{_ext}() actually
>>> >> attach/detach block to specific Qdisc besides just taking/putting
>>> >> reference. Rename them according to their purpose.
>>> >
>>> > Where exactly does it attach to?
>>> >
>>> > Each qdisc provides a pointer to a pointer of a block, like
>>> > &cl->block. It is where the result is saved to. It takes a parameter
>>> > of Qdisc* merely for read-only purpose.
>>>
>>> tcf_block_attach_ext() passes qdisc parameter to tcf_block_owner_add()
>>> which saves qdisc to new tcf_block_owner_item and adds the item to
>>> block's owner list. I proposed several naming options for these
>>> functions to Jiri on internal review and he suggested "attach" as better
>>> option.
>>
>> But that is merely item->q = q, this is why I said it is read-only,
>> hard to claim this is attaching.
>>
>>
>>>
>>> >
>>> > So, renaming it to *attach() is even confusing, at least not
>>> > any better. Please find other names or leave them as they are.
>>>
>>> What would you recommend?
>>
>> I don't know, perhaps "acquire"?
>>
>> Or, leaving tcf_block_get() as it is but rename your refcnt
>> increment function to be something like tcf_block_refcnt_get()?
>
>Cong, I'm okay with both options.
>
>Jiri, which naming would you prefer?

Maybe tcf_block_refcnt_get() is better.

  reply	other threads:[~2018-09-14 20:43 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-06  7:58 [PATCH net-next 00/13] Refactor classifier API to work with Qdisc/blocks without rtnl lock Vlad Buslov
2018-09-06  7:58 ` [PATCH net-next 01/13] net: core: netlink: add helper refcount dec and lock function Vlad Buslov
2018-09-06  7:58 ` [PATCH net-next 02/13] net: sched: rename qdisc_destroy() to qdisc_put() Vlad Buslov
2018-09-06  7:58 ` [PATCH net-next 03/13] net: sched: extend Qdisc with rcu Vlad Buslov
2018-09-06  8:30   ` Eric Dumazet
2018-09-06  8:39     ` Kirill Tkhai
2018-09-06  9:21       ` Eric Dumazet
2018-09-06  9:23       ` Vlad Buslov
2018-09-06  9:29         ` Eric Dumazet
2018-09-06  7:58 ` [PATCH net-next 04/13] net: sched: add helper function to take reference to Qdisc Vlad Buslov
2018-09-06  7:58 ` [PATCH net-next 05/13] net: sched: use Qdisc rcu API instead of relying on rtnl lock Vlad Buslov
2018-09-06  7:58 ` [PATCH net-next 06/13] net: sched: change tcf block reference counter type to refcount_t Vlad Buslov
2018-09-06  7:58 ` [PATCH net-next 07/13] net: sched: implement functions to put and flush all chains Vlad Buslov
2018-09-06  7:58 ` [PATCH net-next 08/13] net: sched: rename tcf_block_get{_ext}() and tcf_block_put{_ext}() Vlad Buslov
2018-09-07 20:09   ` Cong Wang
2018-09-12  8:24     ` Vlad Buslov
2018-09-13 17:21       ` Cong Wang
2018-09-14 10:38         ` Vlad Buslov
2018-09-14 15:24           ` Jiri Pirko [this message]
2018-09-06  7:58 ` [PATCH net-next 09/13] net: sched: extend tcf_block with rcu Vlad Buslov
2018-09-07 19:52   ` Cong Wang
2018-09-12  8:25     ` Vlad Buslov
2018-09-06  7:58 ` [PATCH net-next 10/13] net: sched: protect block idr with spinlock Vlad Buslov
2018-09-06  7:59 ` [PATCH net-next 11/13] net: sched: implement tcf_block_get() and tcf_block_put() Vlad Buslov
2018-09-06  7:59 ` [PATCH net-next 12/13] net: sched: use reference counting for tcf blocks on rules update Vlad Buslov
2018-09-06  7:59 ` [PATCH net-next 13/13] net: sched: add flags to Qdisc class ops struct Vlad Buslov
2018-09-07 19:50   ` Cong Wang
2018-09-12  8:25     ` 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=20180914152405.GO25110@nanopsycho \
    --to=jiri@resnulli.us \
    --cc=christian.brauner@ubuntu.com \
    --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=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 \
    --cc=xiyou.wangcong@gmail.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