Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2584231ybd; Thu, 27 Jun 2019 15:15:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqy+nDxW6sSmkkvuxXVgaFPJc/VXf6u/gefSVoPwNfQZ5ChsvGIIm7mn8VaPWj/f6OuJZL0z X-Received: by 2002:a17:90a:23a4:: with SMTP id g33mr9063708pje.115.1561673714022; Thu, 27 Jun 2019 15:15:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561673714; cv=none; d=google.com; s=arc-20160816; b=NeeuX6A1kdsXq3rKOSuNF/DzMpurCxRlyW3oec4YrdyniOrjNnnDSO/I+PKfsgfnQm 0xtAbgevLQU2uzfbXbhjegJwLJePNTmEXBdhL6MKtreOS788QLRW5LK+zsMjsCOYjH7S lUPaqH5GVYHAjgke2oV5zlqR84QScwdaoHY4grDipWjIRMEJffXHFp5Hyz5Pmt7EIn92 CCkipdkxy7vsH6qlyaZRJMEjNcrDznFQo5jFfQCzclL2qXnA33v63kZCFxGe1q9QZShj OhaBQW7+8ChVkt9zdSdMvC8sPMr8cMa7KlJApZEme2QzaB0ob2A9i1F4R1DBq/+i70q0 J/BA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=NZXRbshkIzDoSjsEe6DOCALRS5cAnDLBAFY0PCjxxcU=; b=BUzDOH9hpoMkrwTe35knA32eo0Rh7xnGpLblfTBhlrvxwhj4uYHN+JUGzBkIW58xpc u3hFp2zU5nWNpLo0ezwe27Qp0nO+2s5ET67PanLZkR7tq73xdFczHcg2cDvamWOhT0es eYKe3v9T4/zJiUyom2lq81njc+aS1dnSsGL7PT/yYdHWLKE1LSoLYdxVJPozy3xylE0q evTGs666L5Mf6IKRVNMj45rpHXl8yZeCeWs84jTM+IKPOeIHkTGFlNp84sIQQI/Lwrbq tHTVPBxeu/EOaPw6w88kx8Hu8/exgjLbaCAFq7kPLDdpro4TQy6uvYjJ5BAcPSjkI6fI sUrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cBdX4Lpe; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v25si269531pff.274.2019.06.27.15.14.57; Thu, 27 Jun 2019 15:15:14 -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=@gmail.com header.s=20161025 header.b=cBdX4Lpe; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726818AbfF0WOj (ORCPT + 99 others); Thu, 27 Jun 2019 18:14:39 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:44839 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726445AbfF0WOi (ORCPT ); Thu, 27 Jun 2019 18:14:38 -0400 Received: by mail-pg1-f194.google.com with SMTP id n2so1621641pgp.11; Thu, 27 Jun 2019 15:14:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=NZXRbshkIzDoSjsEe6DOCALRS5cAnDLBAFY0PCjxxcU=; b=cBdX4LpeL+5vcJzIjdWukBMVOC25dcs8gOFk8FaXLeZh4mPQ1IqFwisSjMlNNNaHZZ vyULpV6qOd2TK95gmTBDrlWV40A+36b0wKcUNdXPqrYsHR5eOSVDTXeapan3VLKFTClX OZxaSnKCMbx/0JiYw40Sqp2SFmJjzz+1SJlbWTe3eeVKiOD05lMcOfTRF183iEoeZuaa +JcwA0nz5Vgd/nycUDCVEnFKH27S7GrEP4p9YLv2OF0s6KhhNf7tDC1jhm8ApnuYNIej lo5Lx/SGn7UeDl3q2IOxeyIl4y721mVaKAin81Ne7L2+M4K8z3ex1FcNzNVUCnfS773j 33jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=NZXRbshkIzDoSjsEe6DOCALRS5cAnDLBAFY0PCjxxcU=; b=X3tuDAXatyxYKTO3EGV7+CrqbTViU3siTc0szAs01Sniy4l1mq2UU4CKhmvLqn3zne d/yKci752zX7AbOGXZqasT5QJMI2WslkLzpmW4uraN0IXzyhq2xE0HGDR1hx47Y1d658 N38mrTKGOkX/PQ66Kw7qWyYVAQMj/8SD9wToiapDbBKQ//ohYPux0tsHgfpXCy03OJZ9 BouHdWer6JN1LRaGZlENT6DDLjVm7xUtsAdEYWkjRcfz9xMruyQKq0MCSlYya13+fKIC q/+XuUPcgXvKNnoaeJW34YMKBHv5V5q1nmMbRd/PVK1GdAgC5ZwrJuPYdq2qThYvkwMo BM/w== X-Gm-Message-State: APjAAAXLhE6OUA1MB9B+PNyDYggtJ0B6QVmDclckMv5lEY5qJ5TVrL2q j46r4FDl+NnVljASSCOC0CM= X-Received: by 2002:a63:e156:: with SMTP id h22mr5909967pgk.370.1561673678002; Thu, 27 Jun 2019 15:14:38 -0700 (PDT) Received: from ast-mbp.dhcp.thefacebook.com ([2620:10d:c090:200::1:305a]) by smtp.gmail.com with ESMTPSA id j2sm81162pfn.135.2019.06.27.15.14.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Jun 2019 15:14:37 -0700 (PDT) Date: Thu, 27 Jun 2019 15:14:36 -0700 From: Alexei Starovoitov To: Brian Vazquez Cc: Brian Vazquez , Alexei Starovoitov , Daniel Borkmann , "David S . Miller" , Stanislav Fomichev , Willem de Bruijn , Petar Penkov , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org Subject: Re: [RFC PATCH bpf-next v2 0/6] bpf: add BPF_MAP_DUMP command to Message-ID: <20190627221434.tz2fscw2cjvrqiop@ast-mbp.dhcp.thefacebook.com> References: <20190627202417.33370-1-brianvv@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190627202417.33370-1-brianvv@google.com> User-Agent: NeoMutt/20180223 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 27, 2019 at 01:24:11PM -0700, Brian Vazquez wrote: > This introduces a new command to retrieve a variable number of entries > from a bpf map. > > This new command can be executed from the existing BPF syscall as > follows: > > err = bpf(BPF_MAP_DUMP, union bpf_attr *attr, u32 size) > using attr->dump.map_fd, attr->dump.prev_key, attr->dump.buf, > attr->dump.buf_len > returns zero or negative error, and populates buf and buf_len on > succees > > This implementation is wrapping the existing bpf methods: > map_get_next_key and map_lookup_elem > the results show that even with a 1-elem_size buffer, it runs ~40 faster > than the current implementation, improvements of ~85% are reported when > the buffer size is increased, although, after the buffer size is around > 5% of the total number of entries there's no huge difference in > increasing > it. was it with kpti and retpoline mitigations?