From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by mail.toke.dk (Postfix) with ESMTPS id 2D2569F75C2 for ; Wed, 22 Mar 2023 20:00:53 +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=JlL6QJwm Received: by mail-pf1-x430.google.com with SMTP id u20so11286788pfk.12 for ; Wed, 22 Mar 2023 12:00:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1679511652; 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=GjDTPkSaQqj31I/z+HvI789TpMhG2SxR9s75ueel5GI=; b=JlL6QJwmm4n9k6MhGIAPDh3m+nKrNBYcW+5PfY4XwjHvreYRlYugSKMcbX2nToJcVG gjiQfagZa6E4HOKWgeofV9xcLVWuiH7pTM73VCjsaS045VRAsbCdf7tWKDV8eiKZWYKV 4INMTke5kTI586i6wfE4VybYhS4iQPtYArVL9FG3v0M49aFcPyVF4RTWG7BAAWDnzWKW m49L9wbHaOh8PD+kbc4qXRXLv3/84aQS3HOd9a6RKnCGlSR0J5VD/nkzjUkF9CosKtfr erwcs+57HBfpfLT+45Oiw54o+C1T9vJU7ecxgNrhZiy4DBoRW8Ja/dm9C+GB6ZmDKQUN vk4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679511652; 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=GjDTPkSaQqj31I/z+HvI789TpMhG2SxR9s75ueel5GI=; b=0v2uPsYgxuNK1IZb+HLR8Eba8axZ7wEk9ixmgAsaA2VqR6jQp3M5IaXLwh6Kqp3wBl 1vakOgoK0OeawZdX5i6QUh/BR8Zb34GM772R1ezM78BFO3iwAz+tVFhyqYqj/Z8jvLwn GLiWBhySYq5BFeY+lDZ/yFyFt9XAlx7aRfiFPKTkoc8PdVQuAtKwPvrw5vtsg7Kjri5V No5SmgtFsNg3OzF7L1VpNwkcFfvBt+jk6AfyabCeGg4pEtIoNZ6obtlWGM9JiQEjO0ji B1RT1ifq7mmz0uLP0Ra/Z34vDVqo2RV2onhWwLehnaYbniWbw5nt2y/gf29CDao2jNhj /gWg== X-Gm-Message-State: AO0yUKUoSmUkptp4odHfpCqvCEuefiQqab1acXzFcXGKXzZCefXghNOv PISyyL9IoR87pwHn9efbla6NSG2GoH+a+lclLCqCvQ== X-Google-Smtp-Source: AK7set+1HbWv73aDwWV4mLjxIHFWB4Iy/lNo7wzRMlUmKTAxKpq3IEOamI1JirRB9Au5KHcZoar0gGb5tc/faf86//k= X-Received: by 2002:a65:4346:0:b0:50b:dca1:b6f9 with SMTP id k6-20020a654346000000b0050bdca1b6f9mr1128719pgq.1.1679511651715; Wed, 22 Mar 2023 12:00:51 -0700 (PDT) MIME-Version: 1.0 References: <167950085059.2796265.16405349421776056766.stgit@firesoul> <167950088752.2796265.16037961017301094426.stgit@firesoul> In-Reply-To: From: Stanislav Fomichev Date: Wed, 22 Mar 2023 12:00:40 -0700 Message-ID: To: Alexei Starovoitov Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: P7UKRMOYMGQZ4Y77PWZFCQ7X2R44ABGV X-Message-ID-Hash: P7UKRMOYMGQZ4Y77PWZFCQ7X2R44ABGV 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: Jesper Dangaard Brouer , bpf , Network Development , Martin KaFai Lau , Alexei Starovoitov , Daniel Borkmann , Alexander Lobakin , Larysa Zaremba , xdp-hints@xdp-project.net, anthony.l.nguyen@intel.com, "Song, Yoong Siang" , "Ong, Boon Leong" , intel-wired-lan , Paolo Abeni , Jesse Brandeburg , Jakub Kicinski , Eric Dumazet , John Fastabend , Jesper Dangaard Brouer , "David S. Miller" X-Mailman-Version: 3.3.8 Precedence: list Subject: [xdp-hints] Re: [PATCH bpf-next V3 3/6] 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 Wed, Mar 22, 2023 at 9:09=E2=80=AFAM Alexei Starovoitov wrote: > > On Wed, Mar 22, 2023 at 9:01=E2=80=AFAM 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 > > --- > > .../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/progs/xdp_hw_metadata.c b/tool= s/testing/selftests/bpf/progs/xdp_hw_metadata.c > > index 40c17adbf483..ce07010e4d48 100644 > > --- a/tools/testing/selftests/bpf/progs/xdp_hw_metadata.c > > +++ b/tools/testing/selftests/bpf/progs/xdp_hw_metadata.c > > @@ -77,10 +77,13 @@ int rx(struct xdp_md *ctx) > > meta->rx_timestamp =3D 0; /* Used by AF_XDP as not avai= l signal */ > > } > > > > - if (!bpf_xdp_metadata_rx_hash(ctx, &meta->rx_hash)) > > - bpf_printk("populated rx_hash with %u", meta->rx_hash); > > - else > > + ret =3D bpf_xdp_metadata_rx_hash(ctx, &meta->rx_hash); > > + if (ret >=3D 0) { > > + bpf_printk("populated rx_hash with 0x%08X", meta->rx_ha= sh); > > + } else { > > + bpf_printk("rx_hash not-avail errno:%d", ret); > > meta->rx_hash =3D 0; /* Used by AF_XDP as not avail sig= nal */ > > + } > > Just noticed this mess of printks. > Please remove them all. selftests should not have them. See my reply in the v2.