From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by mail.toke.dk (Postfix) with ESMTPS id 5A86D9FAE3D for ; Sun, 2 Apr 2023 17:50:01 +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=AXrfuLSQ Received: by mail-ed1-x531.google.com with SMTP id h8so108115175ede.8 for ; Sun, 02 Apr 2023 08:50:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680450600; x=1683042600; 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=A3H+yKErz+asdo8QewHRhcyQgjCu7p9+bA2Tn/wzQyc=; b=AXrfuLSQ2rAeeY46rK+Ifd00OqdmfpQpSBpyMtqEIYfzKeOIpil2Yr1FMG4TG2kyIU sM2807/dLEcUCCq7F3iTsJjroIsEdp3/6uyqKLWztzzZPmFHAeYTkclQizNuFjxOO2L2 MLCoOPenyvuv9yxgFCMU9dbt+OCF4E5KvvHWZonDhVPBxWmin07ve190M9A0/w60VcUn n+EY/QLp3zkRDIAYQnnlXVZeCRw6E3ZVBWwV1EvPae2AA/s4jIjc9IAuMI01l4WhLSj4 72QguFFCOrWWAkczf5Jz0ihnb5MMLHh9vPHB4eiUjQCVqBWEYuYDBTVMf7tLx4wteBdx RGxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680450600; x=1683042600; 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=A3H+yKErz+asdo8QewHRhcyQgjCu7p9+bA2Tn/wzQyc=; b=GB0M5giMVzynX1v3y5rtXgqyf2XMJG21WRKEYzLl2XhcVJ7edoL7JU2f/uGDAPDOKM W8h9S/Aj5FP7iXLwihqP4NMkEdvWdrwsZtLptM8P6xp+nfwD9+yLOlDRloX+rowa3iJO NI1kzAiVrxz8oUQmDtpUI61iPJ68FRGTiHgUr9qCvf9wQ5FuMAj1QHkUx1P5C3pfDgiN /7NSuERNCP5Dgsp2hVxHY4DWybRAJgycGp5uU9YeQKztUx1fcp876QlYn00YcoPHXgU9 9l9ks3nYCXrjPycjS7rmEtR+Xkm3uoQYN5dmAPCv3fm4QvWQw2G5l/YNqCYi2t37SMzr nNFA== X-Gm-Message-State: AAQBX9dRUNY+cCzAacV7ZwXdNKpPaY0XFduOmCfKZrQxAsRI5R9RWNsP WzzkLmfgoLuK+zoF80aToUCSAJnth8cDBtseuIw= X-Google-Smtp-Source: AKy350ax2HWtO6rXgzdemCo1alFkS8HV4Clz+W1EVu6BR1XzxsyNuc7e1sTnlgfbloPRYVtbjT3fruEPtP2eFcoMP5Y= X-Received: by 2002:a50:9502:0:b0:4fb:2593:846 with SMTP id u2-20020a509502000000b004fb25930846mr3463253eda.3.1680450600264; Sun, 02 Apr 2023 08:50:00 -0700 (PDT) MIME-Version: 1.0 References: <168042409059.4051476.8176861613304493950.stgit@firesoul> <168042420344.4051476.9107061652824513113.stgit@firesoul> In-Reply-To: <168042420344.4051476.9107061652824513113.stgit@firesoul> From: Alexei Starovoitov Date: Sun, 2 Apr 2023 08:49:49 -0700 Message-ID: To: Jesper Dangaard Brouer Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: YXFD5DIYCDWRQGPAKSV65WLQ3SBNIRPV X-Message-ID-Hash: YXFD5DIYCDWRQGPAKSV65WLQ3SBNIRPV 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 , 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, 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" , 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 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/tool= s/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/tools/= 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 *has= h, > + enum xdp_rss_hash_type *rss_type) __k= sym; > > 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 avail = 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_hash= _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 signa= l */ > + } Didn't we agree in the previous thread to remove these printks and replace them with actual stats that user space can see?