Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp3514355rwl; Sun, 2 Apr 2023 09:03:37 -0700 (PDT) X-Google-Smtp-Source: AKy350aWDY1TRJh6ISe8ESJ3O12IW5IGf6XZTSaf/CImGST0J3zdi/0jCQ/lAC/yegZUnqJN/AQY X-Received: by 2002:a17:903:210a:b0:19a:f02c:a06d with SMTP id o10-20020a170903210a00b0019af02ca06dmr25956980ple.29.1680451417291; Sun, 02 Apr 2023 09:03:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680451417; cv=none; d=google.com; s=arc-20160816; b=J4r/xMYZR9neBkJUWRFHx3buqxXV8oYOoFPvXslA/VEv9u81cAV06IhLmk8Vt3OHq0 PoffojFaPeFJ69e+9IqoTRmklUs7TkCf5NzHfcS9w1FhgDzklmemxipGEXT9whhRg9Hl afmkOq2/VWN0LQNmWBzVy+uekjkHrAg8nrPz/+5AfCIlk9849jmekC2iGiGPi9xUNwfd XmF58BwzLj0hbZhduqmrF+bxuHB78/+6C+t9MqIfX8kc2j4LsxO9pjiH7jFfTf3aNIlG p/onnfkOU6UugYkyxzO7mW6mvoRJNeXMO9ztMDkpk1RGxQxB5BYmt6dxc02gZE+trBPv 5p5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=A3H+yKErz+asdo8QewHRhcyQgjCu7p9+bA2Tn/wzQyc=; b=odJbg4hFqGrwiW97p55/HzWzF4vswABsvQoCjGArW/R80LQqeVbMihbq42bI9H+7E1 pZF33fuUbwpkjqyGz5K9/4smfg/HZvJRI1hMTafutMbP6yTtydZ1HjPCfHkLuJJWsb0o Vpzb1uYm1tQwzvIvOx/cUA9CRFRhlksk0rHdArhQxM9nkoEHzkPn23lc0XC9lFo/KuPf e3RffIb7ylY70LlxZxKHPXe83Xa9nHVl10vx5IF8uTyT/nLCJfze0zh5JcSDjAeRAgeV Oux/xdoNTU5AQtmRPcVLJgUpoq3scFrg/0fsvq1F93hRxgW46buVmEPfOoRIbwfwUSh2 Np5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=AXrfuLSQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u15-20020a63d34f000000b005136acd84fcsi6311625pgi.512.2023.04.02.09.03.19; Sun, 02 Apr 2023 09:03:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=AXrfuLSQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231304AbjDBPuE (ORCPT + 99 others); Sun, 2 Apr 2023 11:50:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230283AbjDBPuD (ORCPT ); Sun, 2 Apr 2023 11:50:03 -0400 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDCD7E042; Sun, 2 Apr 2023 08:50:01 -0700 (PDT) Received: by mail-ed1-x52f.google.com with SMTP id cn12so108143938edb.4; 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=v/Bkafwi6LXLqc5SCQD5meFY3poQdNfODp16mbKszdcimcVROhT6onqjMsB/6lfWzG Lhb99pTsHkG8iVwRI7EtWQlV7BXJUoLw/nUr9DIQE/kZPCTi/quf+eXNIC0zCcFcBg7w Xd0L2eZGUSSkQe9mz+xX2i7OGBoKn20HDhOjhW8gLg8abTaC4ZlY5shf0XAEZ/G79YZ9 POWMZS/eWTS0iOFtLEHKnV/TTX0Gl7/nzdreYeZ+pEffrs1u9DWlfF6Gp42FEDr9Cj3T 9mSzxTsIbtzBIqnEQoZ7AMgO4Y1F9+hvlkglAxEwJuPE1UbdmSmr75jJuRdH+bbK2u5t z+OA== X-Gm-Message-State: AAQBX9ff6imp1hwK6b6bUsdSiF2JvwiNPStLxCG77OxsvXnGB3I9wjIj zUwgct3wjUqjuK7yHFlz1fUEdbiHus8ZbHWu3H4= 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: Subject: Re: [PATCH bpf V6 5/5] selftests/bpf: Adjust bpf_xdp_metadata_rx_hash for new arg To: Jesper Dangaard Brouer 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?