Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2089026ybp; Thu, 10 Oct 2019 02:00:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqxGt/HA71ijXWvtHx0iJGQd50OjzMAfQfXoaVWY8k2SiICIKlGxbvKPtMIB3SymkyUc3p9r X-Received: by 2002:a17:906:ce2e:: with SMTP id sd14mr7178385ejb.197.1570698039510; Thu, 10 Oct 2019 02:00:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570698039; cv=none; d=google.com; s=arc-20160816; b=W8Fu7x8QXHwWgKLf0KBoE+YTJtMTuCZWzgNgBfrJtdj4RByrVu3nPbur0nLuksVzaB IjKj5vTubtbPjN/a/Ts/rVVyLI62/Nu4RVs7ckIyH4UQFRHAt5XJIE2mbjSBUFSgm8dl QxsC1ewpcspg8YaSKSEeZA4DO5xvoX9hyksDmwN1+zkiEcU9JKeHPq6K9f9MtW4IlPC9 26Z58T5Js/GbSmntROgCuBL3tdAr9Cc6xFPwPCcQOuM8ujmgIYFHwqVWKgfiYarPWkwD a3s2QzZGau1aLGs4FMqtfF8t763FWLZuBQMxty486RGGV6xtmOBVaoUPJyXtJqrSlCbX yPrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Lxqj5ctpLdK8G68lYpfpnLwVE6UVS52d4ovM3AqXOcg=; b=Qd/ykKaKEHG4KPrNxVgsspYTaCyOlwnfTamaRqC5JkEco6vL60Q2yotFguWH91CluY UzqN6YfApI9g9dYp1aFdTcTorw4iqQCp4M0AtwuNcBl0pW0UqatiOhEAJXcEzy0tmx7g HgeYJ6yAivwjjpRdqgpWwMukHiLwVwIkfVKPYzLgKYuHF3bP3W29X+F36QrVcdx4P+P6 vJfJnpcId1SjPZX4ZstuLJTTqTwL5ooGkl9/461SEjKPh97wtRU8l6/HIuNpEnaY1ZAK mst7BF/viyN0ZxVmQZAuO8a/IMoWVVDQHBQ2wUup9aP4NieA9NXIR3Y97xd+w+g8828u jAuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QAZozvlp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j21si2756936eja.5.2019.10.10.02.00.16; Thu, 10 Oct 2019 02:00:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QAZozvlp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389079AbfJJJAK (ORCPT + 99 others); Thu, 10 Oct 2019 05:00:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:47962 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388690AbfJJInL (ORCPT ); Thu, 10 Oct 2019 04:43:11 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8CFBB21BE5; Thu, 10 Oct 2019 08:43:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570696991; bh=8rXf1rcCw3zLras7kS4IMtEFY7Dv0pAdekM63Zo4p1g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QAZozvlpAhRwNkOvmtAsfLrLIovV+7eCJFKd/ZBEQ6gIxfNK0p2pL6v1ShCdjGU1r zy8mZiMjK2eaXlKry8hNa1Njcx5vPuYzSA4/lgged12gJgdtFN4AbDBMyLgV7TYjqa sO2WozRPrfxiqak2PTHmBRhvaiUvWaAH+Q8ZftPQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexei Starovoitov , Andrii Nakryiko , Daniel Borkmann , Sasha Levin Subject: [PATCH 5.3 125/148] selftests/bpf: adjust strobemeta loop to satisfy latest clang Date: Thu, 10 Oct 2019 10:36:26 +0200 Message-Id: <20191010083618.634149576@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191010083609.660878383@linuxfoundation.org> References: <20191010083609.660878383@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrii Nakryiko [ Upstream commit 4670d68b9254710fdeaf794cad54d8b2c9929e0a ] Some recent changes in latest Clang started causing the following warning when unrolling strobemeta test case main loop: progs/strobemeta.h:416:2: warning: loop not unrolled: the optimizer was unable to perform the requested transformation; the transformation might be disabled or specified as part of an unsupported transformation ordering [-Wpass-failed=transform-warning] This patch simplifies loop's exit condition to depend only on constant max iteration number (STROBE_MAX_MAP_ENTRIES), while moving early termination logic inside the loop body. The changes are equivalent from program logic standpoint, but fixes the warning. It also appears to improve generated BPF code, as it fixes previously failing non-unrolled strobemeta test cases. Cc: Alexei Starovoitov Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Signed-off-by: Sasha Levin --- tools/testing/selftests/bpf/progs/strobemeta.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/progs/strobemeta.h b/tools/testing/selftests/bpf/progs/strobemeta.h index 8a399bdfd9203..067eb625d01c5 100644 --- a/tools/testing/selftests/bpf/progs/strobemeta.h +++ b/tools/testing/selftests/bpf/progs/strobemeta.h @@ -413,7 +413,10 @@ static __always_inline void *read_map_var(struct strobemeta_cfg *cfg, #else #pragma unroll #endif - for (int i = 0; i < STROBE_MAX_MAP_ENTRIES && i < map.cnt; ++i) { + for (int i = 0; i < STROBE_MAX_MAP_ENTRIES; ++i) { + if (i >= map.cnt) + break; + descr->key_lens[i] = 0; len = bpf_probe_read_str(payload, STROBE_MAX_STR_LEN, map.entries[i].key); -- 2.20.1