From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Fastabend Subject: [bpf-next PATCH v2 0/2] bpftool support for sockmap use cases Date: Mon, 15 Oct 2018 08:17:43 -0700 Message-ID: <20181015151336.9258.37606.stgit@john-Precision-Tower-5810> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org To: jakub.kicinski@netronome.com, ast@kernel.org, daniel@iogearbox.net Return-path: Received: from [184.63.162.180] ([184.63.162.180]:46756 "EHLO john-Precision-Tower-5810" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726550AbeJOXD3 (ORCPT ); Mon, 15 Oct 2018 19:03:29 -0400 Sender: netdev-owner@vger.kernel.org List-ID: The first patch adds support for attaching programs to maps. This is needed to support sock{map|hash} use from bpftool. Currently, I carry around custom code to do this so doing it using standard bpftool will be great. The second patch adds a compat mode to ignore non-zero entries in the map def. This allows using bpftool with maps that have a extra fields that the user knows can be ignored. This is needed to work correctly with maps being loaded by other tools or directly via syscalls. --- John Fastabend (2): bpf: bpftool, add support for attaching programs to maps bpf: bpftool, add flag to allow non-compat map definitions tools/bpf/bpftool/Documentation/bpftool-prog.rst | 11 ++ tools/bpf/bpftool/Documentation/bpftool.rst | 2 tools/bpf/bpftool/bash-completion/bpftool | 19 ++++ tools/bpf/bpftool/main.c | 7 +- tools/bpf/bpftool/main.h | 3 - tools/bpf/bpftool/prog.c | 101 ++++++++++++++++++++++ tools/lib/bpf/bpf.h | 3 + tools/lib/bpf/libbpf.c | 27 ++++-- tools/lib/bpf/libbpf.h | 2 9 files changed, 160 insertions(+), 15 deletions(-)