Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp459738ioo; Sat, 21 May 2022 04:25:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxawbsr9tAWScPho65jixUu+nbd02x4G3Y6QiPufuJICfVO5ZcLcyBXffhvhzEbne5R2JwA X-Received: by 2002:a17:907:1c20:b0:6f4:639e:9400 with SMTP id nc32-20020a1709071c2000b006f4639e9400mr12327262ejc.485.1653132349326; Sat, 21 May 2022 04:25:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653132349; cv=none; d=google.com; s=arc-20160816; b=g8qGxzBfq6TBmpbuyVto1R89tyBo5b5ospo9oUtweS2APODonVXrWs/m0fodr0O3// lCQYX4TzrdPI7pHj/b8JWL4tRvbf4ayfkaXdqMnotpBDapVVv17GmoSJ7ZtYzlgeEZQP 3lcBbV4eCeDlICfs0XoASiGv0bUVS3vZfJWe3TbSahFiwEBzisu/6K2bcvDUszeg57Lw 2snGKbzgUgyeSFbskeRfplUtDPGdFr+1fczrr8IjN4mDPFHtqAuHuvE4GUxZjPP5fU1X 3HteJaiFu1VdGR1GadNfFhrpI29LMCAEsCha4fGFk3Oo2G392IKUX4s8pgq74a/OhF4q biBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=b5LP2LIe+3dg0Ns3WLvfbA/mpjcRdxbZZTeIf8hpFzg=; b=dzRKnJBTZ4teGgl9Q05BDRdANWgCE1joXVzEcMuzMsNeqcULFNC2T1foOEPdSmyqVC Dt5IJgtEVd7kV+osMvc1M1QuuRpNUyhOLr0oHRxbQ6zASG5eDmmJqNS0lOKR54Sl73vR 91ghwkPyzOzF1iNzb7rxsZlSpfpGSl5UNw5ZxUA1hOxmAqE6CAn3vMzggdJX/xwxOlWF lQo5yTL6l1dMmveh6T2gtiNpC48NyKtnHrMz/ahJ+T9BpiczdpKguoSOBrRteXghwPxm UMWE7wiaF96OpLdxjglPdyUnAJB0V10vZ89hbIFqMurBBoEoZz5y3we0+a0ENZcOqQ8D DibQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mWbQqr3E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g12-20020a1709061e0c00b006f3b16423ebsi10423028ejj.620.2022.05.21.04.25.23; Sat, 21 May 2022 04:25:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mWbQqr3E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S234760AbiETWBM (ORCPT + 99 others); Fri, 20 May 2022 18:01:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233685AbiETWA7 (ORCPT ); Fri, 20 May 2022 18:00:59 -0400 Received: from mail-il1-x130.google.com (mail-il1-x130.google.com [IPv6:2607:f8b0:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DF03D116; Fri, 20 May 2022 15:00:57 -0700 (PDT) Received: by mail-il1-x130.google.com with SMTP id s12so6357454iln.11; Fri, 20 May 2022 15:00:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=b5LP2LIe+3dg0Ns3WLvfbA/mpjcRdxbZZTeIf8hpFzg=; b=mWbQqr3Eo/woi67Rkec0dQ5oP4bMID1ncR7y8jmdgFNYY2O6M5gj8coWMLX3OwBsyK q1cOSxtRo8VSS2jktb9nHi2ZrTbUs9Wyc3ZXFTeFcDGMG+tBdyqasMBOF+a4KNpYb6FH d7lgzmn1EATifjMZwFckFsvHocP5/Jb4+cAUNalZ9Fvrbh/AmLk3suZrlX1UdrfzbGpx u2jiB3Hsrv4h0k+gAJkk7EnA+bQF5H29KeSly50OEiwBvgyI9IJNjSPrEuD+ybEo7HW5 +S3xhzHcL87JpOm/3DfE3DODprQZ0ct1o1pMMlv2zFRHScESS/sKnb61csRKua8jS3j3 h0Vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=b5LP2LIe+3dg0Ns3WLvfbA/mpjcRdxbZZTeIf8hpFzg=; b=FflSkezWMJGCXDK3gRjS1TfZ48X0dZsvQ+22ui5DVBrl7g96A6lEIsgroY12mVBIVT EU9ZVzZG8Y+gjLCXFKkHjquJ5g7vaODf/Hx51w+oEY+qVtvpkaTHmxec4V1gRCrQvxHx 1Rf6E+CXy9GIL9bQu3Dg62W6GrmK+ZNZ6yRD0HXaN2KGIX+nWm2yNpcJQXQIdlMYGjoZ rOx0ZZHI3M7akrMUMJVtO6Wza+iPsh7Fdd+YojfYdrtPh7diQA7YjwwJ75KQqYzMjIRc lRjh+iqPzCieurZKMzhRe8v+ZFA8QXkk/pWrQPX1n21kYkGZfAytn7gatV0tjsGu1R1v peoQ== X-Gm-Message-State: AOAM532MqjMjt4eEFq+ksmXacAQkPbUWeprb4cM4Lkvb3RLySHhhtsm9 zLbHB+bMvc+qvzOep5nMqfm5uGx7/KKqI27v0cA= X-Received: by 2002:a05:6e02:1a6e:b0:2d1:68e9:e8da with SMTP id w14-20020a056e021a6e00b002d168e9e8damr4910952ilv.252.1653084056901; Fri, 20 May 2022 15:00:56 -0700 (PDT) MIME-Version: 1.0 References: <20220518025053.20492-1-zhoufeng.zf@bytedance.com> In-Reply-To: From: Andrii Nakryiko Date: Fri, 20 May 2022 15:00:45 -0700 Message-ID: Subject: Re: [PATCH bpf-next v2] selftests/bpf: fix some bugs in map_lookup_percpu_elem testcase To: Yonghong Song Cc: Feng zhou , Shuah Khan , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin Lau , Song Liu , john fastabend , KP Singh , Steven Rostedt , Ingo Molnar , Jiri Olsa , Dave Marchevsky , Joanne Koong , Geliang Tang , "open list:KERNEL SELFTEST FRAMEWORK" , Networking , bpf , open list , duanxiongchun@bytedance.com, Muchun Song , Dongdong Wang , Cong Wang , zhouchengming@bytedance.com, Yosry Ahmed Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 18, 2022 at 8:44 AM Yonghong Song wrote: > > > > On 5/17/22 7:50 PM, Feng zhou wrote: > > From: Feng Zhou > > > > comments from Andrii Nakryiko, details in here: > > https://lore.kernel.org/lkml/20220511093854.411-1-zhoufeng.zf@bytedance.com/T/ > > > > use /* */ instead of // > > use libbpf_num_possible_cpus() instead of sysconf(_SC_NPROCESSORS_ONLN) > > use 8 bytes for value size > > fix memory leak > > use ASSERT_EQ instead of ASSERT_OK > > add bpf_loop to fetch values on each possible CPU > > > > Fixes: ed7c13776e20c74486b0939a3c1de984c5efb6aa ("selftests/bpf: add test case for bpf_map_lookup_percpu_elem") > > Signed-off-by: Feng Zhou > > Acked-by: Yonghong Song I've fixed remaining formatting issues and added my_pid check to avoid accidental interference with other tests/processes. Applied to bpf-next, thanks.