From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BBC223358DB for ; Wed, 29 Oct 2025 13:52:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761745962; cv=none; b=jeQNKQZFG1OOB509jFxEwf7oBuljpsI0Gk0w55ntwptitnSr78Cl36eKF7hhgkMK57LrcojRY/hNW7rzM2bkBKVWBESphHXRm1ZYOdTyF8C6+KMu96XYFs9dNAibnqVWyVr+QeHtCTfBdExvcHcYe3leZ8LExNWOPlLnlzA8M5Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761745962; c=relaxed/simple; bh=GRf5pO09B51DGf/8JXpqDGryXFdVf0zOZoy017qnk0k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jJis4Rco5NkXW4+kieCH5x0UpM+02pOU1dCbTgc7MRkoI58t6f6CysxE1rcEjbv9c5Yfu2kleaYH9HVqnQR3yVykAT85H2SH2BCk1cvfgzCwkRudBF3RApzn8MUu5aaZx/SvU0/+WJ9/+q5f+9x8dAhraBL6CCPpdZpeT0PTlp0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=nwfJGB0l; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="nwfJGB0l" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 596654E413CF; Wed, 29 Oct 2025 13:52:39 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 2EFEF606E8; Wed, 29 Oct 2025 13:52:39 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id ED4CF117F80EE; Wed, 29 Oct 2025 14:52:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1761745957; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=NTnD8CdkarTrhlGO770hkduquLn2c0s6l4SlOEHonts=; b=nwfJGB0lHlUUTDVGvowrkVJbf5tdr97UKfuR0E05nNmJ+gf9C/v3kCrRZmZlaf02jJHMZ8 caAFVZopuorlqWxahHNPaeBOwcIm0K025l57xpmLE27LWHll14KF/LfH5FNDz1ncWixQAA 3NbifugIjlaHN9nGWAcJL/Zauv7vC5erDdj71kJmsineg3viuUenB46IMpWt0ylghdsds8 uLEb5fNIW12RQDD88j4rTJYA5p3yNdddSK+witkvsPZ0sHBhC4ovIUlGNz/ghshOP8k/8V BeiDgCDeh4FlGNuQKkUcLIZtj1YFA1wSFaimxoSnYvWfPBw9zPeO/tQ8dbNocA== From: "Bastien Curutchet (eBPF Foundation)" Date: Wed, 29 Oct 2025 14:52:23 +0100 Subject: [PATCH bpf-next v6 02/15] selftests/bpf: test_xsk: Initialize bitmap before use Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20251029-xsk-v6-2-5a63a64dff98@bootlin.com> References: <20251029-xsk-v6-0-5a63a64dff98@bootlin.com> In-Reply-To: <20251029-xsk-v6-0-5a63a64dff98@bootlin.com> To: =?utf-8?q?Bj=C3=B6rn_T=C3=B6pel?= , Magnus Karlsson , Maciej Fijalkowski , Jonathan Lemon , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Mykola Lysenko , Shuah Khan , "David S. Miller" , Jakub Kicinski , Jesper Dangaard Brouer Cc: Thomas Petazzoni , Alexis Lothore , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, "Bastien Curutchet (eBPF Foundation)" X-Mailer: b4 0.14.2 X-Last-TLS-Session-Version: TLSv1.3 bitmap is used before being initialized. Initialize it to zero before using it. Reviewed-by: Maciej Fijalkowski Signed-off-by: Bastien Curutchet (eBPF Foundation) --- tools/testing/selftests/bpf/test_xsk.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/testing/selftests/bpf/test_xsk.c b/tools/testing/selftests/bpf/test_xsk.c index 02250f29f9946d1ca701e30a900617056d91587b..679491b6b9dd80ccb2b92729141fb8715b874c6d 100644 --- a/tools/testing/selftests/bpf/test_xsk.c +++ b/tools/testing/selftests/bpf/test_xsk.c @@ -1069,6 +1069,8 @@ static int receive_pkts(struct test_spec *test) u32 sock_num = 0; int res, ret; + bitmap_zero(bitmap, test->nb_sockets); + ret = gettimeofday(&tv_now, NULL); if (ret) exit_with_error(errno); @@ -1259,6 +1261,8 @@ static int send_pkts(struct test_spec *test, struct ifobject *ifobject) DECLARE_BITMAP(bitmap, test->nb_sockets); u32 i, ret; + bitmap_zero(bitmap, test->nb_sockets); + while (!(all_packets_sent(test, bitmap))) { for (i = 0; i < test->nb_sockets; i++) { struct pkt_stream *pkt_stream; -- 2.51.0