Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9172725pxu; Mon, 28 Dec 2020 08:22:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJwICZn5UT621F8nXdSR/V9KgmqjYafjx+V9trSMcLOe7XLkD8aJckoBV5TNUJ5Z4JrFcDMh X-Received: by 2002:a17:906:1ed6:: with SMTP id m22mr43857990ejj.231.1609172570931; Mon, 28 Dec 2020 08:22:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609172570; cv=none; d=google.com; s=arc-20160816; b=LzZD2Smxjw4Wvid2TaR/gw1Vw1zJ33QE32Ql729/xxvS5B+eVQ98WhKEm5Xqu9wU86 FXrPcnzy+9EpmH7hqXRmEwpXEbcGtE5GdrRcJH0jR8H/ug3tn1xdEqKPv9jh7XFfhrNC 32Y2wDSAhK6PoX4OCDKwiWdDrO0N0pRNYmt7h8j8bX1anDmFIOCX/T2CusEJkoeiC4Ej WYCAUNIIxLCCQpKATdcT94DWzEp6u2LLkcOjTGCFCoptIg8HFhXg3HlGAX4kP/iIJosN bkwG13kmVd2IUS3vz/5U7q5rBnvjX50ISYCNT2yls2lCju0cj+i2PCA3a69iC7oEVRUL 4bew== 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=fp5VnujwxpnwjquTPM+6LeMR9n5G35FLZyikIzBr6UQ=; b=MDNRFk9kIwLEYFv+vVC1kjBMhREPa0+hae7qwSDbtwvJzIBplXjKrgHwXwJjtpfSbK xb6GjWBYYbhUV9e/weXTZchy5wEvY/6mobIb8LGaoMgFpJI+R436ByKX/X3wVdrRftQO 5jXKCuSPtGXkA1UxmCopy/aDEwFXo+CNNwI0ECyx9SAPpJZnLChslvMlrpawuikYTGbq Tj6BjMziSgJOj9x5oT4XetNLN7ruPLuHNdEzZdB7j33bXWIzII4LxVeTqCWtDI9y56uA XmDGuz3e74eVo7ubN/NydCg5NLdKWriKWUb59ku1ASn54OEIUzpHHLJMld5FVqF6QyQa bODg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FYuLkqnz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m12si18204968ejr.608.2020.12.28.08.22.27; Mon, 28 Dec 2020 08:22:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FYuLkqnz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1732365AbgL1NOB (ORCPT + 99 others); Mon, 28 Dec 2020 08:14:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:41832 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732320AbgL1NN4 (ORCPT ); Mon, 28 Dec 2020 08:13:56 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id A7897207CF; Mon, 28 Dec 2020 13:13:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609161221; bh=b4HI2o2L0UGgvI4NCxWbGluFCSpvWLmEED1AhU6H+18=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FYuLkqnzICX7lxNOCDiwE65j917rc6OPNcMyl73YyjPc6SuoZdcFw5CXk+VcrwVtE RluFB0ZnfNe1F0GHo6sF8BJJjwvaE2gSgIlaTERHaa1XuGsLvcaAgj96CwwXQzveA5 itLL7WmqDz7VKLzum8q0Mo5Z5q1iPHdDS/Ag+uzQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Daniel T. Lee" , Andrii Nakryiko , Sasha Levin Subject: [PATCH 4.14 113/242] samples: bpf: Fix lwt_len_hist reusing previous BPF map Date: Mon, 28 Dec 2020 13:48:38 +0100 Message-Id: <20201228124910.254906372@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124904.654293249@linuxfoundation.org> References: <20201228124904.654293249@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Daniel T. Lee [ Upstream commit 0afe0a998c40085a6342e1aeb4c510cccba46caf ] Currently, lwt_len_hist's map lwt_len_hist_map is uses pinning, and the map isn't cleared on test end. This leds to reuse of that map for each test, which prevents the results of the test from being accurate. This commit fixes the problem by removing of pinned map from bpffs. Also, this commit add the executable permission to shell script files. Fixes: f74599f7c5309 ("bpf: Add tests and samples for LWT-BPF") Signed-off-by: Daniel T. Lee Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20201124090310.24374-7-danieltimlee@gmail.com Signed-off-by: Sasha Levin --- samples/bpf/lwt_len_hist.sh | 2 ++ samples/bpf/test_lwt_bpf.sh | 0 2 files changed, 2 insertions(+) mode change 100644 => 100755 samples/bpf/lwt_len_hist.sh mode change 100644 => 100755 samples/bpf/test_lwt_bpf.sh diff --git a/samples/bpf/lwt_len_hist.sh b/samples/bpf/lwt_len_hist.sh old mode 100644 new mode 100755 index 090b96eaf7f76..0eda9754f50b8 --- a/samples/bpf/lwt_len_hist.sh +++ b/samples/bpf/lwt_len_hist.sh @@ -8,6 +8,8 @@ VETH1=tst_lwt1b TRACE_ROOT=/sys/kernel/debug/tracing function cleanup { + # To reset saved histogram, remove pinned map + rm /sys/fs/bpf/tc/globals/lwt_len_hist_map ip route del 192.168.253.2/32 dev $VETH0 2> /dev/null ip link del $VETH0 2> /dev/null ip link del $VETH1 2> /dev/null diff --git a/samples/bpf/test_lwt_bpf.sh b/samples/bpf/test_lwt_bpf.sh old mode 100644 new mode 100755 -- 2.27.0