Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp978036pxb; Thu, 15 Apr 2021 10:47:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyya1aW4phveEijOgRf3nlPUsxG81SoHFr6Ty7Jg0QHjwnP75hxs4XcliOnJAX1KBKMn8tK X-Received: by 2002:a17:902:8c92:b029:e8:fa73:ad22 with SMTP id t18-20020a1709028c92b02900e8fa73ad22mr4920180plo.66.1618508869022; Thu, 15 Apr 2021 10:47:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618508869; cv=none; d=google.com; s=arc-20160816; b=mcBgwfHiw392odDehefJkzk+QshH/tTScygcAL6LtGi80LQUtg1PedHQq25GrVUzZK AQLRFms6QkTI+mf6MrTOpqLIXMgT1okvP7K7zJJDbCFJuXlry/DbVZkEWGd+YMXWNkAl KYM68i08P23iqCcBOoGrQ2gX1GHHUMd1vlQfzVeemwWsn4+owm8Q0CGKo2zlrVhYMAMH v4fxrX8WGNC133lqGDqkdsJ4PtZpEsuB/n4EpwTDaVOXms/IuRA3a0RIL/MpJt5BDxVY yjGIFyCcAgzTHPVCQcK8V1knWENMNkCpGmk0dt8syGT2vYH1ImWBZ2pO//1k1nAozfRA RzxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:to:from:dkim-signature; bh=mhXBXYwoCRAXpMsd3KaS7b2rQuZgED58JI4YZLlaHjw=; b=Rth7Hy5YAHuK1LC/zF/Pff9kzTVKVcl/eJuEYUf+nVV+Eoaq7Y/NSzKVey+QVdqRRU nSJufFbqTB35kePntFVKDalSMGmBRcy5AxYW3F2zOKubopQZSO1Hw2FUBGKacI1mr9FB SIYYXEdNkydlqy/9qFKG0nULQWa/L2Lm8gjfQ3wxO1CsRzvLGo418ezESU6OENSIIkJA j0oEyWZqltOi+dw2HQHV0/V7zMAqrs+4irExMNPAB9Eeyp+/1b1K0NS42b2kYD6BF5D3 niVavxEPFBMsb0lVfpK2Fv/UgVDGkOLz8MVu6l+1cz8DLAu0NARvXgChGe2q7ASVWhwh jlmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="rFS3f0P/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id k136si4757278pgc.155.2021.04.15.10.47.34; Thu, 15 Apr 2021 10:47:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="rFS3f0P/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S234307AbhDORrT (ORCPT + 99 others); Thu, 15 Apr 2021 13:47:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233395AbhDORrT (ORCPT ); Thu, 15 Apr 2021 13:47:19 -0400 Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED45EC061574; Thu, 15 Apr 2021 10:46:55 -0700 (PDT) Received: by mail-qk1-x72a.google.com with SMTP id b139so20677136qkc.10; Thu, 15 Apr 2021 10:46:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=mhXBXYwoCRAXpMsd3KaS7b2rQuZgED58JI4YZLlaHjw=; b=rFS3f0P/A0txl5h5r1SSUvafPyq4dTlHtA+rjP92XjkbqprSJLz69eaMWg9GXXXQAG cO5K5EC+jt30W/aVIaA7zC+9TnGdNTfEwjNmKcRA4lw6Jtx7w/a5/cQMtZ2zD4zPfTwA b+ACdSdWyzL8MZLaMwFbQiynXjC9oCvUDhR/PW+Y/fC8f5pPU5Nl/4rB4ynkqRstXtcd KWqC0sqA+bfIHgjoXBp1wQdUUQ7pkYrPhwd3xfFENzQKgfr5B9cCiCKjWf0COOvweT65 PeuRhTZk7/TBglV6mRw1VvGGetQRKc7NWCZu0A79Oe4uS4jyb3OGqIJRk8l56YGKH0Mm pUFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=mhXBXYwoCRAXpMsd3KaS7b2rQuZgED58JI4YZLlaHjw=; b=BXVvHtR6gYlJmWQZo/R4jm0MOb9EWGGyf6X3qczVKNTYgmV44xsxbDvH2ZwsIBbFaa ztQV/N0/9XvMhrHe50JSvclKbAT2ALUfuXyjd+i0EaubrjdNqTmvQJWoykFwfH0aSNgc 7ofj9uTXwQR38hsb2/vNq4nctwKtLbEzp7f/6rpO8Nt0R+6v7n+3K7Vt7SkB7eaM0E68 wBVGcZzdALboBfXnHMtRdLf8lWqzQde6aqzYXXk2VvYD1eRnEiq4RpDNL3vIAkrCmJlF kRtwiOqpjSAFdPEKmOIdLDAYKNrC7HQGDmZ6IRv0cYvQGlkVXO4OuyKxNwEhY11/NCez nvSA== X-Gm-Message-State: AOAM530/j03Rz5y+A0DjxUqtDhfqPnfsC1W3ECnSucY5t581zI3ld69i zyJ2fs/VNchSnZesQYw+DkGoHTIHlIQMmTo8 X-Received: by 2002:a05:620a:1093:: with SMTP id g19mr4782578qkk.112.1618508815178; Thu, 15 Apr 2021 10:46:55 -0700 (PDT) Received: from localhost.localdomain ([179.218.4.27]) by smtp.gmail.com with ESMTPSA id a4sm2186800qta.19.2021.04.15.10.46.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Apr 2021 10:46:54 -0700 (PDT) From: Pedro Tammela X-Google-Original-From: Pedro Tammela To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Shuah Khan , Pedro Tammela , David Verbeiren , Matthieu Baerts , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH bpf-next v4 0/3] add batched ops for percpu array Date: Thu, 15 Apr 2021 14:46:16 -0300 Message-Id: <20210415174619.51229-1-pctammela@mojatatu.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patchset introduces batched operations for the per-cpu variant of the array map. It also removes the percpu macros from 'bpf_util.h'. This change was suggested by Andrii in a earlier iteration of this patchset. The tests were updated to reflect all the new changes. v3 -> v4: - Prefer 'calloc()' over 'malloc()' on batch ops tests - Add missing static keyword in a couple of test functions - 'offset' to 'cpu_offset' as suggested by Martin v2 -> v3: - Remove percpu macros as suggested by Andrii - Update tests that used the per cpu macros v1 -> v2: - Amended a more descriptive commit message Pedro Tammela (3): bpf: add batched ops support for percpu array bpf: selftests: remove percpu macros from bpf_util.h bpf: selftests: update array map tests for per-cpu batched ops kernel/bpf/arraymap.c | 2 + tools/testing/selftests/bpf/bpf_util.h | 7 -- .../bpf/map_tests/array_map_batch_ops.c | 104 +++++++++++++----- .../bpf/map_tests/htab_map_batch_ops.c | 87 +++++++-------- .../selftests/bpf/prog_tests/map_init.c | 9 +- tools/testing/selftests/bpf/test_maps.c | 84 ++++++++------ 6 files changed, 173 insertions(+), 120 deletions(-) -- 2.25.1