From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by mail.toke.dk (Postfix) with ESMTPS id 52B649F6EC1 for ; Tue, 21 Mar 2023 19:45:50 +0100 (CET) Authentication-Results: mail.toke.dk; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20210112 header.b=Hy3+bYbn Received: by mail-pg1-x52b.google.com with SMTP id x37so9170659pga.1 for ; Tue, 21 Mar 2023 11:45:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1679424348; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=9M8M7IInQVU+iyBpHPhc67fDUT5XDtEvAxluXmaN7aQ=; b=Hy3+bYbnBhFqAArV10Ykd5BRd70Z48mpTI27X42Ai9+2R8wXW5u/rimqgLJp+Ibswf YR44x0GVQ7gT8rdBjWMAKwimQS6CYxYUG8sc3gK1q5acCeanOiIGw2PAWOqHlI7/TFnj Dzq/LY5lgObm2IQd5rH8iigv4Q2ragNKBSV2DU7c+E5VbmBWaQLEgy6+X9WpUccLUorO +ES7ld+oCEaHs1V95DAaP8nBwKGFjBRqWWqYJfXnKkVfT/NB92UqP0U2/kC8GomIewkg j8NqSFiFWvg57K2eeu6dDa5z0jU+ogCbrGBWJyqmHWdeiTmhSpm/+qkJKJ1zVRfX5w9P KymQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679424348; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9M8M7IInQVU+iyBpHPhc67fDUT5XDtEvAxluXmaN7aQ=; b=Fi+1R9zN/R1M13N98tfnxP9EARf+sdTJEAiFbJvQhBBIfK+PtjYNwOKg1KvVHPrpzY 8XPHLscKd7w/IBf0SxFOP7Mdy/d1Uz8Oyip0+93+Js09dhGbPHYDhLy2RGI+IUGt7N5d CW8hGrGMUlLmoZO7VxmDrhIaSRONznFsyydS9Hri69Q7uKcP/ktz4DTac577sIk+1F1B nM7CXrrrko0cj5+6O4XXjfoaUJfYtFSt6JOLoBXJrq8rcsod7dmasTkOgWkdAvAwAnqD +siRqd4wQ2RGl5zRPEk+1Lt1OSAeiMscmnt69zwgr2RJyGIseerMwyjtUIkrVyWI+dXG +OOQ== X-Gm-Message-State: AO0yUKVJ2YwN2CfyU3jkNVLfPcyLaE1R57fL6HUcMH1HtRlAEfqIt9IC oCHc9Xhs91Y9THQ5XClmrrC7lb2rVOns7HfHT7NwbQ== X-Google-Smtp-Source: AK7set8eWSOB+hY/s8FgnYAtG+oz9cOr6kNpMapkGLpcaiVk96EuV7hKGhrQ0/ZHT1qqMbVxbR/O/73ddcAj/GAwDUY= X-Received: by 2002:a05:6a00:851:b0:628:30d:2d2f with SMTP id q17-20020a056a00085100b00628030d2d2fmr459685pfk.5.1679424348068; Tue, 21 Mar 2023 11:45:48 -0700 (PDT) MIME-Version: 1.0 References: <167906343576.2706833.17489167761084071890.stgit@firesoul> <167906361094.2706833.8381428662566265476.stgit@firesoul> <8edd0206-0f2a-d5e7-27de-a0a9cc92526e@redhat.com> In-Reply-To: <8edd0206-0f2a-d5e7-27de-a0a9cc92526e@redhat.com> From: Stanislav Fomichev Date: Tue, 21 Mar 2023 11:45:35 -0700 Message-ID: To: Jesper Dangaard Brouer Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: EDXV3JK3MJZM25HVEYYFMV4EORRKGSWX X-Message-ID-Hash: EDXV3JK3MJZM25HVEYYFMV4EORRKGSWX X-MailFrom: sdf@google.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: brouer@redhat.com, bpf@vger.kernel.org, netdev@vger.kernel.org, martin.lau@kernel.org, ast@kernel.org, daniel@iogearbox.net, alexandr.lobakin@intel.com, larysa.zaremba@intel.com, xdp-hints@xdp-project.net, anthony.l.nguyen@intel.com, yoong.siang.song@intel.com, boon.leong.ong@intel.com X-Mailman-Version: 3.3.8 Precedence: list Subject: [xdp-hints] Re: [PATCH bpf-next V1 4/7] selftests/bpf: xdp_hw_metadata RX hash return code info List-Id: XDP hardware hints design discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Tue, Mar 21, 2023 at 6:32=E2=80=AFAM Jesper Dangaard Brouer wrote: > > > > On 17/03/2023 22.13, Stanislav Fomichev wrote: > > On 03/17, Jesper Dangaard Brouer wrote: > >> When driver developers add XDP-hints kfuncs for RX hash it is > >> practical to print the return code in bpf_printk trace pipe log. > > > >> Print hash value as a hex value, both AF_XDP userspace and bpf_prog, > >> as this makes it easier to spot poor quality hashes. > > > >> Signed-off-by: Jesper Dangaard Brouer > > > > Acked-by: Stanislav Fomichev > > > > (with a small suggestion below, maybe can do separately?) > > > >> --- > >> .../testing/selftests/bpf/progs/xdp_hw_metadata.c | 9 ++++++--- > >> tools/testing/selftests/bpf/xdp_hw_metadata.c | 5 ++++- > >> 2 files changed, 10 insertions(+), 4 deletions(-) > [...] > >> diff --git a/tools/testing/selftests/bpf/xdp_hw_metadata.c > >> b/tools/testing/selftests/bpf/xdp_hw_metadata.c > >> index 400bfe19abfe..f3ec07ccdc95 100644 > >> --- a/tools/testing/selftests/bpf/xdp_hw_metadata.c > >> +++ b/tools/testing/selftests/bpf/xdp_hw_metadata.c > >> @@ -3,6 +3,9 @@ > >> /* Reference program for verifying XDP metadata on real HW. > >> Functional test > >> * only, doesn't test the performance. > >> * > > > > [..] > > > >> + * BPF-prog bpf_printk info outout can be access via > >> + * /sys/kernel/debug/tracing/trace_pipe > > > > Maybe we should just dump the contents of > > /sys/kernel/debug/tracing/trace for every poll cycle? > > > > I think this belongs to a separate patch. SG. If you prefer to keep the comment let's also s/outout/outPut/. > > We can also maybe enable tracing in this program transparently? > > I usually forget 'echo 1 > > > /sys/kernel/debug/tracing/events/bpf_trace/bpf_trace_printk/enable' > > myself :-) > > > What is this trick? On the recent kernels I think this event has to be explicitly enabled for bpf_prink() to work? Not sure. That's why having something like enable_tracing() and dump_trace() here might be helpful for whoever is running the prog. > --Jesper >