Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp687262pxb; Tue, 5 Apr 2022 18:48:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzLB+uF4nqLxu0nyw5TMNZE+6ujCpD0emFhwUmqF8avr3P8UGUSqseUpZ/OEUuMXZGDQZ2 X-Received: by 2002:a17:903:1206:b0:151:7d67:2924 with SMTP id l6-20020a170903120600b001517d672924mr6199235plh.45.1649209736927; Tue, 05 Apr 2022 18:48:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649209736; cv=none; d=google.com; s=arc-20160816; b=lHDxR9dcee8QJ6zJuKP9u99pO7UrP+lPeyky83Q8pjJ9HZV8Me+n0Oz2vNwTreD5Tm 2Q6LI0f1kJRfpzsF3SrI5VndHhJTYQcXyPnzLlT0diMTA073uKVotx1MYpQNV3Dsra5Z bGAbMR09D9/h0S85jL5oRbkP9oSXDUfF1TmKmlWOlMapbmOoMqj+BjuH8aS3JClefFHC WWcRYV70h5uSy5RddL7p+B+YMCwzKepPM+3QaHYhPHzaKk9W6TsI2g/s0ensYu4uP09d 9RVxmG2u+d+DyJrpICm9ME6Q9gzpDvJ4be+DMXuaFDYZmqEqOI3FrC0Sk0JAxQ12yqr4 509A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JhvaFXr15JnjZROTQux5uF+CVs0p6ZsRIbbiRhGsVbU=; b=VGcJQmU/3270J0xXEFwEsdC86oVMaNRMY1hHZjwW9UrtQRsi2o0RUXkvFKzCkRuaTL tpqLutwZKl2kB+jcJJyDP/eLMIgQyVdJkVk6tRVr8B8W7o6UqPtUWBRoOumqj0/ifEc7 mMSMeWV6ESOtmNfxSttnsWPtXmYNmplPcCSbFqHIdcOpIsW/X6gnRht3NBW4z3n8BBa6 guNVvb8wl5nZgd6M8NUEvYG8vXsARSERwviS2ocbRh7PsL2WW3OfVlWLngHA7CHsw3BY yxsF3pQcYCfnSdLVxUx9H8C0W1DOvVKbTSEk/0LNXPhmP4IkGE8n4evIZgdWK/X66o1j MhwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fnasTtwS; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s2-20020a63dc02000000b003992df12df8si6821531pgg.465.2022.04.05.18.48.40; Tue, 05 Apr 2022 18:48:56 -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=@linuxfoundation.org header.s=korg header.b=fnasTtwS; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241095AbiDEIcs (ORCPT + 99 others); Tue, 5 Apr 2022 04:32:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236182AbiDEIBh (ORCPT ); Tue, 5 Apr 2022 04:01:37 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7014D49FB3; Tue, 5 Apr 2022 00:59:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 25673B81B7F; Tue, 5 Apr 2022 07:59:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 898F7C340EE; Tue, 5 Apr 2022 07:59:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649145577; bh=qKl0qMgI8zlYCU7pt+AoIGksrkUM+UZTo9seVNuA76Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fnasTtwSEhH/5UNOCB5uBH41qSILazjl8kE3N6NLw8EP8JUZLSxB1LWH6lIZibm6U 6XmMtywUaJowVhIVlSTql+26Ne+JUe7UUi8/AJtOHYBd1nFbgmcRK07nZomt81EyGH WEoYJ/oQyz4GmdRs9oPi+yR6c02h4rkg12nHzpLU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Magnus Karlsson , Daniel Borkmann , Maciej Fijalkowski , Sasha Levin Subject: [PATCH 5.17 0453/1126] selftests, xsk: Fix rx_full stats test Date: Tue, 5 Apr 2022 09:20:00 +0200 Message-Id: <20220405070420.920553337@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070407.513532867@linuxfoundation.org> References: <20220405070407.513532867@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 From: Magnus Karlsson [ Upstream commit b4ec6a19231224f6b08dc54ea07da4c4090e8ee3 ] Fix the rx_full stats test so that it correctly reports pass even when the fill ring is not full of buffers. Fixes: 872a1184dbf2 ("selftests: xsk: Put the same buffer only once in the fill ring") Signed-off-by: Magnus Karlsson Signed-off-by: Daniel Borkmann Tested-by: Maciej Fijalkowski Acked-by: Maciej Fijalkowski Link: https://lore.kernel.org/bpf/20220121123508.12759-1-magnus.karlsson@gmail.com Signed-off-by: Sasha Levin --- tools/testing/selftests/bpf/xdpxceiver.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/xdpxceiver.c b/tools/testing/selftests/bpf/xdpxceiver.c index 0a5d23da486d..ffa5502ad95e 100644 --- a/tools/testing/selftests/bpf/xdpxceiver.c +++ b/tools/testing/selftests/bpf/xdpxceiver.c @@ -906,7 +906,10 @@ static bool rx_stats_are_valid(struct ifobject *ifobject) return true; case STAT_TEST_RX_FULL: xsk_stat = stats.rx_ring_full; - expected_stat -= RX_FULL_RXQSIZE; + if (ifobject->umem->num_frames < XSK_RING_PROD__DEFAULT_NUM_DESCS) + expected_stat = ifobject->umem->num_frames - RX_FULL_RXQSIZE; + else + expected_stat = XSK_RING_PROD__DEFAULT_NUM_DESCS - RX_FULL_RXQSIZE; break; case STAT_TEST_RX_FILL_EMPTY: xsk_stat = stats.rx_fill_ring_empty_descs; -- 2.34.1