From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cong Wang Subject: Re: [patch net-next v3 02/10] net: sched: introduce tcf block infractructure Date: Tue, 16 May 2017 13:51:30 -0700 Message-ID: References: <20170516172802.1317-1-jiri@resnulli.us> <20170516172802.1317-3-jiri@resnulli.us> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Cc: Linux Kernel Network Developers , David Miller , Jamal Hadi Salim , David Ahern , Eric Dumazet , Stephen Hemminger , Daniel Borkmann , Alexander Duyck , Simon Horman , mlxsw@mellanox.com To: Jiri Pirko Return-path: Received: from mail-wm0-f65.google.com ([74.125.82.65]:36610 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750795AbdEPUvv (ORCPT ); Tue, 16 May 2017 16:51:51 -0400 Received: by mail-wm0-f65.google.com with SMTP id u65so39879485wmu.3 for ; Tue, 16 May 2017 13:51:51 -0700 (PDT) In-Reply-To: <20170516172802.1317-3-jiri@resnulli.us> Sender: netdev-owner@vger.kernel.org List-ID: On Tue, May 16, 2017 at 10:27 AM, Jiri Pirko wrote: > +int tcf_block_get(struct tcf_block **p_block, > + struct tcf_proto __rcu **p_filter_chain) > +{ > + struct tcf_block *block = kzalloc(sizeof(*block), GFP_KERNEL); > + > + if (!block) > + return -ENOMEM; > + block->p_filter_chain = p_filter_chain; > + *p_block = block; > + return 0; > +} > +EXPORT_SYMBOL(tcf_block_get); XXX_get() is usually for refcnt'ing, here you only allocate a block, so please rename it to tcf_block_alloc(). > + > +void tcf_block_put(struct tcf_block *block) > +{ > + if (!block) > + return; > + tcf_destroy_chain(block->p_filter_chain); > + kfree(block); > +} > +EXPORT_SYMBOL(tcf_block_put); Ditto, tcf_block_destroy().