From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by mail.toke.dk (Postfix) with ESMTPS id 5F8F99F7514 for ; Wed, 22 Mar 2023 17:09:18 +0100 (CET) Authentication-Results: mail.toke.dk; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=maaJ1R0t Received: by mail-ed1-x52b.google.com with SMTP id w9so75122353edc.3 for ; Wed, 22 Mar 2023 09:09:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679501356; 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=c+t+iJE4CLPR5AX4Mmj+oQLcilezTSlPs5QGLaEKjPg=; b=maaJ1R0tVCWai7p0zz0N16SBmHDyT3mInEhc6OhwwhFqXUK2XbbQXvAkjEarOXoZQZ tLTx1WLClV7jWVtS+tbsmBdkXdVoA/sVCEwz7lvyWf9N4ByG6tNpEb0p2vfxyuP5z+oB QZPlDkuOU4BTjAPJiWuhvqCMKev7ubWgeLrcBnw58s+ce4cvHFNt1CFtd+4guTtyrAIY 7mz8a8eOT4CBu3+eU5G7KVGrmvbGnq8l37ic1ImLN9PTJ+zQIDs3SA5DVPazqA5b+JN1 FZykZ92xXPKI6onLP4XA0uECFwQQ97JClYBYxqRh3vZLOsV+sf4ZHq7tPavGtyxlRusn DVcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679501356; 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=c+t+iJE4CLPR5AX4Mmj+oQLcilezTSlPs5QGLaEKjPg=; b=d9HgQxBmZq6MrRJEeqEcVxMdkRUjLPjgDlkBYQQidoiyq1IkVc8ER9O8ceALAMX3RM mOorzWpLnNCvn8X9ZEct8L0rHjZW0+I0D0rhiK+CNNzVlUcnXbI7xfAHDLHWBTj8iGyI 0cST9Jp0/9HEoLU+RLZwemR5zR3y8dRpcmzofbsAfl8P6OnWLIio/ktorDXRaTbNoU/6 WxeYDgrSDqUMyzBkvsbiLqx0cLgVLQiwbUg/D04PBhJqSsHqFFz5pyAIPGUJM5HPpqf+ wwjK/fSLq6K1dlaDp2XbymWeiu7nswZfFP0qAy9/L81HbFSe6Ug8/PGwCBSt+i3F+Ic2 cOdg== X-Gm-Message-State: AO0yUKWkqKDLNtOdNuGd2v1vz50LpqFfCcbzdk7JKkwDx2YDl+9FLIke kIkLtROCFFaLwbyp6vfDLrSVN+mc9o2HRVAoXGY= X-Google-Smtp-Source: AK7set+6hRWgM2r2QyXMC1iDOqd2nc9ihJLVqRYieEQSLsk32fQ3GJjZeRO4TV3s4vCcCHl3SVMTpdaFn/inIkkzUys= X-Received: by 2002:a17:906:69d3:b0:88d:ba79:4317 with SMTP id g19-20020a17090669d300b0088dba794317mr1543087ejs.7.1679501356297; Wed, 22 Mar 2023 09:09:16 -0700 (PDT) MIME-Version: 1.0 References: <167950085059.2796265.16405349421776056766.stgit@firesoul> <167950088752.2796265.16037961017301094426.stgit@firesoul> In-Reply-To: <167950088752.2796265.16037961017301094426.stgit@firesoul> From: Alexei Starovoitov Date: Wed, 22 Mar 2023 09:09:05 -0700 Message-ID: To: Jesper Dangaard Brouer Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: YJ3RR3WT7EJLDWF7SEUMADIKSCVUNEHW X-Message-ID-Hash: YJ3RR3WT7EJLDWF7SEUMADIKSCVUNEHW X-MailFrom: alexei.starovoitov@gmail.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: bpf , Network Development , Stanislav Fomichev , 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: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/tools/= 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 avail = 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_hash= ); > + } else { > + bpf_printk("rx_hash not-avail errno:%d", ret); > meta->rx_hash =3D 0; /* Used by AF_XDP as not avail signa= l */ > + } Just noticed this mess of printks. Please remove them all. selftests should not have them.