From patchwork Mon Oct 15 18:19:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Fastabend X-Patchwork-Id: 984326 Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42Ymtv5dB7z9sBZ for ; Tue, 16 Oct 2018 05:19:51 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726907AbeJPCGK (ORCPT ); Mon, 15 Oct 2018 22:06:10 -0400 Received: from [184.63.162.180] ([184.63.162.180]:41252 "EHLO john-Precision-Tower-5810" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726639AbeJPCGK (ORCPT ); Mon, 15 Oct 2018 22:06:10 -0400 Received: from [127.0.1.1] (localhost [127.0.0.1]) by john-Precision-Tower-5810 (Postfix) with ESMTP id ECEB1D5444A; Mon, 15 Oct 2018 11:19:44 -0700 (PDT) Subject: [bpf-next PATCH v3 0/2] bpftool support for sockmap use cases From: John Fastabend To: jakub.kicinski@netronome.com, ast@kernel.org, daniel@iogearbox.net Cc: netdev@vger.kernel.org Date: Mon, 15 Oct 2018 11:19:44 -0700 Message-ID: <20181015181857.8673.46183.stgit@john-Precision-Tower-5810> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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. v3: add bash completion and doc updates for --mapcompat --- 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 | 6 + tools/bpf/bpftool/bash-completion/bpftool | 21 ++++- tools/bpf/bpftool/main.c | 7 +- tools/bpf/bpftool/main.h | 3 - tools/bpf/bpftool/prog.c | 101 ++++++++++++++++++++++ 6 files changed, 142 insertions(+), 7 deletions(-) -- Signature