Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751995AbdLARvL (ORCPT ); Fri, 1 Dec 2017 12:51:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:41880 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751157AbdLARvJ (ORCPT ); Fri, 1 Dec 2017 12:51:09 -0500 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 001002133D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=acme@kernel.org Date: Fri, 1 Dec 2017 14:51:06 -0300 From: Arnaldo Carvalho de Melo To: Alexei Starovoitov Cc: Martin KaFai Lau , Wang Nan , Daniel Borkmann , "David S. Miller" , David Ahern , Ingo Molnar , Linux Kernel Mailing List , netdev Subject: Re: [PATCH/RFC] Re: 'perf test BPF' failing, libbpf regression wrt "basic API for BPF obj name" Message-ID: <20171201175106.GH3298@kernel.org> References: <20171128190519.GM3298@kernel.org> <20171129210734.lqs23q65ac6avlwr@kafai-mbp> <20171129211543.GC31403@kernel.org> <20171129223135.6iqvj6ho4ojxmhu6@kafai-mbp> <20171130030110.GA18880@kernel.org> <20171130165358.GN3298@kernel.org> <20171130182807.sjhapvmnimtlsmpo@kafai-mbp.dhcp.thefacebook.com> <20171130190042.GQ3298@kernel.org> <312f7691-cb7a-5c2f-18c6-ab26cfaa26a6@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <312f7691-cb7a-5c2f-18c6-ab26cfaa26a6@fb.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1953 Lines: 45 Em Thu, Nov 30, 2017 at 01:51:15PM -0800, Alexei Starovoitov escreveu: > On 11/30/17 11:00 AM, Arnaldo Carvalho de Melo wrote: > > > Instead of sinking all future bpf_attr's backward compatibility > > > requirements to sys_bpf, I would push it up to its own BPF_* command > > > helper which has a better sense of its bpf_attr, i.e. push it up > > > to bpf_create_map_node() and bpf_load_program_name() in this case. > > Humm, we could try that approach, but the one in this patch seemed good > > enough. > > > > And after all if the first syscall() invokation, with the latest kernel > > and latest tooling will work, right? > > I agree with Martin and I also don't think it will work to push > logic of all bpf commands into single sys_bpf syscall wrapper. Sure, that was just a POC, I'll work on something that takes into account what you guys pointed out. > This logic will become more and more complex over time. > Like this case really belongs in bpf_create_map() which is a wrapper > on top of single BPF_CREATE_MAP command. > Note it's the first time we're facing this 'new libbpf.a running on > top of old kernel' issue and should be very careful adding such > fallback code to the generic bpf library, since all the selftests/bpf/ > are using this lib and relying on excepted behavior. Right, tools/perf/ uses it as well and relies on its continued functioning. > We don't want tests that want to test the latest kernel feature all of > a sudden pass on old kernel that doesn't have it. Sure, neither do I :-) > To some degree perf and selftests/bpf needs are diverging here, > so adding #ifdef to libbpf.a to match testcase expectations may be > necessary. But this is not just testcase expectations, the usecase is someone wanting to use a newer tool, with perhaps some new features of interest that don't depend on changes in the kernel, in an older kernel on a system where updating it is not possible or desirable. - Arnaldo