From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752621AbbC1WQr (ORCPT ); Sat, 28 Mar 2015 18:16:47 -0400 Received: from www62.your-server.de ([213.133.104.62]:51126 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752013AbbC1WQo (ORCPT ); Sat, 28 Mar 2015 18:16:44 -0400 Message-ID: <55172844.7070108@iogearbox.net> Date: Sat, 28 Mar 2015 23:16:36 +0100 From: Daniel Borkmann User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Alexei Starovoitov , He Kuang CC: wangnan0@huawei.com, LKML Subject: Re: [RFC] bpf: Suggestion on bpf syscall interface References: <55169240.7040103@huawei.com> <5516E32B.6030502@plumgrid.com> In-Reply-To: <5516E32B.6030502@plumgrid.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/28/2015 06:21 PM, Alexei Starovoitov wrote: > On 3/28/15 4:36 AM, He Kuang wrote: >> Hi, Alexei >> >> In our end-end IO module project, we use bpf maps to record >> configurations. According to current bpf syscall interface, we >> should specify map_fd to lookup/update bpf maps, so we are >> restricted to do config in the same user program. > > you can pass map_fd and prog_fd from one process to another via normal > scm_rights mechanism. +1, I've just tried that out in the context of a different work and works like a charm. >> My suggestion is to export this kind of operations to sysfs, so >> we can load&attach bpf progs and config it seperately. We >> implement this feature in our demo project. What's your opinion >> on this? > > Eventually we may use single sysfs file for lsmod-like listings, but I > definitely don't want to create parallel interface to maps via sysfs. Yes, that would be a bad design decision. Btw, even more lightweight for kernel-side would be to just implement .show_fdinfo() for the anon indoes on the map/prog store and have some meta information exported from there. You can then grab that via /proc//fdinfo/, I would consider such a thing a slow-path operation anyway, and you would also get the app info using it for free. > It's way too expensive and not really suitable for binary key/values. +1