From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Pirko 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 Message-ID: <20180914152405.GO25110@nanopsycho> References: <1536220742-25650-1-git-send-email-vladbu@mellanox.com> <1536220742-25650-9-git-send-email-vladbu@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Cong Wang , Linux Kernel Network Developers , Jamal Hadi Salim , David Miller , Stephen Hemminger , Kirill Tkhai , "Paul E. McKenney" , Nicolas Dichtel , Leon Romanovsky , Greg KH , mark.rutland@arm.com, Florian Westphal , David Ahern , lucien xin , Jakub Kicinski , Christian Brauner , Jiri Benc To: Vlad Buslov Return-path: Received: from mail-wm1-f65.google.com ([209.85.128.65]:39030 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726902AbeINUnS (ORCPT ); Fri, 14 Sep 2018 16:43:18 -0400 Received: by mail-wm1-f65.google.com with SMTP id q8-v6so2368730wmq.4 for ; Fri, 14 Sep 2018 08:28:17 -0700 (PDT) Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: Fri, Sep 14, 2018 at 12:38:08PM CEST, vladbu@mellanox.com wrote: > >On Thu 13 Sep 2018 at 17:21, Cong Wang wrote: >> On Wed, Sep 12, 2018 at 1:24 AM Vlad Buslov wrote: >>> >>> >>> On Fri 07 Sep 2018 at 20:09, Cong Wang wrote: >>> > On Thu, Sep 6, 2018 at 12:59 AM Vlad Buslov 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.