From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by mail.toke.dk (Postfix) with ESMTPS id 5C3109FB318 for ; Tue, 4 Apr 2023 01:02:33 +0200 (CEST) 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=F8qCgBXu Received: by mail-ed1-x535.google.com with SMTP id i5so123674603eda.0 for ; Mon, 03 Apr 2023 16:02:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680562952; x=1683154952; 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=idbiGh/Ya6uIX+mzYB2rV5Qhy6GfPEhyNSP1LnCMOvw=; b=F8qCgBXulmMAgA4uX/HvTpCkkTA78It5Ay0WX+wC0m3fdny7VcYr5xK6qhGAvd49em UPUkMFayptoos9n0arvw66ok2KwzSDzK3etIoDz5NDwNBjrMGewFbjt2M7gNaiixQRiB ec8AUsNtIPvUCPvLiJfOqr4UXOaUFydOQrJxbjrM/8Cga871tsTqohCWjMyOjVJcELEl LmLoVKxVN+Vd5kVR+TPDum2eaImaMGZa67tvB+Fxlr0SjpTNCSvGcdp0wkO7TkWb0YvU 5se00vVHNeAxT3+NJLtQoFGx7EWuNVY/vzuhfzhdaysj5bddsYxREPn4Fmy1LmN4C3/9 eB6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680562952; x=1683154952; 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=idbiGh/Ya6uIX+mzYB2rV5Qhy6GfPEhyNSP1LnCMOvw=; b=RaxQNXNI20NaQpZT11VBNYEBvk3pPuJfkUr0X4nYb7yrSfPGEMgeyqQ/r1KI4V2NSf VbLe/yoqGmey56VBhKlcwrD0lfOMQKagoXmq+tSez7o14mx2RuyyhcNglF8BiQR3ir0X 7Ol+4lb11GofNRVhbjSqb0t9j85fwRmS7blQNq42rT7pf8Q1oUmlItV0JT7x5UTR3Xph lTW593bHwRM7QJtmRTisNkl3vokP9OeJCQJKdZWObfcKbhezW/Io6YobvME42NRKBpI5 OZQ2ltmBjtoArDkM0w2fl8BgVWuC5Jep8VByJg37PLpoEW8tbuVlfNpMd+6ezteEXYDX XPSg== X-Gm-Message-State: AAQBX9fK0IWhNrvZr/hNSxHw+F7+uJ9lHHycS1do8pK81CsPpxZL2xAW mXyl6Nes9aDu+/2OIiR0R1jTfCniApFcF98DwTw= X-Google-Smtp-Source: AKy350YCrvXzZPu5fSnKVuKhW8RUVaKfBxcvGq3LzmM9l5vSftKYD875WlFhD/GHCCiGwm4WqTgscaBr5AtiNV9GQw8= X-Received: by 2002:a17:906:f07:b0:924:32b2:e3d1 with SMTP id z7-20020a1709060f0700b0092432b2e3d1mr165085eji.3.1680562952478; Mon, 03 Apr 2023 16:02:32 -0700 (PDT) MIME-Version: 1.0 References: <168042409059.4051476.8176861613304493950.stgit@firesoul> <168042420344.4051476.9107061652824513113.stgit@firesoul> In-Reply-To: From: Alexei Starovoitov Date: Mon, 3 Apr 2023 16:02:21 -0700 Message-ID: To: Jesper Brouer Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: VM27SHTTFEG6JJAQ7ZI5VFETATFADXB7 X-Message-ID-Hash: VM27SHTTFEG6JJAQ7ZI5VFETATFADXB7 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: Jesper Dangaard Brouer , bpf , Stanislav Fomichev , =?UTF-8?B?VG9rZSBIw7hpbGFuZC1Kw7hyZ2Vuc2Vu?= , Network Development , LKML , Martin KaFai Lau , Alexei Starovoitov , Daniel Borkmann , Alexander Lobakin , Larysa Zaremba , xdp-hints@xdp-project.net, Tony Nguyen , "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" , Tariq Toukan , Saeed Mahameed , Leon Romanovsky , linux-rdma@vger.kernel.org X-Mailman-Version: 3.3.8 Precedence: list Subject: [xdp-hints] Re: [PATCH bpf V6 5/5] selftests/bpf: Adjust bpf_xdp_metadata_rx_hash for new arg List-Id: XDP hardware hints design discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Mon, Apr 3, 2023 at 8:08=E2=80=AFAM Jesper Brouer w= rote: > > > > s=C3=B8n. 2. apr. 2023 17.50 skrev Alexei Starovoitov : >> >> On Sun, Apr 2, 2023 at 1:30=E2=80=AFAM Jesper Dangaard Brouer wrote: >> > >> > Update BPF selftests to use the new RSS type argument for kfunc >> > bpf_xdp_metadata_rx_hash. >> > >> > Signed-off-by: Jesper Dangaard Brouer >> > Acked-by: Toke H=C3=B8iland-J=C3=B8rgensen >> > Acked-by: Stanislav Fomichev >> > --- >> > .../selftests/bpf/prog_tests/xdp_metadata.c | 2 ++ >> > .../testing/selftests/bpf/progs/xdp_hw_metadata.c | 14 +++++++++--= --- >> > tools/testing/selftests/bpf/progs/xdp_metadata.c | 6 +++--- >> > tools/testing/selftests/bpf/progs/xdp_metadata2.c | 7 ++++--- >> > tools/testing/selftests/bpf/xdp_hw_metadata.c | 2 +- >> > tools/testing/selftests/bpf/xdp_metadata.h | 1 + >> > 6 files changed, 20 insertions(+), 12 deletions(-) >> > >> > diff --git a/tools/testing/selftests/bpf/prog_tests/xdp_metadata.c b/t= ools/testing/selftests/bpf/prog_tests/xdp_metadata.c >> > index aa4beae99f4f..8c5e98da9ae9 100644 >> > --- a/tools/testing/selftests/bpf/prog_tests/xdp_metadata.c >> > +++ b/tools/testing/selftests/bpf/prog_tests/xdp_metadata.c >> > @@ -273,6 +273,8 @@ static int verify_xsk_metadata(struct xsk *xsk) >> > if (!ASSERT_NEQ(meta->rx_hash, 0, "rx_hash")) >> > return -1; >> > >> > + ASSERT_EQ(meta->rx_hash_type, 0, "rx_hash_type"); >> > + >> > xsk_ring_cons__release(&xsk->rx, 1); >> > refill_rx(xsk, comp_addr); >> > >> > diff --git a/tools/testing/selftests/bpf/progs/xdp_hw_metadata.c b/too= ls/testing/selftests/bpf/progs/xdp_hw_metadata.c >> > index 4c55b4d79d3d..7b3fc12e96d6 100644 >> > --- a/tools/testing/selftests/bpf/progs/xdp_hw_metadata.c >> > +++ b/tools/testing/selftests/bpf/progs/xdp_hw_metadata.c >> > @@ -14,8 +14,8 @@ struct { >> > >> > extern int bpf_xdp_metadata_rx_timestamp(const struct xdp_md *ctx, >> > __u64 *timestamp) __ksym; >> > -extern int bpf_xdp_metadata_rx_hash(const struct xdp_md *ctx, >> > - __u32 *hash) __ksym; >> > +extern int bpf_xdp_metadata_rx_hash(const struct xdp_md *ctx, __u32 *= hash, >> > + enum xdp_rss_hash_type *rss_type) = __ksym; >> > >> > SEC("xdp") >> > int rx(struct xdp_md *ctx) >> > @@ -74,10 +74,14 @@ int rx(struct xdp_md *ctx) >> > else >> > meta->rx_timestamp =3D 0; /* Used by AF_XDP as not ava= il signal */ >> > >> > - if (!bpf_xdp_metadata_rx_hash(ctx, &meta->rx_hash)) >> > - bpf_printk("populated rx_hash with %u", meta->rx_hash)= ; >> > - else >> > + if (!bpf_xdp_metadata_rx_hash(ctx, &meta->rx_hash, &meta->rx_h= ash_type)) { >> > + bpf_printk("populated rx_hash:0x%X type:0x%X", >> > + meta->rx_hash, meta->rx_hash_type); >> > + if (!(meta->rx_hash_type & XDP_RSS_L4)) >> > + bpf_printk("rx_hash low quality L3 hash type")= ; >> > + } else { >> > meta->rx_hash =3D 0; /* Used by AF_XDP as not avail si= gnal */ >> > + } >> >> Didn't we agree in the previous thread to remove these printks and >> replace them with actual stats that user space can see? > > > This patchset is for bpf-tree RC version of kernel. > Thus, we keep changes to a minimum. > > I/we will do printk work on bpf-next. > (Once I get home from vacation next week) Sorry, but I insist on making them in this set. We did bigger changes in bpf tree, so size is not an issue. I don't want to remember to ping you every week or so to remind you to fix this later after bpf gets merged into bpf-next. Less work for me and less work for you to do it now.