Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp978076pxb; Thu, 15 Apr 2021 10:47:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNuI4s07Gs17ZhhcCjfPFUE4xl0QADDC0B4QBIiFDVevaUJmse1Bu1Cx+w+/qQxbBHnDDT X-Received: by 2002:aa7:9f48:0:b029:249:c2d7:b7d1 with SMTP id h8-20020aa79f480000b0290249c2d7b7d1mr4054571pfr.81.1618508875752; Thu, 15 Apr 2021 10:47:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618508875; cv=none; d=google.com; s=arc-20160816; b=XZGiOOXzcsCtNYmHdoe2BRN7ELJMDB6/Dj8/Mn5hMMrLqIwL0bxcEf59whIr/TTfla XDOsbOCH7XAtbgaF3u5gIHTfO8wTwrPYfBUcSVTpPTUgd/63joX8sljQMhS4eT/AxEOk Dv813mFsBhlSFvCQSFlYRS7ZJrR3gfwrP/AdAEqpkMBTm9LzIlcnxWK0oWPXnoCNiXBn zkg36iwZbD12sFxeohi3EPO+s5rsM0oaalBC7bT1cFjvp6emlRA5sRBuRzR/ph8t+oYW 78yZhXXUqa5dSk6mgoxNWb+NFtmDKImLHlAdbeGPjBeQSDEXL7e07yuN45gBo06Jnyld ia4w== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=3DUapBlFjGRDJpFp34wiWQN/kbUJN43b6f1p6IDIwe8=; b=egflobQ5idzgbIIU1II3ZYtP0Y81qgAiJxlSq6OD16jKmR6jkko2Yirr1vy6cQv4Bo ZxzikMOaBmMvgLatCMqH+U0wHU6tkcsWCrEhEkjWkyKwL0xdRPYRAm39S1R6zztcIVwA fxp2a8EkWq2HO4TwZzBJhk1ajowv3TBPUEgDxVBXjRSPwl3GqX6BXsaXRcPyb7/igjjX ZP72PLrMOjwbw91PzzGe+uljYOlPCyp2zH7uelOUTkyQcfonappQnpb9ViO4jfOoayoL ESWv7FzOPLeBwOA1pn87mBJa/HQpeOum0JPzZNkMMRGFt3irKSw3AG5qVnwlewYOUixS K2qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EVH8wj78; 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 gn17si3874417pjb.56.2021.04.15.10.47.43; Thu, 15 Apr 2021 10:47:55 -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=EVH8wj78; 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 S234407AbhDORr2 (ORCPT + 99 others); Thu, 15 Apr 2021 13:47:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233395AbhDORr1 (ORCPT ); Thu, 15 Apr 2021 13:47:27 -0400 Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95B74C061574; Thu, 15 Apr 2021 10:47:00 -0700 (PDT) Received: by mail-qt1-x832.google.com with SMTP id f12so18844577qtf.2; Thu, 15 Apr 2021 10:47:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3DUapBlFjGRDJpFp34wiWQN/kbUJN43b6f1p6IDIwe8=; b=EVH8wj78V9r6uk1IbL4TTKoiOR4l22X8t8TAZWIbqh2Yl6oXksEcG3EOIYgj5sxh3A jsC1XpZnbQf7NjXK6PQhZ+qJ2FSQ0dnOJuTxnCqtbrvuhfOx6viKvrEtCx6hPCVwiNkv dQwRebSyByR3xmwVF20kPz3PmrkH34+nVMMw93MUIVGZVNB/LQEJ+319J2S9qdjlUCw7 pROdhJGIOC1vH6Dl3lFxVXVzpkPZ1/6irNs/iB1+Hx058ihTdN5xWfLakZjd3XJLG5GP W1yUDnLGTXUz1rrZa1O03u78YT73ovzMb9BlTKRfNzGxKpAblHNoVYOcuqpeKLjemPX+ jD1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3DUapBlFjGRDJpFp34wiWQN/kbUJN43b6f1p6IDIwe8=; b=YGpMzsp5lXEa+FtIUTbXPszxT91FXKYt9vWP4dws+TRI4FTNJpIZyGb93FNP89HfQo puTR1lW5l0Tf4MNMxpYfE/DkUaWcOR3NCMFjYU4hzAR8tzUt2f6Af2eOrFZmx3JDL7YD v+Sz5o8idmrx4TVCB/VoTA/4poBE5G/jedq3xYXrht1mDOwXyiIPb1/qNPQMclTqgqAc eaI+E3s78H3xN2XmuPk5k4hPhKHG+Srmo3O7b/+wuyCi+xYqlLPTZ9lM2E9CLsP5bjWr Dk202OUQEbp9W7x5JHOZsrSdek2Y/w4QPsLvXeDyd2Um99BAee8GMnArDRIgQ/VQ8iSt wdyw== X-Gm-Message-State: AOAM5323NQ9CwE5G2k4iYqZRbr2jqxV+IjT3/4M2iCroUyeiVRhnkyeL zU5btvgYxc/x+zFW2p09WXlIifCYbqRNjiLz X-Received: by 2002:ac8:7217:: with SMTP id a23mr4127708qtp.308.1618508819883; Thu, 15 Apr 2021 10:46:59 -0700 (PDT) Received: from localhost.localdomain ([179.218.4.27]) by smtp.gmail.com with ESMTPSA id a4sm2186800qta.19.2021.04.15.10.46.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Apr 2021 10:46:59 -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 Cc: Jamal Hadi Salim Subject: [PATCH bpf-next v4 1/3] bpf: add batched ops support for percpu array Date: Thu, 15 Apr 2021 14:46:17 -0300 Message-Id: <20210415174619.51229-2-pctammela@mojatatu.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210415174619.51229-1-pctammela@mojatatu.com> References: <20210415174619.51229-1-pctammela@mojatatu.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Uses the already in-place infrastructure provided by the 'generic_map_*_batch' functions. No tweak was needed as it transparently handles the percpu variant. As arrays don't have delete operations, let it return a error to user space (default behaviour). Suggested-by: Jamal Hadi Salim Signed-off-by: Pedro Tammela --- kernel/bpf/arraymap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/bpf/arraymap.c b/kernel/bpf/arraymap.c index 463d25e1e67e..3c4105603f9d 100644 --- a/kernel/bpf/arraymap.c +++ b/kernel/bpf/arraymap.c @@ -698,6 +698,8 @@ const struct bpf_map_ops percpu_array_map_ops = { .map_delete_elem = array_map_delete_elem, .map_seq_show_elem = percpu_array_map_seq_show_elem, .map_check_btf = array_map_check_btf, + .map_lookup_batch = generic_map_lookup_batch, + .map_update_batch = generic_map_update_batch, .map_set_for_each_callback_args = map_set_for_each_callback_args, .map_for_each_callback = bpf_for_each_array_elem, .map_btf_name = "bpf_array", -- 2.25.1