Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9802891ybi; Wed, 24 Jul 2019 10:12:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqxAz2tSJ/iLsVrMvCl/UIU12WmyOwWx3p/s7fVXVtziYfOm5w14ZNRUUpwFe3NBOnc1prmg X-Received: by 2002:a63:f443:: with SMTP id p3mr837834pgk.345.1563988322388; Wed, 24 Jul 2019 10:12:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563988322; cv=none; d=google.com; s=arc-20160816; b=llcYyWfqYSwhDWibyIdJgGg0pzrW3NYhu1WrtcnMqtimZg+x8gEmhfWIKbQmbS+Fzg ySqaYzS/lKuBD2L08jw4WYrrGdNPE+ug28DEctAEDyir1+SrHiKaIGEy8JGUkbsBEILt NeMrvopNiTwEGaHL4bYD9pefJttZ5XbMnUXYlqfJJfPgfTmjxhSinX5FvqoDgGILhTXY cEyI3Ax/z0dFZoOXgW60vrpifwT18wRDWhHKcveRiga+QYMlau9Il196G0qFgsV0TTt4 iyVIQ6yAEBSx++YH4KGjI45wrRTDYysMc+MVmuiapM/xNapFqgEfSZUotnoH/saAZT+W m9tQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:references :mime-version:message-id:in-reply-to:date:dkim-signature; bh=HR+i5k9D3xN0HWRoWeihUWIzPrhjF/a9nve8ODtPhD0=; b=EYdFrINI4Onwps4eUaWfQ5I3QoFNmC3YSM/jTgZmJdBGDWiqUjIp1fnn52+HKLDM7X nUnzt5tWvK08MmjWnAh/+sMuoyJAXuBNIHz8JReVK4+bLBTS4xIYtaqY5Vsnh2jCzrFq jBQLUtTatNSXtheFwmLA+H5fJDDTQwXeYSXEx18INi9Wv4BtJjBOwaxkbhfT87Rax7pi qqSbZxXw8qWvS0w3pGVUpVHzRVvknvWYoWwOK2MuT8hasdsKb4sby+gmByuNBgEtRcKg ehqjt+bJUzmHUrp+2o0g5Z+0Efm3GomSGN+AFahr54tbxqGPYk5KjryXUiAsiHJgy2WK wjWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Sqj8KFoP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q12si6555265pgk.102.2019.07.24.10.11.47; Wed, 24 Jul 2019 10:12:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Sqj8KFoP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728506AbfGXQ6h (ORCPT + 99 others); Wed, 24 Jul 2019 12:58:37 -0400 Received: from mail-pf1-f202.google.com ([209.85.210.202]:38185 "EHLO mail-pf1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387619AbfGXQ6e (ORCPT ); Wed, 24 Jul 2019 12:58:34 -0400 Received: by mail-pf1-f202.google.com with SMTP id e25so28950374pfn.5 for ; Wed, 24 Jul 2019 09:58:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=HR+i5k9D3xN0HWRoWeihUWIzPrhjF/a9nve8ODtPhD0=; b=Sqj8KFoPc7hD63y6Ke6KRZCuC892AJWxBiBjXl9lm7e3VHw7v9+2CPKEKkIIGVduBM +RBU0OzJVulCwCav3ICiM0TTFqCVjHo32X+Gfur0MmkdF5f2GDgfrmT1WIagFWh/eLk/ TfTRNQzkoI/Rmz8NQgzm6MtkfTWjehevn3uHkGkt71GlOorwiX63MNuUwmdGSK1TELYZ yZsjvh/nyXpdbATi79pq4jnwWfIB3+8JKgOd7lSJg16RSNjIDMyAHd2Wr/9b9d6aEVNe gVfwYSSWh8TBXcNRNU+IBM8ZgPWDd2ZdkP3MJYeVX+vkgj6Oq+OZ2br+9Ddj79zT7PRs HCuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=HR+i5k9D3xN0HWRoWeihUWIzPrhjF/a9nve8ODtPhD0=; b=OVASkMMoqQT8rO8zrQoCZXGLGBOBYExmLeM7iKOnE5t6A0NHQF5fRXsByGXI9GyfZm 5/aZvz/KHVTvCx25O6k0WLofwAQqR9WSBjD4GlpBu8Kh82dpjcTH5Azni7THpqvv4thO ySg5K4+1mXM3jUY6HOZtjwNzS2JqKGDfIoGlm1elhnUmwGox1Juto/DZ21IAdCkyBI9S i3/m5rCZjAtyDuezf14RMRmzbOQXL1uEdyJWa83CjLU6noKQbNYHn4w8T8vRZmbl+xZF n9VDjhl5hXOhZmdYXDFScZa8FyWXsgKMmCv7HZAH5s07Z27zdymsPQaASsqy7eNmCbCC Gabg== X-Gm-Message-State: APjAAAXw1PpokiI10EILugfkBOWPeCeBr3iNzNn3T5dokvQR2BtBoam4 EZrqOTeVZ0/bj+U1zpJkVecDPrTcc6d1 X-Received: by 2002:a63:3009:: with SMTP id w9mr7663984pgw.260.1563987513746; Wed, 24 Jul 2019 09:58:33 -0700 (PDT) Date: Wed, 24 Jul 2019 09:58:00 -0700 In-Reply-To: <20190724165803.87470-1-brianvv@google.com> Message-Id: <20190724165803.87470-4-brianvv@google.com> Mime-Version: 1.0 References: <20190724165803.87470-1-brianvv@google.com> X-Mailer: git-send-email 2.22.0.657.g960e92d24f-goog Subject: [PATCH bpf-next 3/6] bpf: keep bpf.h in sync with tools/ From: Brian Vazquez To: Brian Vazquez , Alexei Starovoitov , Daniel Borkmann , "David S . Miller" Cc: Stanislav Fomichev , Willem de Bruijn , Petar Penkov , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, Brian Vazquez Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Adds bpf_attr.dump structure to libbpf. Suggested-by: Stanislav Fomichev Signed-off-by: Brian Vazquez --- tools/include/uapi/linux/bpf.h | 9 +++++++++ tools/lib/bpf/libbpf.map | 2 ++ 2 files changed, 11 insertions(+) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index 4e455018da65f..e127f16e4e932 100644 --- a/tools/include/uapi/linux/bpf.h +++ b/tools/include/uapi/linux/bpf.h @@ -106,6 +106,7 @@ enum bpf_cmd { BPF_TASK_FD_QUERY, BPF_MAP_LOOKUP_AND_DELETE_ELEM, BPF_MAP_FREEZE, + BPF_MAP_DUMP, }; enum bpf_map_type { @@ -388,6 +389,14 @@ union bpf_attr { __u64 flags; }; + struct { /* struct used by BPF_MAP_DUMP command */ + __aligned_u64 prev_key; + __aligned_u64 buf; + __aligned_u64 buf_len; /* input/output: len of buf */ + __u64 flags; + __u32 map_fd; + } dump; + struct { /* anonymous struct used by BPF_PROG_LOAD command */ __u32 prog_type; /* one of enum bpf_prog_type */ __u32 insn_cnt; diff --git a/tools/lib/bpf/libbpf.map b/tools/lib/bpf/libbpf.map index f9d316e873d8d..cac3723d5c45c 100644 --- a/tools/lib/bpf/libbpf.map +++ b/tools/lib/bpf/libbpf.map @@ -183,4 +183,6 @@ LIBBPF_0.0.4 { perf_buffer__new; perf_buffer__new_raw; perf_buffer__poll; + bpf_map_dump; + bpf_map_dump_flags; } LIBBPF_0.0.3; -- 2.22.0.657.g960e92d24f-goog