From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC81DC33CB3 for ; Wed, 15 Jan 2020 00:46:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B113324658 for ; Wed, 15 Jan 2020 00:46:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Q+w4ML/E" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728949AbgAOAqN (ORCPT ); Tue, 14 Jan 2020 19:46:13 -0500 Received: from mail-qt1-f196.google.com ([209.85.160.196]:43237 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728795AbgAOAqN (ORCPT ); Tue, 14 Jan 2020 19:46:13 -0500 Received: by mail-qt1-f196.google.com with SMTP id d18so14280122qtj.10; Tue, 14 Jan 2020 16:46:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=s4r1q77v2s7ZfbF1lFyj2jG69/QqX8a/sPqCqv9z2TU=; b=Q+w4ML/ESIMWpC1fZG7nIOe9piH9hK34vUOcI8ptwCey5nH6SbQlk5tHgbWYxIaFOv V7gl3m21RueWZT/+6K3zxOzv+g1Q/CbFb7YcmeGFkFBUW4yGpHZO2uqml3CbqmLc8mKE +45q0e7j+uk3TJhBWYg7SU3+qQRuCW9Rbd5V39xiXv0+waCDCU17Fa3jkx8RZ85cgMKh /nmYxaOvN1XOrKKTNnmyBXYw1Ab55YCi5ebqHhJcgKQ91oo3/ekSmzt0Omn5ZL9Vthx6 n400S3wrTWTGB/Unai40vvgO/cLKUVFu6vqccktt4w43/Z0RhK7QKuF0HRBgcynxLZai WRmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=s4r1q77v2s7ZfbF1lFyj2jG69/QqX8a/sPqCqv9z2TU=; b=c/Al6pOm4PeiwtjilhM9mrzgoXXKQtn4bCKRXpgK+27Radz8bmUsTcC70GVNhL928q IFw/RgRai+cY5JJ0H4beLpjIZKjUbAZokZzi7bymqzW8yARaIFKLmbp8ETW62JoX+ZrP apMaoxlz5oVMv3sXPCkiepvjUn873NLaryyIxCV+rq2kDIh4N/e0TFKIJoSjkO6ZFoX6 h2jDaIGnyfLFM6qTyDKYZZ+ZqiPqmUZ8OSXTYO29Zec0gFVcusgH57bpeN++6Fx1ihfR EBQaAJTfQHdTa9p4kUPxm1E1PDW/ykVgu8FDwD87wguw+rQoMAJqU5vPmzBHcqV+Ln8j PkKw== X-Gm-Message-State: APjAAAVTy1kPKi9KzYnNohjMAezX8N5V452ZJxXYOccJKYDjw85Lwr5q ulFnXZz/R5pulJpo+4fpDXj9HX3HHyPuwj+W0D8= X-Google-Smtp-Source: APXvYqzYhDU86soYONX1MrheBhLVTkosBXTthKd8IDn4NsNllcFetjABmRkonlmp4ewmsuRyXXZHOrRnMJcUgkIpLbc= X-Received: by 2002:ac8:1385:: with SMTP id h5mr1212274qtj.59.1579049171812; Tue, 14 Jan 2020 16:46:11 -0800 (PST) MIME-Version: 1.0 References: <20200114164614.47029-1-brianvv@google.com> <20200114164614.47029-11-brianvv@google.com> In-Reply-To: <20200114164614.47029-11-brianvv@google.com> From: Andrii Nakryiko Date: Tue, 14 Jan 2020 16:46:00 -0800 Message-ID: Subject: Re: [PATCH v4 bpf-next 9/9] selftests/bpf: add batch ops testing to array bpf map To: Brian Vazquez Cc: Brian Vazquez , Alexei Starovoitov , Daniel Borkmann , "David S . Miller" , Yonghong Song , Stanislav Fomichev , Petar Penkov , Willem de Bruijn , open list , Networking , bpf 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 On Tue, Jan 14, 2020 at 8:46 AM Brian Vazquez wrote: > > Tested bpf_map_lookup_batch() and bpf_map_update_batch() > functionality. > > $ ./test_maps > ... > test_array_map_batch_ops:PASS > ... > > Signed-off-by: Brian Vazquez > Signed-off-by: Yonghong Song > --- > .../bpf/map_tests/array_map_batch_ops.c | 131 ++++++++++++++++++ > 1 file changed, 131 insertions(+) > create mode 100644 tools/testing/selftests/bpf/map_tests/array_map_batch_ops.c > > diff --git a/tools/testing/selftests/bpf/map_tests/array_map_batch_ops.c b/tools/testing/selftests/bpf/map_tests/array_map_batch_ops.c > new file mode 100644 > index 0000000000000..05b7caea6a444 > --- /dev/null > +++ b/tools/testing/selftests/bpf/map_tests/array_map_batch_ops.c > @@ -0,0 +1,131 @@ > +// SPDX-License-Identifier: GPL-2.0 > + > +#include > +#include > +#include > + > +#include > +#include > + > +#include > + > +static void map_batch_update(int map_fd, __u32 max_entries, int *keys, > + int *values) > +{ > + int i, err; > + > + DECLARE_LIBBPF_OPTS(bpf_map_batch_opts, opts, Here, below, and in other patch: DECLARE_LIBBPF_OPTS declares a local variable, so it shouldn't be separated from all the other variable declarations. > + .elem_flags = 0, > + .flags = 0, > + ); > + [...]