[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <vbfo9d0nz3j.fsf@reg-r-vrt-018-180.mtr.labs.mlnx>
Date: Fri, 14 Sep 2018 13:38:08 +0300
From: Vlad Buslov <vladbu@...lanox.com>
To: Cong Wang <xiyou.wangcong@...il.com>, Jiri Pirko <jiri@...nulli.us>
Cc: Linux Kernel Network Developers <netdev@...r.kernel.org>,
Jamal Hadi Salim <jhs@...atatu.com>,
Jiri Pirko <jiri@...nulli.us>,
David Miller <davem@...emloft.net>,
Stephen Hemminger <stephen@...workplumber.org>,
Kirill Tkhai <ktkhai@...tuozzo.com>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Nicolas Dichtel <nicolas.dichtel@...nd.com>,
Leon Romanovsky <leon@...nel.org>,
Greg KH <gregkh@...uxfoundation.org>, mark.rutland@....com,
Florian Westphal <fw@...len.de>,
David Ahern <dsahern@...il.com>,
lucien xin <lucien.xin@...il.com>,
Jakub Kicinski <jakub.kicinski@...ronome.com>,
Christian Brauner <christian.brauner@...ntu.com>,
Jiri Benc <jbenc@...hat.com>
Subject: Re: [PATCH net-next 08/13] net: sched: rename tcf_block_get{_ext}() and tcf_block_put{_ext}()
On Thu 13 Sep 2018 at 17:21, Cong Wang <xiyou.wangcong@...il.com> wrote:
> On Wed, Sep 12, 2018 at 1:24 AM Vlad Buslov <vladbu@...lanox.com> wrote:
>>
>>
>> On Fri 07 Sep 2018 at 20:09, Cong Wang <xiyou.wangcong@...il.com> wrote:
>> > On Thu, Sep 6, 2018 at 12:59 AM Vlad Buslov <vladbu@...lanox.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?
Powered by blists - more mailing lists