Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp36228203rwd; Mon, 10 Jul 2023 20:40:36 -0700 (PDT) X-Google-Smtp-Source: APBJJlGnwZVW30GK6MqyeABOL0Puk1j9g500HW+aQZUv4+9ObvEjHlledaeuaLXkTCWPtcmkJPj8 X-Received: by 2002:a17:906:5307:b0:994:758:fa4a with SMTP id h7-20020a170906530700b009940758fa4amr4522689ejo.46.1689046836166; Mon, 10 Jul 2023 20:40:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689046836; cv=none; d=google.com; s=arc-20160816; b=sOUfI073kJkSstqEUSPmHC1ZGLOR1MLP2lZbYl+G52bv/JIolTU0EMUTmQWozK3jJ0 69t34DZm2kt6mEfruDmSPO1YxcAfBweIFg2JA1J2dl9xvjXBeA1Rbec+NhDZb0yyCxee qSHw+GqBBp2o3onH7sSaZo6j2s1zAhEoRiguTm9qdm5vqgHwmdCWcIzpQGVRTHL/gGkb 0TwyczxXk8sCs2vex3iH/kH2eoX11sRqTWJ9YM7gN+cXaExfgbafzEVClQUs6Oc33lNc ed3iph6pvLboQozV5R9DfujmRDQF+jMUPlBNoMy1ykqyca+QrnDlAAh2EiLgO1ba931Z fceg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Rz2Z9uqGBu5n7dLxdjRn3DUHrI1c1OAJnAS4Abt85fE=; fh=QVWfB0ofqNUaGjCeXnhl6Wxc7XiEBNHzIrYkHbUnBf4=; b=Ccypn8gL767CZzmLHd5tUO1dhSZJUFyb7dfWBKqw/cVuuSIT+ace/yVPn5DSVHHEeX LUWPN09HnevyzfRafaJWKvOH3Bfreqtl95tu4uKUDF7z1RpZic+lwI6eIUg080JXW9Mr GCb8KGks6Oav0cCYeMV5v4LKhtW3kOLe6jsasjiAKfswtmumVQLs0jC9cB22fJs5LsG+ Pr2ZWr40o9AHjmprOrSKVRQwFROw17pv8cT7hUhPcGxKeMFH+4JRpZWjjvidos3G5lGP A9P0LON9QbdXNiT0jhWi4ua/jOVuCfc1G/MxKWLfsrB/pHzVQ68B5h6y/KAMLlu1SeaO HdMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=endMdthO; 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 f6-20020a17090624c600b00992ac6d8893si1001455ejb.792.2023.07.10.20.40.11; Mon, 10 Jul 2023 20:40:36 -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=20221208 header.b=endMdthO; 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 S229612AbjGKCzr (ORCPT + 99 others); Mon, 10 Jul 2023 22:55:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229505AbjGKCzq (ORCPT ); Mon, 10 Jul 2023 22:55:46 -0400 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BB5210D; Mon, 10 Jul 2023 19:55:45 -0700 (PDT) Received: by mail-pj1-x102b.google.com with SMTP id 98e67ed59e1d1-262ef07be72so2462624a91.1; Mon, 10 Jul 2023 19:55:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689044145; x=1691636145; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Rz2Z9uqGBu5n7dLxdjRn3DUHrI1c1OAJnAS4Abt85fE=; b=endMdthOppBOwx2i6IgP0RGFV4c4vlhf4/1XIHyi++9rZ9OurjbQsSmg/GdSnsUOqR /J3B2sQEfKDE0vjZVofernbv7j7JdCiYc0rNrgxzN0GrrBoO4ePWFrhlI9CG/CRHfBqD aoUf/fFNmUdkoWwpfRPW91OJt/ML9PjfDTC8PVR3gsBRUt/HNpgUyjrCr+vINjcpeaOf 2m7q6z+L2bpl8+qO0mAdv0fGRBZdtSv6T/wRTbZVCOZES72ow8KerSa2NU/m5CmRkYeb 95Nx0sneUXojQv+SmR6oIWZ3FZ4NjEZMF7Kj/rjETxLosbo7VJMArRt9sAzIDlETUpty e9kA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689044145; x=1691636145; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Rz2Z9uqGBu5n7dLxdjRn3DUHrI1c1OAJnAS4Abt85fE=; b=JUMaf0qK0NaUnuRr/rewMx+nqmwKi9fpLs+h62Pj3RE7izQNW8jjSFE5Q7gWlM4FyE mEBT3drSHRrv3lQvOjy7n3ZJ/qfy0fvpssXyysRBxHV37saOK0jC59DguTfZJG3x4KgQ 8lN+oe3khGN2aJgXhIRt0MxQPrD7zVuipInu+JIB5zXm4HvOPTs1eU6qzISyksh6hMLA sXOTHu2Z/MJQL4zfS+yHm8aLQfncnLAPN0sA8/FriP51FTUzNPd9kQIRjy0yHouS/Rtu TAHVrrRhHgyaMiyCA0RI/0/QyH+ufo8rdEu5kSnA464WgS/aCqOsko7fBz9dRXIYPtd0 43tw== X-Gm-Message-State: ABy/qLYMPuMTrXVcyoInZbzIdQFUhIrvC13Qw5i9oRn197KausEp0D3I jfa2yxf6ybSenbup5do6no4= X-Received: by 2002:a17:90a:2a87:b0:262:d029:69fc with SMTP id j7-20020a17090a2a8700b00262d02969fcmr11103174pjd.34.1689044144557; Mon, 10 Jul 2023 19:55:44 -0700 (PDT) Received: from [10.22.68.146] ([122.11.166.8]) by smtp.gmail.com with ESMTPSA id qe4-20020a17090b4f8400b0025c2c398d33sm600736pjb.39.2023.07.10.19.55.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 10 Jul 2023 19:55:44 -0700 (PDT) Message-ID: <115c6eac-ab28-7220-e1e4-5747bf641bbe@gmail.com> Date: Tue, 11 Jul 2023 10:55:38 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH bpf-next v2 2/2] bpf: Introduce bpf user log Content-Language: en-US To: Alexei Starovoitov Cc: Alexei Starovoitov , Daniel Borkmann , John Fastabend , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jesper Dangaard Brouer , Yizhou Tang , kernel-patches-bot@fb.com, bpf , LKML , Network Development References: <20230708040750.72570-1-hffilwlqm@gmail.com> <20230708040750.72570-3-hffilwlqm@gmail.com> From: Leon Hwang In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HK_RANDOM_ENVFROM, HK_RANDOM_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_BLOCKED,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 11/7/23 07:45, Alexei Starovoitov wrote: > On Fri, Jul 7, 2023 at 9:08 PM Leon Hwang wrote: >> diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h >> index 34fa334938ba5..8a458cfcd91bd 100644 >> --- a/include/uapi/linux/bpf.h >> +++ b/include/uapi/linux/bpf.h >> @@ -1549,7 +1549,6 @@ union bpf_attr { >> }; >> __u32 attach_type; /* attach type */ >> __u32 flags; /* extra flags */ >> - struct bpf_generic_user_log log; /* user log */ >> union { >> __u32 target_btf_id; /* btf_id of target to attach to */ >> struct { >> @@ -1585,6 +1584,9 @@ union bpf_attr { >> __s32 priority; >> __u32 flags; >> } netfilter; >> + struct { >> + struct bpf_generic_user_log ulog; /* user log */ >> + } xdp; > > 1. > You cannot break api in patch 1 and fix it in patch 2. > > 2. > libbpf side is missing. > > 3. > selftest is missing. > > 4. > bpf_vlog_finalize() should be used and error propagated back through > link_create. > Same api must be used: log_level, log_size, log_buf, log_true_size. > > But considering all that I agree with Daniel Xu that > tracepoint would be better here. Sorry for missing 2&3. Tracepoint is considered. I'll change it from user log to a tracepoint. I'll submit tracepoint patch with libbpf&selftest patches later. Thanks, Leon