Message ID | 20181109002213.5914-1-s@fomichev.me (mailing list archive) |
---|---|
Headers | show
Return-Path: <linux-kselftest-owner@kernel.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A151C13BF for <patchwork-linux-kselftest@patchwork.kernel.org>; Fri, 9 Nov 2018 00:22:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 92AAF2E904 for <patchwork-linux-kselftest@patchwork.kernel.org>; Fri, 9 Nov 2018 00:22:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 86EBD2E946; Fri, 9 Nov 2018 00:22:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 76BE22E904 for <patchwork-linux-kselftest@patchwork.kernel.org>; Fri, 9 Nov 2018 00:22:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727691AbeKIKAW (ORCPT <rfc822;patchwork-linux-kselftest@patchwork.kernel.org>); Fri, 9 Nov 2018 05:00:22 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:37250 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727076AbeKIKAV (ORCPT <rfc822;linux-kselftest@vger.kernel.org>); Fri, 9 Nov 2018 05:00:21 -0500 Received: by mail-pl1-f193.google.com with SMTP id p6-v6so69273pll.4 for <linux-kselftest@vger.kernel.org>; Thu, 08 Nov 2018 16:22:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fomichev-me.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=dmHGVAAYj9EStzj3aGr9GCr6k093emL59Db8/OjYSUM=; b=VXYSLq4oGqrAl6VfkX0eRK83DjYu3bDQjS7/bzmpo63tJ9LSSwINzt+zygANHcqwv3 CUQHKxRiNbnY32yeWrTQ6/dOhVMRKAi4EgV/tsv6ZAsGXBGUTC0VTdCKTStF5wIAYFkb uvzYbA4wnEUJRXDm3IZbwsw6fhCB/sab/hpkxMGtzJZUFpB95RfqwkpfsO+EIKlqRN2y +TfFSx1LtajalDdMotHusjPvcx/1dGknSlS39n1qNEFO2HJYoellCofCh1wdxK3qAdmr 9c+LRSuk3sUyaM2nXHjJSjOeWYGrug2tDrkci1BDMb/4EOMImfDkmIbIcuEkgFpHRnAt zKBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=dmHGVAAYj9EStzj3aGr9GCr6k093emL59Db8/OjYSUM=; b=PTmd2uyUuJjpzWwT0khR9yEch5H/l+i5GNn+lLXDI8+3jweRGwL60PI7wh7GD6ujPX lWwtthPzMyysDfx9nFcTZahDucY1rF0eL0VneUeccZcqr+iEr5xCxg8J1D9hxQET8uH6 J6U7Xd0bRVpmJ/fgNUeJ6DveQLU6RCtCKh+8wSrjeJWYCCHg3HYL5CebDMZDwz+iU+zD bEgJt/A/CyooqzADtzMq5CV0T7W84z/yYk9C/jBpW20p5Uk5Ex2ZoYMjvmW13UCbn7Ia 5LFJdwgTxgqGQeXA8EbSh0oJt/fItTbIb94yzF/XB66KSgBgLuw9kUYCnHf7aSRNS1Kb /28Q== X-Gm-Message-State: AGRZ1gJmPe4/QJPC/EaD561lnlpcGiZrNaT6yQytme2Wa6eRqIPphY4y F5f01qinlsYKd7BErMOMSzfaFg== X-Google-Smtp-Source: AJdET5dOD1va0LDoFU8pPRAlHBBtUJ8IqapX3mxhc/wPa5bKSrk7b/iJRO6uOsE2l9cGiE+WFqlITg== X-Received: by 2002:a17:902:8e8a:: with SMTP id bg10-v6mr6724151plb.214.1541722937859; Thu, 08 Nov 2018 16:22:17 -0800 (PST) Received: from mini-arch.hsd1.ca.comcast.net (c-98-210-199-22.hsd1.ca.comcast.net. [98.210.199.22]) by smtp.gmail.com with ESMTPSA id g21-v6sm4918955pgh.82.2018.11.08.16.22.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Nov 2018 16:22:17 -0800 (PST) From: Stanislav Fomichev <sdf@fomichev.me> X-Google-Original-From: Stanislav Fomichev <s@fomichev.me> To: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net, shuah@kernel.org, jakub.kicinski@netronome.com, quentin.monnet@netronome.com Cc: guro@fb.com, jiong.wang@netronome.com, sdf@google.com, bhole_prashant_q7@lab.ntt.co.jp, john.fastabend@gmail.com, jbenc@redhat.com, treeze.taeung@gmail.com, yhs@fb.com, osk@fb.com, sandipan@linux.vnet.ibm.com Subject: [PATCH v4 bpf-next 0/7] bpftool: support loading flow dissector Date: Thu, 8 Nov 2018 16:22:06 -0800 Message-Id: <20181109002213.5914-1-s@fomichev.me> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: <linux-kselftest.vger.kernel.org> X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
bpftool: support loading flow dissector
|
expand
|
From: Stanislav Fomichev <sdf@google.com> v4 changes: * addressed another round of comments/style issues from Jakub Kicinski & Quentin Monnet (thanks!) * implemented bpf_object__pin_maps and bpf_object__pin_programs helpers and used them in bpf_program__pin * added new pin_name to bpf_program so bpf_program__pin works with sections that contain '/' * moved *loadall* command implementation into a separate patch * added patch that implements *pinmaps* to pin maps when doing load/loadall v3 changes: * (maybe) better cleanup for partial failure in bpf_object__pin * added special case in bpf_program__pin for programs with single instances v2 changes: * addressed comments/style issues from Jakub Kicinski & Quentin Monnet * removed logic that populates jump table * added cleanup for partial failure in bpf_object__pin This patch series adds support for loading and attaching flow dissector programs from the bpftool: * first patch fixes flow dissector section name in the selftests (so libbpf auto-detection works) * second patch adds proper cleanup to bpf_object__pin, parts of which are now being used to attach all flow dissector progs/maps * third patch adds special case in bpf_program__pin for programs with single instances (we don't create <prog>/0 pin anymore, just <prog>) * forth patch adds pin_name to the bpf_program struct which is now used as a pin name in bpf_program__pin et al * fifth patch adds *loadall* command that pins all programs, not just the first one * sixth patch adds *pinmaps* argument to load/loadall to let users pin all maps of the obj file * seventh patch adds actual flow_dissector support to the bpftool and an example Stanislav Fomichev (7): selftests/bpf: rename flow dissector section to flow_dissector libbpf: cleanup after partial failure in bpf_object__pin libbpf: bpf_program__pin: add special case for instances.nr == 1 libbpf: add internal pin_name bpftool: add loadall command bpftool: add pinmaps argument to the load/loadall bpftool: support loading flow dissector .../bpftool/Documentation/bpftool-prog.rst | 42 +- tools/bpf/bpftool/bash-completion/bpftool | 21 +- tools/bpf/bpftool/common.c | 31 +- tools/bpf/bpftool/main.h | 1 + tools/bpf/bpftool/prog.c | 185 ++++++--- tools/lib/bpf/libbpf.c | 364 ++++++++++++++++-- tools/lib/bpf/libbpf.h | 18 + tools/testing/selftests/bpf/bpf_flow.c | 2 +- .../selftests/bpf/test_flow_dissector.sh | 2 +- 9 files changed, 546 insertions(+), 120 deletions(-)