From patchwork Wed Nov 10 11:46:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Monnet X-Patchwork-Id: 12611939 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 910D2C43217 for ; Wed, 10 Nov 2021 11:46:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 73A3561205 for ; Wed, 10 Nov 2021 11:46:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231418AbhKJLtZ (ORCPT ); Wed, 10 Nov 2021 06:49:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231331AbhKJLtY (ORCPT ); Wed, 10 Nov 2021 06:49:24 -0500 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7887CC061766 for ; Wed, 10 Nov 2021 03:46:37 -0800 (PST) Received: by mail-wm1-x32b.google.com with SMTP id v127so1874361wme.5 for ; Wed, 10 Nov 2021 03:46:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=isovalent-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=K9FibD2+vxFCyU9lOfqbGOey2cIbsrO6jDFWOa35ijw=; b=c77sbtiNTfU6sYUC1ctTYHdiIxAZKv7yGifdUfhGLI4O/1ESqx+7wAvFyOdzrs221k qk1hcAHbg2T1v0boLzTzF3evRgLmfixAvNIMbkugp06gD6og5HRa3Yd8JC6K6PMYLbxB 8znU5WHl1DM93w0Bz0BIVXHriep9gv/qOM/qki4P2WQeWbGPKbL8FTTxF/VEAxeSKjd6 c7F/aksV5i7dsbZEX1RdxrzlKsAYT/zopYLwU8vYk9EmAyPAN0dAhJhj5aecV6l3Agxk Ukv+CD/M/ouhpvearutlioxFuebmDkreVSLfF7W7k0Fqmfq7LjZtcjGOTkbLb+1E83tt RUMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=K9FibD2+vxFCyU9lOfqbGOey2cIbsrO6jDFWOa35ijw=; b=60YsOXbOaHpnt0clQtjgLgj69VT0tNGzJDZZLJEcCfXszMJ1Y94wZVNWqNJqL8oY60 WRM7v9A2MqUW2Y0BS0N6MM1fkpEEvayPJXxe29BaiKG8jb+CS7MyiPMuZPtN4Il9szVi b7iB9cOXTd26oq+bgqbcdvvx5nRVQHeTc3O1D7dKC3LEVtoWscOnRtj+UKeAsIxTtLLj uW2vuQvJSAVedKUdiCvFfpcuHx/+ey/CZES7OZs+LFSWKEulAlXaT9BhZuwjOPBXv+Ci 8BD94AlokzKBIqmtjZ/cJZRKkSG9qE6wns4ou5M5c4TZbAD5PT3TOCxdkQ4R/UTEIN9R JtxQ== X-Gm-Message-State: AOAM53279hNiVfo+YfZzQ1zgmTGHph7lMKZeXVS8cZNkk953Icu9HVGK l5wKsYlMAbEF9CBUq3iuTwHpBw== X-Google-Smtp-Source: ABdhPJyygoY1jioNWfGmWgo4I2cdWNmrOxwSLOmOO59qV9FsIBCV5aRxkmFAh+zRtNCLiKDosuT8sQ== X-Received: by 2002:a05:600c:1d01:: with SMTP id l1mr16066389wms.44.1636544796018; Wed, 10 Nov 2021 03:46:36 -0800 (PST) Received: from localhost.localdomain ([149.86.79.190]) by smtp.gmail.com with ESMTPSA id i15sm6241152wmq.18.2021.11.10.03.46.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Nov 2021 03:46:35 -0800 (PST) From: Quentin Monnet To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko Cc: netdev@vger.kernel.org, bpf@vger.kernel.org, Quentin Monnet Subject: [PATCH bpf-next 1/6] bpftool: Fix memory leak in prog_dump() Date: Wed, 10 Nov 2021 11:46:27 +0000 Message-Id: <20211110114632.24537-2-quentin@isovalent.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211110114632.24537-1-quentin@isovalent.com> References: <20211110114632.24537-1-quentin@isovalent.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net Following the extraction of prog_dump() from do_dump(), the struct btf allocated in prog_dump() is no longer freed on error; the struct bpf_prog_linfo is not freed at all. Make sure we release them before exiting the function. Fixes: ec2025095cf6 ("bpftool: Match several programs with same tag") Signed-off-by: Quentin Monnet --- tools/bpf/bpftool/prog.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tools/bpf/bpftool/prog.c b/tools/bpf/bpftool/prog.c index dea7a49ec26e..d5fcbb02cf91 100644 --- a/tools/bpf/bpftool/prog.c +++ b/tools/bpf/bpftool/prog.c @@ -709,8 +709,8 @@ prog_dump(struct bpf_prog_info *info, enum dump_mode mode, char func_sig[1024]; unsigned char *buf; __u32 member_len; + int fd, err = -1; ssize_t n; - int fd; if (mode == DUMP_JITED) { if (info->jited_prog_len == 0 || !info->jited_prog_insns) { @@ -749,7 +749,7 @@ prog_dump(struct bpf_prog_info *info, enum dump_mode mode, if (fd < 0) { p_err("can't open file %s: %s", filepath, strerror(errno)); - return -1; + goto exit_free; } n = write(fd, buf, member_len); @@ -757,7 +757,7 @@ prog_dump(struct bpf_prog_info *info, enum dump_mode mode, if (n != (ssize_t)member_len) { p_err("error writing output file: %s", n < 0 ? strerror(errno) : "short write"); - return -1; + goto exit_free; } if (json_output) @@ -771,7 +771,7 @@ prog_dump(struct bpf_prog_info *info, enum dump_mode mode, info->netns_ino, &disasm_opt); if (!name) - return -1; + goto exit_free; } if (info->nr_jited_func_lens && info->jited_func_lens) { @@ -866,9 +866,12 @@ prog_dump(struct bpf_prog_info *info, enum dump_mode mode, kernel_syms_destroy(&dd); } - btf__free(btf); + err = 0; - return 0; +exit_free: + btf__free(btf); + bpf_prog_linfo__free(prog_linfo); + return err; } static int do_dump(int argc, char **argv) From patchwork Wed Nov 10 11:46:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Monnet X-Patchwork-Id: 12611941 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6463EC433EF for ; Wed, 10 Nov 2021 11:46:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 43B4D610F7 for ; Wed, 10 Nov 2021 11:46:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231441AbhKJLt0 (ORCPT ); Wed, 10 Nov 2021 06:49:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231370AbhKJLtZ (ORCPT ); Wed, 10 Nov 2021 06:49:25 -0500 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37A21C061766 for ; Wed, 10 Nov 2021 03:46:38 -0800 (PST) Received: by mail-wr1-x431.google.com with SMTP id u1so3450953wru.13 for ; Wed, 10 Nov 2021 03:46:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=isovalent-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=P1MDAXqBUvRJAO6xX7CxMMNI+Qac5fxw54rz9pUhfVg=; b=Waqi7E8BLBXjAbSCNLrpy/QjzH1mUJi3N0z8KUKzealmkdypPGa1wtdTf8qmF0MmP7 yOAFklIeu5pkqc9e2svZca+riQZf7/V4NcIYUag+jh7SGHxCV3iH+GlOjG1OETK/oIb+ gaRCcmgeGBrhxUu6zQScXIy61b3bi/6g+3e2T7gEOSxgwo8oh0uO0Q+hWRgTHTSWVzUl X5B7k2smSMFrqIvIk7MzvP0I6NxNllmJur3Qg922yFLPpImmMsfrZWwDRnoWDXVBilgL IiCQyANraaB9poiQdtl0wDsrKbwhU3iGW2HSdijUer/TCNmmi3kSqNI+tPx/IZVjCgBR jJ6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=P1MDAXqBUvRJAO6xX7CxMMNI+Qac5fxw54rz9pUhfVg=; b=JP14O3oTdQFc2bUcbbDbQbbnkV4pNYeekd+AdmTCuagMGebwjr2pP7f9b2A2qOi1b2 nMLGVFsqFvNzgjgqbD0lklqCHOkMrx2rDLaIDpf0pg0XbisWyEyk69hGT/mT3g8C1fod jfLuX16q6vohPMjXJKxCGUkJVSiN0w/Y4yLIhqCDvyS24Ql0WW0DJZu3Z2S5+f9k1UO7 tJWDz0UWUdwc6JKf95eMd6SsKnsKOUBOa9klHyX5sloI+3IMYbpQmP+HgxPZogYBsYhu zX+hvF55iKYd0CjLCjO61lV201TCAyG1UAAYi76Sg9elJzrdVv41JAdA4G587DUypob3 yWyQ== X-Gm-Message-State: AOAM533pPv5yL09TDlieaIesiOrX2oX4BO/oxUD3VK+1EVP8zNrr0dID foOkkLhdRjAWbnrKdriAn8G6lw== X-Google-Smtp-Source: ABdhPJw5T27/A7hBYtGaWe4tAQY+JwONJqYBBWhWVyo7CT0DHN22IUT0sj3hZH856ktz3z+wMFpfCg== X-Received: by 2002:adf:fc88:: with SMTP id g8mr19361660wrr.334.1636544796828; Wed, 10 Nov 2021 03:46:36 -0800 (PST) Received: from localhost.localdomain ([149.86.79.190]) by smtp.gmail.com with ESMTPSA id i15sm6241152wmq.18.2021.11.10.03.46.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Nov 2021 03:46:36 -0800 (PST) From: Quentin Monnet To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko Cc: netdev@vger.kernel.org, bpf@vger.kernel.org, Quentin Monnet Subject: [PATCH bpf-next 2/6] bpftool: Remove inclusion of utilities.mak from Makefiles Date: Wed, 10 Nov 2021 11:46:28 +0000 Message-Id: <20211110114632.24537-3-quentin@isovalent.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211110114632.24537-1-quentin@isovalent.com> References: <20211110114632.24537-1-quentin@isovalent.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net Bpftool's Makefile, and the Makefile for its documentation, both include scripts/utilities.mak, but they use none of the items defined in this file. Remove the includes. Fixes: 71bb428fe2c1 ("tools: bpf: add bpftool") Signed-off-by: Quentin Monnet --- tools/bpf/bpftool/Documentation/Makefile | 1 - tools/bpf/bpftool/Makefile | 1 - 2 files changed, 2 deletions(-) diff --git a/tools/bpf/bpftool/Documentation/Makefile b/tools/bpf/bpftool/Documentation/Makefile index c49487905ceb..f89929c7038d 100644 --- a/tools/bpf/bpftool/Documentation/Makefile +++ b/tools/bpf/bpftool/Documentation/Makefile @@ -1,6 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only include ../../../scripts/Makefile.include -include ../../../scripts/utilities.mak INSTALL ?= install RM ?= rm -f diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile index c0c30e56988f..2a846cb92120 100644 --- a/tools/bpf/bpftool/Makefile +++ b/tools/bpf/bpftool/Makefile @@ -1,6 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only include ../../scripts/Makefile.include -include ../../scripts/utilities.mak ifeq ($(srctree),) srctree := $(patsubst %/,%,$(dir $(CURDIR))) From patchwork Wed Nov 10 11:46:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Monnet X-Patchwork-Id: 12611943 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9543BC433FE for ; Wed, 10 Nov 2021 11:46:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7A8C761152 for ; Wed, 10 Nov 2021 11:46:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231464AbhKJLt1 (ORCPT ); Wed, 10 Nov 2021 06:49:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231370AbhKJLt1 (ORCPT ); Wed, 10 Nov 2021 06:49:27 -0500 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EB58C061764 for ; Wed, 10 Nov 2021 03:46:39 -0800 (PST) Received: by mail-wm1-x32e.google.com with SMTP id b184-20020a1c1bc1000000b0033140bf8dd5so1717470wmb.5 for ; Wed, 10 Nov 2021 03:46:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=isovalent-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uFsDhVwNfx2+wkoea0+L+uj6nk2RYNAhjgBsFkxBpOc=; b=LGuOHPNv5SM+Efl20xjITHcexnv/lLd9xDAvK0xXDYAM1Zuzey8RxnUiiLUbO2RO4Q l2LboeCRNrAKIpCsRdQ0zTmbU3D+IWFZ7Flqbcu6mlYNePFyZqgT2Dr1QnQhKrQFVkV5 Bop2d6/nCinD7lw87akAXcFWfV8IHnDtFzyAc9HIqKv3tlc2/mJe5I9zUkUlSFZUg6F/ a+o/jpb45DZSLo5OO5UJ21FdK244oIZ95VUbXO5Kvh2H2XWrq8SnvTsLiffZLP2/1IMH l9WmJR0HSmiRngOEQU9g62y3RFbAyaXy2vLEpdWAThQYWXywxej13J6k9ZN5L0rIcOn9 lxgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uFsDhVwNfx2+wkoea0+L+uj6nk2RYNAhjgBsFkxBpOc=; b=IvtQW6HEEQSeiatwcG+9d/a8v8ZljisGrNnY6Z9RXUdkvsrwLUd7ZjDvmkdERN/NkC aFdrBUUgf8ZBMfTUNx2aLoUbRvbQ/m4v185CdfrrgLiTpPEfNuEdCBEvCkYl2lwo0FNP DwhlZ/hkHuwtTmSBGVs5IdL2FyuHVzHulYkKk84SgOJu1rW3a4gHSSsJS9Lz49iypXZf 6dBGCvgRrz50bzNhDyVOxrCSCb9fbDukyqFZUdZm0KkB7LGxYQjZ0rtk1hYBMqCB2MGh /SwV/viACwVKInJx3PX78clpJxwHcETOj1FYsUSTm9Gj4KDGzHCW2TZAXrHl6JkbFvus kP7w== X-Gm-Message-State: AOAM530mASKUS/RmW/O9zh7y7RSPWVh4oC+4uMHQOIFzURU5ZsxPsHw5 d2WsljGB4tiGJYDNMqZ0pC2C43PtL1KxGg== X-Google-Smtp-Source: ABdhPJzRX4of9vIT8wZ5LBq5RdCJb+hTM8osAAIprtsMS+oFv3HstM8wzOlGAQOEQlO9LH6Mmp+Qcg== X-Received: by 2002:a05:600c:5101:: with SMTP id o1mr15660896wms.81.1636544798013; Wed, 10 Nov 2021 03:46:38 -0800 (PST) Received: from localhost.localdomain ([149.86.79.190]) by smtp.gmail.com with ESMTPSA id i15sm6241152wmq.18.2021.11.10.03.46.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Nov 2021 03:46:37 -0800 (PST) From: Quentin Monnet To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko Cc: netdev@vger.kernel.org, bpf@vger.kernel.org, Quentin Monnet Subject: [PATCH bpf-next 3/6] bpftool: Use $(OUTPUT) and not $(O) for VMLINUX_BTF_PATHS in Makefile Date: Wed, 10 Nov 2021 11:46:29 +0000 Message-Id: <20211110114632.24537-4-quentin@isovalent.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211110114632.24537-1-quentin@isovalent.com> References: <20211110114632.24537-1-quentin@isovalent.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net The Makefile for bpftool relies on $(OUTPUT), and not on $(O), for passing the output directory. So $(VMLINUX_BTF_PATHS), used for searching for kernel BTF info, should use the same variable. Fixes: 05aca6da3b5a ("tools/bpftool: Generalize BPF skeleton support and generate vmlinux.h") Signed-off-by: Quentin Monnet --- tools/bpf/bpftool/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile index 2a846cb92120..40abf50b59d4 100644 --- a/tools/bpf/bpftool/Makefile +++ b/tools/bpf/bpftool/Makefile @@ -150,7 +150,7 @@ $(BOOTSTRAP_OBJS): $(LIBBPF_BOOTSTRAP) OBJS = $(patsubst %.c,$(OUTPUT)%.o,$(SRCS)) $(OUTPUT)disasm.o $(OBJS): $(LIBBPF) $(LIBBPF_INTERNAL_HDRS) -VMLINUX_BTF_PATHS ?= $(if $(O),$(O)/vmlinux) \ +VMLINUX_BTF_PATHS ?= $(if $(OUTPUT),$(OUTPUT)/vmlinux) \ $(if $(KBUILD_OUTPUT),$(KBUILD_OUTPUT)/vmlinux) \ ../../../vmlinux \ /sys/kernel/btf/vmlinux \ From patchwork Wed Nov 10 11:46:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Monnet X-Patchwork-Id: 12611945 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74E76C433EF for ; Wed, 10 Nov 2021 11:46:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6110661152 for ; Wed, 10 Nov 2021 11:46:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231455AbhKJLt2 (ORCPT ); Wed, 10 Nov 2021 06:49:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231401AbhKJLt1 (ORCPT ); Wed, 10 Nov 2021 06:49:27 -0500 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56472C061767 for ; Wed, 10 Nov 2021 03:46:40 -0800 (PST) Received: by mail-wm1-x32c.google.com with SMTP id y84-20020a1c7d57000000b00330cb84834fso4376622wmc.2 for ; Wed, 10 Nov 2021 03:46:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=isovalent-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xKjwFhBQSI7LBT94YR7j5voYDL7V60GODHnD8sNb0VA=; b=U0G4KC8fi0rqH4UNf50TsZUJW8VA5IHAPSOrXRktg9DfrZFRW9fRrdR4AqTHCVSMTR ZZfJ1j86C7AeSVm7Dey2cvXVgncxI77qUkDOnYlqzexQamfJg6BSqiq5xYg8bu5xJskN hErHHd3w1H3zpPYV3xvJhSfpTG1jK3z2xJ+seSA/P6FNS6TbofxiYpK39iX+JyCK059Q kAkdB6M3e0qmQ1pptXLDyk4v8UpUOjo+mTfBtHPCPpCVSN61vJXVRehr1BQO9uI2FJpi toSNk67/S2OqXoIz0i8FnKeFdQqH7VDkM5lmLZaKlUsOMu9ldJA1r9vz2apnaQWqfDdJ wV6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xKjwFhBQSI7LBT94YR7j5voYDL7V60GODHnD8sNb0VA=; b=3/FnZZle4Es3liMRZTWaxihVTtrP3aUa1l5xQtyh17IwPXiaZk70UEjkQO++d/7HnX LUkMdy3KlwQUuc/QLVrmWzWoziiDYxPbRFXo/Qk9X8lz3U0yVWkwRXjDq0GMgT4jF334 34FXsgBlaohCrDitJBdWJ6IocEXr5CfcaTlmrK3ifTRr81sBcdsAL3onWEUhUv3A6Ux6 79qS7NG8hcbTALpc5z3ubXtRZz/lJfncmoUMiwscF7hzDRYwLfWCXa1tdcFBH/imfQj5 +cu+CjP4qYJglmgxctNea/ILG06M56waqXtsacftQY7Q1+qXQbBnkGaPAnD9AKVlfh8T 1n1g== X-Gm-Message-State: AOAM531FGW5Rrw+bffSW9kfckwMFe1/Vkpksj3t1z6iuHPVE+hNlY0Mc EAU6hnOflKaYzsJYGepV+1Lz5Q== X-Google-Smtp-Source: ABdhPJywio37gAXUeAlgc2fMqGZkFs+eby6R/oTQiZbSRzC34obMp28KRzPMuGA2EIpzi2ieu8LW6w== X-Received: by 2002:a05:600c:4e94:: with SMTP id f20mr15303616wmq.77.1636544798959; Wed, 10 Nov 2021 03:46:38 -0800 (PST) Received: from localhost.localdomain ([149.86.79.190]) by smtp.gmail.com with ESMTPSA id i15sm6241152wmq.18.2021.11.10.03.46.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Nov 2021 03:46:38 -0800 (PST) From: Quentin Monnet To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko Cc: netdev@vger.kernel.org, bpf@vger.kernel.org, Quentin Monnet Subject: [PATCH bpf-next 4/6] bpftool: Fix indent in option lists in the documentation Date: Wed, 10 Nov 2021 11:46:30 +0000 Message-Id: <20211110114632.24537-5-quentin@isovalent.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211110114632.24537-1-quentin@isovalent.com> References: <20211110114632.24537-1-quentin@isovalent.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net Mixed indentation levels in the lists of options in bpftool's documentation produces some unexpected results. For the "bpftool" man page, it prints a warning: $ make -C bpftool.8 GEN bpftool.8 :26: (ERROR/3) Unexpected indentation. For other pages, there is no warning, but it results in a line break appearing in the option lists in the generated man pages. RST paragraphs should have a uniform indentation level. Let's fix it. Fixes: c07ba629df97 ("tools: bpftool: Update and synchronise option list in doc and help msg") Fixes: 8cc8c6357c8f ("tools: bpftool: Document and add bash completion for -L, -B options") Signed-off-by: Quentin Monnet --- tools/bpf/bpftool/Documentation/bpftool-btf.rst | 2 +- tools/bpf/bpftool/Documentation/bpftool-cgroup.rst | 2 +- tools/bpf/bpftool/Documentation/bpftool-gen.rst | 2 +- tools/bpf/bpftool/Documentation/bpftool-link.rst | 2 +- tools/bpf/bpftool/Documentation/bpftool-map.rst | 6 +++--- tools/bpf/bpftool/Documentation/bpftool-prog.rst | 8 ++++---- tools/bpf/bpftool/Documentation/bpftool.rst | 6 +++--- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tools/bpf/bpftool/Documentation/bpftool-btf.rst b/tools/bpf/bpftool/Documentation/bpftool-btf.rst index 88b28aa7431f..4425d942dd39 100644 --- a/tools/bpf/bpftool/Documentation/bpftool-btf.rst +++ b/tools/bpf/bpftool/Documentation/bpftool-btf.rst @@ -13,7 +13,7 @@ SYNOPSIS **bpftool** [*OPTIONS*] **btf** *COMMAND* *OPTIONS* := { { **-j** | **--json** } [{ **-p** | **--pretty** }] | {**-d** | **--debug** } | - { **-B** | **--base-btf** } } + { **-B** | **--base-btf** } } *COMMANDS* := { **dump** | **help** } diff --git a/tools/bpf/bpftool/Documentation/bpftool-cgroup.rst b/tools/bpf/bpftool/Documentation/bpftool-cgroup.rst index 3e4395eede4f..13a217a2503d 100644 --- a/tools/bpf/bpftool/Documentation/bpftool-cgroup.rst +++ b/tools/bpf/bpftool/Documentation/bpftool-cgroup.rst @@ -13,7 +13,7 @@ SYNOPSIS **bpftool** [*OPTIONS*] **cgroup** *COMMAND* *OPTIONS* := { { **-j** | **--json** } [{ **-p** | **--pretty** }] | { **-d** | **--debug** } | - { **-f** | **--bpffs** } } + { **-f** | **--bpffs** } } *COMMANDS* := { **show** | **list** | **tree** | **attach** | **detach** | **help** } diff --git a/tools/bpf/bpftool/Documentation/bpftool-gen.rst b/tools/bpf/bpftool/Documentation/bpftool-gen.rst index 2ef2f2df0279..2a137f8a4cea 100644 --- a/tools/bpf/bpftool/Documentation/bpftool-gen.rst +++ b/tools/bpf/bpftool/Documentation/bpftool-gen.rst @@ -13,7 +13,7 @@ SYNOPSIS **bpftool** [*OPTIONS*] **gen** *COMMAND* *OPTIONS* := { { **-j** | **--json** } [{ **-p** | **--pretty** }] | { **-d** | **--debug** } | - { **-L** | **--use-loader** } } + { **-L** | **--use-loader** } } *COMMAND* := { **object** | **skeleton** | **help** } diff --git a/tools/bpf/bpftool/Documentation/bpftool-link.rst b/tools/bpf/bpftool/Documentation/bpftool-link.rst index 0de90f086238..9434349636a5 100644 --- a/tools/bpf/bpftool/Documentation/bpftool-link.rst +++ b/tools/bpf/bpftool/Documentation/bpftool-link.rst @@ -13,7 +13,7 @@ SYNOPSIS **bpftool** [*OPTIONS*] **link** *COMMAND* *OPTIONS* := { { **-j** | **--json** } [{ **-p** | **--pretty** }] | { **-d** | **--debug** } | - { **-f** | **--bpffs** } | { **-n** | **--nomount** } } + { **-f** | **--bpffs** } | { **-n** | **--nomount** } } *COMMANDS* := { **show** | **list** | **pin** | **help** } diff --git a/tools/bpf/bpftool/Documentation/bpftool-map.rst b/tools/bpf/bpftool/Documentation/bpftool-map.rst index d0c4abe08aba..1445cadc15d4 100644 --- a/tools/bpf/bpftool/Documentation/bpftool-map.rst +++ b/tools/bpf/bpftool/Documentation/bpftool-map.rst @@ -13,11 +13,11 @@ SYNOPSIS **bpftool** [*OPTIONS*] **map** *COMMAND* *OPTIONS* := { { **-j** | **--json** } [{ **-p** | **--pretty** }] | { **-d** | **--debug** } | - { **-f** | **--bpffs** } | { **-n** | **--nomount** } } + { **-f** | **--bpffs** } | { **-n** | **--nomount** } } *COMMANDS* := - { **show** | **list** | **create** | **dump** | **update** | **lookup** | **getnext** - | **delete** | **pin** | **help** } + { **show** | **list** | **create** | **dump** | **update** | **lookup** | **getnext** | + **delete** | **pin** | **help** } MAP COMMANDS ============= diff --git a/tools/bpf/bpftool/Documentation/bpftool-prog.rst b/tools/bpf/bpftool/Documentation/bpftool-prog.rst index 91608cb7e44a..f27265bd589b 100644 --- a/tools/bpf/bpftool/Documentation/bpftool-prog.rst +++ b/tools/bpf/bpftool/Documentation/bpftool-prog.rst @@ -13,12 +13,12 @@ SYNOPSIS **bpftool** [*OPTIONS*] **prog** *COMMAND* *OPTIONS* := { { **-j** | **--json** } [{ **-p** | **--pretty** }] | { **-d** | **--debug** } | - { **-f** | **--bpffs** } | { **-m** | **--mapcompat** } | { **-n** | **--nomount** } | - { **-L** | **--use-loader** } } + { **-f** | **--bpffs** } | { **-m** | **--mapcompat** } | { **-n** | **--nomount** } | + { **-L** | **--use-loader** } } *COMMANDS* := - { **show** | **list** | **dump xlated** | **dump jited** | **pin** | **load** - | **loadall** | **help** } + { **show** | **list** | **dump xlated** | **dump jited** | **pin** | **load** | + **loadall** | **help** } PROG COMMANDS ============= diff --git a/tools/bpf/bpftool/Documentation/bpftool.rst b/tools/bpf/bpftool/Documentation/bpftool.rst index bb23f55bb05a..8ac86565c501 100644 --- a/tools/bpf/bpftool/Documentation/bpftool.rst +++ b/tools/bpf/bpftool/Documentation/bpftool.rst @@ -19,14 +19,14 @@ SYNOPSIS *OBJECT* := { **map** | **program** | **cgroup** | **perf** | **net** | **feature** } *OPTIONS* := { { **-V** | **--version** } | - { **-j** | **--json** } [{ **-p** | **--pretty** }] | { **-d** | **--debug** } } + { **-j** | **--json** } [{ **-p** | **--pretty** }] | { **-d** | **--debug** } } *MAP-COMMANDS* := { **show** | **list** | **create** | **dump** | **update** | **lookup** | **getnext** | - **delete** | **pin** | **event_pipe** | **help** } + **delete** | **pin** | **event_pipe** | **help** } *PROG-COMMANDS* := { **show** | **list** | **dump jited** | **dump xlated** | **pin** | - **load** | **attach** | **detach** | **help** } + **load** | **attach** | **detach** | **help** } *CGROUP-COMMANDS* := { **show** | **list** | **attach** | **detach** | **help** } From patchwork Wed Nov 10 11:46:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Monnet X-Patchwork-Id: 12611947 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3D56BC4332F for ; Wed, 10 Nov 2021 11:46:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 28153610F7 for ; Wed, 10 Nov 2021 11:46:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231401AbhKJLt3 (ORCPT ); Wed, 10 Nov 2021 06:49:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231467AbhKJLt2 (ORCPT ); Wed, 10 Nov 2021 06:49:28 -0500 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AFC0C061766 for ; Wed, 10 Nov 2021 03:46:41 -0800 (PST) Received: by mail-wm1-x32f.google.com with SMTP id z200so1898660wmc.1 for ; Wed, 10 Nov 2021 03:46:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=isovalent-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=czAlx45XekS6T7E6vCDjy/iYH9MvCYJzu7jpipCouho=; b=yKmTdcdutKR305mFcuyPviyqxNGSrNMBCloV/7DKiITAeJxRm8/gKgb2tyHfCN2++k jH9Zk3OVlIg7TewyylbO3z8FeSVmTwwBjQZ4JxuowCBfjHMua7fMVLGCHxp87S53z7oP Ld89268IMEOjZ5rJxSpDgroEvocdwHyF3KfYCnMCv1ArCSKCh4J+sA+KPLomCA1sLnK7 sNHiWN+/TELe+Um9Lji2NlrUbfc/0/XskJFcpVS3sPsUHe9URctNOlI8jY7a+9P6Q65Z mq68dceX43MMHqGv1cRMZtBbROJ15IW4/n4LXJpTK7ngDsYq9la1bET9SIxFUWb3Hb8b uY5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=czAlx45XekS6T7E6vCDjy/iYH9MvCYJzu7jpipCouho=; b=4WEU6TzsTauEC6UWEk+PE95Ry3cjcsxr4U42QeGITTzJQ6mk3LM5Si6jOIxSHqs8vO NDHFhqWT7Fj3pm4YqwKkAwZMFG89y8ghZV8LCsZFTgp9VhR/JlBq/DrT6sLLuARQQCqh ybGUbGCQF9oI7+fRRdLBNVXNyvK/QRCeqAG2jyV1SB4aZwB5x7KJxhfpvo1FGJneexVY 1jaOiDoxZ7X4IazJnXA1LorOgOrTOrIUkTbOcoT2AKtMB9utaFmZ20mS07RZLygEoZVc lI7VFaKErq2/ztwiAX3kbqfZWxBSEqynwYWw9ZqVWFarJEUVGx5rNC/2zyUc5urFaS2+ VN2w== X-Gm-Message-State: AOAM533M+4srgDLTSkyXEjrvlIUq54F2odtwH0IEpt16RjKf8FSUnSj6 sakaJWQTe6KgFJ6y2Uv34dhJWQ== X-Google-Smtp-Source: ABdhPJxJ8a3seoMJLfdJVggYTKQNpgbOUoC3EZca3uGdC/2c355Z5J/PTV7zmc3WtHY+29aOxtEi0w== X-Received: by 2002:a05:600c:2206:: with SMTP id z6mr15498712wml.132.1636544799753; Wed, 10 Nov 2021 03:46:39 -0800 (PST) Received: from localhost.localdomain ([149.86.79.190]) by smtp.gmail.com with ESMTPSA id i15sm6241152wmq.18.2021.11.10.03.46.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Nov 2021 03:46:39 -0800 (PST) From: Quentin Monnet To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko Cc: netdev@vger.kernel.org, bpf@vger.kernel.org, Quentin Monnet Subject: [PATCH bpf-next 5/6] bpftool: Update the lists of names for maps and prog-attach types Date: Wed, 10 Nov 2021 11:46:31 +0000 Message-Id: <20211110114632.24537-6-quentin@isovalent.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211110114632.24537-1-quentin@isovalent.com> References: <20211110114632.24537-1-quentin@isovalent.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net To support the different BPF map or attach types, bpftool must remain up-to-date with the types supported by the kernel. Let's update the lists, by adding the missing Bloom filter map type and the perf_event attach type. Both missing items were found with test_bpftool_synctypes.py. Signed-off-by: Quentin Monnet --- tools/bpf/bpftool/Documentation/bpftool-map.rst | 2 +- tools/bpf/bpftool/bash-completion/bpftool | 3 ++- tools/bpf/bpftool/common.c | 1 + tools/bpf/bpftool/map.c | 3 ++- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/bpf/bpftool/Documentation/bpftool-map.rst b/tools/bpf/bpftool/Documentation/bpftool-map.rst index 1445cadc15d4..991d18fd84f2 100644 --- a/tools/bpf/bpftool/Documentation/bpftool-map.rst +++ b/tools/bpf/bpftool/Documentation/bpftool-map.rst @@ -52,7 +52,7 @@ MAP COMMANDS | | **devmap** | **devmap_hash** | **sockmap** | **cpumap** | **xskmap** | **sockhash** | | **cgroup_storage** | **reuseport_sockarray** | **percpu_cgroup_storage** | | **queue** | **stack** | **sk_storage** | **struct_ops** | **ringbuf** | **inode_storage** - | **task_storage** } +| | **task_storage** | **bloom_filter** } DESCRIPTION =========== diff --git a/tools/bpf/bpftool/bash-completion/bpftool b/tools/bpf/bpftool/bash-completion/bpftool index 88e2bcf16cca..b57f318ed649 100644 --- a/tools/bpf/bpftool/bash-completion/bpftool +++ b/tools/bpf/bpftool/bash-completion/bpftool @@ -710,7 +710,8 @@ _bpftool() hash_of_maps devmap devmap_hash sockmap cpumap \ xskmap sockhash cgroup_storage reuseport_sockarray \ percpu_cgroup_storage queue stack sk_storage \ - struct_ops inode_storage task_storage ringbuf' + struct_ops ringbuf inode_storage task_storage \ + bloom_filter' COMPREPLY=( $( compgen -W "$BPFTOOL_MAP_CREATE_TYPES" -- "$cur" ) ) return 0 ;; diff --git a/tools/bpf/bpftool/common.c b/tools/bpf/bpftool/common.c index 511eccdbdfe6..fa8eb8134344 100644 --- a/tools/bpf/bpftool/common.c +++ b/tools/bpf/bpftool/common.c @@ -74,6 +74,7 @@ const char * const attach_type_name[__MAX_BPF_ATTACH_TYPE] = { [BPF_XDP] = "xdp", [BPF_SK_REUSEPORT_SELECT] = "sk_skb_reuseport_select", [BPF_SK_REUSEPORT_SELECT_OR_MIGRATE] = "sk_skb_reuseport_select_or_migrate", + [BPF_PERF_EVENT] = "perf_event", }; void p_err(const char *fmt, ...) diff --git a/tools/bpf/bpftool/map.c b/tools/bpf/bpftool/map.c index cae1f1119296..68cb121e65c4 100644 --- a/tools/bpf/bpftool/map.c +++ b/tools/bpf/bpftool/map.c @@ -53,6 +53,7 @@ const char * const map_type_name[] = { [BPF_MAP_TYPE_RINGBUF] = "ringbuf", [BPF_MAP_TYPE_INODE_STORAGE] = "inode_storage", [BPF_MAP_TYPE_TASK_STORAGE] = "task_storage", + [BPF_MAP_TYPE_BLOOM_FILTER] = "bloom_filter", }; const size_t map_type_name_size = ARRAY_SIZE(map_type_name); @@ -1477,7 +1478,7 @@ static int do_help(int argc, char **argv) " devmap | devmap_hash | sockmap | cpumap | xskmap | sockhash |\n" " cgroup_storage | reuseport_sockarray | percpu_cgroup_storage |\n" " queue | stack | sk_storage | struct_ops | ringbuf | inode_storage |\n" - " task_storage }\n" + " task_storage | bloom_filter }\n" " " HELP_SPEC_OPTIONS " |\n" " {-f|--bpffs} | {-n|--nomount} }\n" "", From patchwork Wed Nov 10 11:46:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Monnet X-Patchwork-Id: 12611949 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82AF4C433F5 for ; Wed, 10 Nov 2021 11:46:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 704CB610F7 for ; Wed, 10 Nov 2021 11:46:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231487AbhKJLta (ORCPT ); Wed, 10 Nov 2021 06:49:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231473AbhKJLt3 (ORCPT ); Wed, 10 Nov 2021 06:49:29 -0500 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 186E3C061766 for ; Wed, 10 Nov 2021 03:46:42 -0800 (PST) Received: by mail-wm1-x330.google.com with SMTP id 77-20020a1c0450000000b0033123de3425so4404651wme.0 for ; Wed, 10 Nov 2021 03:46:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=isovalent-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+WeD3KpnuzAogYoo0Fzko2zvRDHXEul7LGZwbgrCd2g=; b=ChNZ7Yib7GsLqjHfQYqhRTSgynXyFEx+cUVopa/d517A0ta7Iw92OVdTDTXQQ/pSPN YYZUIHHLwDLmWknl03yTjXE3YCEnoWWECaetFyTZEzwYXr7QnyQoteIy3YxfT276pz1w XDhPbenszTBcPMDv35f221Zdwer2OsIQ1wcioCiblfX9Xf1zNhzDPRqpUfZof8QSD8Bj LJLwdayPOYqpesLUkTc1qmXHG1BxU1YZWpMfaz9QGOt9ofhmp7Gg8akfFdAzfnaGDnJm LzdtBj8P/+pU/nqC+b1m5v4skvsWI6Q+aFtWHZAqUwVwYvoUR0boA8TYHz2hNqW3ME3k QE7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+WeD3KpnuzAogYoo0Fzko2zvRDHXEul7LGZwbgrCd2g=; b=6is8m5d54T2FNXAZ4125t4VEadb78qHFwCVREZ4QGgdbNluNPo39n+a4jJnz36feCO p6RFGmxGSyryhcSbdGo1LjFf6xBFa7+j87u2bzA50L3KfG4OWfHTccMtnon3B6AQcwdP VrWZRZLaWlKPH4iyuI6TbIhKcIn7w2X0CMxHS3hjoMifEHn2bVFuBVZq8dH0yoMq4Rcd 2f3IbDdtPD+n51wcIX7wmnnAI4/71j7n3uHdVAM/iY+HwKO2REwQbIyCc4LPDVhXfVlJ W8+zrq0FQXeVMMCvKGHqKdAyLQd0d+EI8RlcksJNMemcaTuyj2RGyRz4ySMzKtEgwFNc 3OJw== X-Gm-Message-State: AOAM5303hypuKmW6DdI3VUWTEH/fqr3k4fw7Xj6Sd+SZeW0iQCLVHUYE kC8c9yL7Pne2DbUldKDAm458p0yqSlMg4A== X-Google-Smtp-Source: ABdhPJzHhohJYOAnDT33oQtmFXEC8jh4rEQNBXwB43fpXdlxLAonyPbyVUNJdbfPSP+D1CKD5+To4g== X-Received: by 2002:a1c:e912:: with SMTP id q18mr16442857wmc.121.1636544800618; Wed, 10 Nov 2021 03:46:40 -0800 (PST) Received: from localhost.localdomain ([149.86.79.190]) by smtp.gmail.com with ESMTPSA id i15sm6241152wmq.18.2021.11.10.03.46.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Nov 2021 03:46:40 -0800 (PST) From: Quentin Monnet To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko Cc: netdev@vger.kernel.org, bpf@vger.kernel.org, Quentin Monnet Subject: [PATCH bpf-next 6/6] bpftool: Fix mixed indentation in documentation Date: Wed, 10 Nov 2021 11:46:32 +0000 Message-Id: <20211110114632.24537-7-quentin@isovalent.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211110114632.24537-1-quentin@isovalent.com> References: <20211110114632.24537-1-quentin@isovalent.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net Some paragraphs in bpftool's documentation have a mix of tabs and spaces for indentation. Let's make it consistent. This patch brings no change to the text content. Signed-off-by: Quentin Monnet --- .../bpftool/Documentation/bpftool-cgroup.rst | 10 +-- .../bpf/bpftool/Documentation/bpftool-net.rst | 62 +++++++++---------- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/tools/bpf/bpftool/Documentation/bpftool-cgroup.rst b/tools/bpf/bpftool/Documentation/bpftool-cgroup.rst index 13a217a2503d..8069d37dd991 100644 --- a/tools/bpf/bpftool/Documentation/bpftool-cgroup.rst +++ b/tools/bpf/bpftool/Documentation/bpftool-cgroup.rst @@ -30,9 +30,9 @@ CGROUP COMMANDS | *PROG* := { **id** *PROG_ID* | **pinned** *FILE* | **tag** *PROG_TAG* } | *ATTACH_TYPE* := { **ingress** | **egress** | **sock_create** | **sock_ops** | **device** | | **bind4** | **bind6** | **post_bind4** | **post_bind6** | **connect4** | **connect6** | -| **getpeername4** | **getpeername6** | **getsockname4** | **getsockname6** | **sendmsg4** | -| **sendmsg6** | **recvmsg4** | **recvmsg6** | **sysctl** | **getsockopt** | **setsockopt** | -| **sock_release** } +| **getpeername4** | **getpeername6** | **getsockname4** | **getsockname6** | **sendmsg4** | +| **sendmsg6** | **recvmsg4** | **recvmsg6** | **sysctl** | **getsockopt** | **setsockopt** | +| **sock_release** } | *ATTACH_FLAGS* := { **multi** | **override** } DESCRIPTION @@ -98,9 +98,9 @@ DESCRIPTION **sendmsg6** call to sendto(2), sendmsg(2), sendmmsg(2) for an unconnected udp6 socket (since 4.18); **recvmsg4** call to recvfrom(2), recvmsg(2), recvmmsg(2) for - an unconnected udp4 socket (since 5.2); + an unconnected udp4 socket (since 5.2); **recvmsg6** call to recvfrom(2), recvmsg(2), recvmmsg(2) for - an unconnected udp6 socket (since 5.2); + an unconnected udp6 socket (since 5.2); **sysctl** sysctl access (since 5.2); **getsockopt** call to getsockopt (since 5.3); **setsockopt** call to setsockopt (since 5.3); diff --git a/tools/bpf/bpftool/Documentation/bpftool-net.rst b/tools/bpf/bpftool/Documentation/bpftool-net.rst index 1ae0375e8fea..7ec57535a7c1 100644 --- a/tools/bpf/bpftool/Documentation/bpftool-net.rst +++ b/tools/bpf/bpftool/Documentation/bpftool-net.rst @@ -31,44 +31,44 @@ NET COMMANDS DESCRIPTION =========== **bpftool net { show | list }** [ **dev** *NAME* ] - List bpf program attachments in the kernel networking subsystem. + List bpf program attachments in the kernel networking subsystem. - Currently, only device driver xdp attachments and tc filter - classification/action attachments are implemented, i.e., for - program types **BPF_PROG_TYPE_SCHED_CLS**, - **BPF_PROG_TYPE_SCHED_ACT** and **BPF_PROG_TYPE_XDP**. - For programs attached to a particular cgroup, e.g., - **BPF_PROG_TYPE_CGROUP_SKB**, **BPF_PROG_TYPE_CGROUP_SOCK**, - **BPF_PROG_TYPE_SOCK_OPS** and **BPF_PROG_TYPE_CGROUP_SOCK_ADDR**, - users can use **bpftool cgroup** to dump cgroup attachments. - For sk_{filter, skb, msg, reuseport} and lwt/seg6 - bpf programs, users should consult other tools, e.g., iproute2. + Currently, only device driver xdp attachments and tc filter + classification/action attachments are implemented, i.e., for + program types **BPF_PROG_TYPE_SCHED_CLS**, + **BPF_PROG_TYPE_SCHED_ACT** and **BPF_PROG_TYPE_XDP**. + For programs attached to a particular cgroup, e.g., + **BPF_PROG_TYPE_CGROUP_SKB**, **BPF_PROG_TYPE_CGROUP_SOCK**, + **BPF_PROG_TYPE_SOCK_OPS** and **BPF_PROG_TYPE_CGROUP_SOCK_ADDR**, + users can use **bpftool cgroup** to dump cgroup attachments. + For sk_{filter, skb, msg, reuseport} and lwt/seg6 + bpf programs, users should consult other tools, e.g., iproute2. - The current output will start with all xdp program attachments, followed by - all tc class/qdisc bpf program attachments. Both xdp programs and - tc programs are ordered based on ifindex number. If multiple bpf - programs attached to the same networking device through **tc filter**, - the order will be first all bpf programs attached to tc classes, then - all bpf programs attached to non clsact qdiscs, and finally all - bpf programs attached to root and clsact qdisc. + The current output will start with all xdp program attachments, followed by + all tc class/qdisc bpf program attachments. Both xdp programs and + tc programs are ordered based on ifindex number. If multiple bpf + programs attached to the same networking device through **tc filter**, + the order will be first all bpf programs attached to tc classes, then + all bpf programs attached to non clsact qdiscs, and finally all + bpf programs attached to root and clsact qdisc. **bpftool** **net attach** *ATTACH_TYPE* *PROG* **dev** *NAME* [ **overwrite** ] - Attach bpf program *PROG* to network interface *NAME* with - type specified by *ATTACH_TYPE*. Previously attached bpf program - can be replaced by the command used with **overwrite** option. - Currently, only XDP-related modes are supported for *ATTACH_TYPE*. + Attach bpf program *PROG* to network interface *NAME* with + type specified by *ATTACH_TYPE*. Previously attached bpf program + can be replaced by the command used with **overwrite** option. + Currently, only XDP-related modes are supported for *ATTACH_TYPE*. - *ATTACH_TYPE* can be of: - **xdp** - try native XDP and fallback to generic XDP if NIC driver does not support it; - **xdpgeneric** - Generic XDP. runs at generic XDP hook when packet already enters receive path as skb; - **xdpdrv** - Native XDP. runs earliest point in driver's receive path; - **xdpoffload** - Offload XDP. runs directly on NIC on each packet reception; + *ATTACH_TYPE* can be of: + **xdp** - try native XDP and fallback to generic XDP if NIC driver does not support it; + **xdpgeneric** - Generic XDP. runs at generic XDP hook when packet already enters receive path as skb; + **xdpdrv** - Native XDP. runs earliest point in driver's receive path; + **xdpoffload** - Offload XDP. runs directly on NIC on each packet reception; **bpftool** **net detach** *ATTACH_TYPE* **dev** *NAME* - Detach bpf program attached to network interface *NAME* with - type specified by *ATTACH_TYPE*. To detach bpf program, same - *ATTACH_TYPE* previously used for attach must be specified. - Currently, only XDP-related modes are supported for *ATTACH_TYPE*. + Detach bpf program attached to network interface *NAME* with + type specified by *ATTACH_TYPE*. To detach bpf program, same + *ATTACH_TYPE* previously used for attach must be specified. + Currently, only XDP-related modes are supported for *ATTACH_TYPE*. **bpftool net help** Print short help message.