From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754002AbaG2Qnp (ORCPT ); Tue, 29 Jul 2014 12:43:45 -0400 Received: from mail.us.es ([193.147.175.20]:60905 "EHLO mail.us.es" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751282AbaG2Qnn (ORCPT ); Tue, 29 Jul 2014 12:43:43 -0400 X-Qmail-Scanner-Diagnostics: from 127.0.0.1 by antivirus2 (envelope-from , uid 501) with qmail-scanner-2.10 (clamdscan: 0.98.4/19237. spamassassin: 3.3.2. Clear:RC:1(127.0.0.1):SA:0(-100.2/7.5):. Processed in 1.896611 secs); 29 Jul 2014 16:43:42 -0000 X-Spam-ASN: AS42863 89.214.0.0/16 X-Envelope-From: pneira@us.es Date: Tue, 29 Jul 2014 18:42:26 +0200 From: Pablo Neira Ayuso To: Alexei Starovoitov Cc: "David S. Miller" , Daniel Borkmann , Willem de Bruijn , Kees Cook , Network Development , LKML , netfilter-devel Subject: Re: [PATCH v3 net-next] net: filter: cleanup sk_* and bpf_* names Message-ID: <20140729164226.GA6069@salvia> References: <1406615380-3488-1-git-send-email-ast@plumgrid.com> <20140729153124.GA3231@salvia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 29, 2014 at 08:55:04AM -0700, Alexei Starovoitov wrote: > > I don't think this is the right moment to add this, but we have to > > keep in mind that something similar to this will need to be > > accomodated in struct sk_filter at some point to avoid sloppy changes > > that may result in reintroducing code later on. > > I thought in v1 series you were arguing exactly about introducing them now... > ok, I will drop callbacks and keep refcnt,rcu,filter_size and bpf_prog pointer > in there. Sounds good? Agreed. > > Next step should be to wrap the specific bpf fields in struct > > bpf_prog in some clean way IMO, which was partially the aim of this > > patch. > > it seems your only objection is 'rcu_head' still being there and rebasing > on top of yours will fix it... Almost. I just wanted to leave in place struct sk_filter for the coming up generalization, that structure should contain the refcnt, rcu_head and the struct bpf_prog after some of your follow up patches. Please, also leave sk_filter_charge/uncharge/get_filter whatever will provide the room the generalization under net/core/filter.c, not need to move these to kernel/bpf/ After my patch (and your follow up), we don't have sloppy usage of rcu_head for unattached filter anymore and I guess Willem is going to same save bytes in his iptables/bpf rules given that he can directly use bpf_prog instead of sk_filter.