Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3165900imw; Mon, 11 Jul 2022 03:20:15 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uS6OPkmhSe4gzi6/SH3tjmSLQKM6oU/5qYMSwB4AJT5W7kl1dFDDRfMMlC03XBJUW3eeoB X-Received: by 2002:a17:90a:c08d:b0:1ef:b1ed:bdf1 with SMTP id o13-20020a17090ac08d00b001efb1edbdf1mr17027527pjs.83.1657534815464; Mon, 11 Jul 2022 03:20:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657534815; cv=none; d=google.com; s=arc-20160816; b=Z0MP/bWm5QBLgRa5KakRxzLNctIzg+LuLX5PTyCZ2zjV0UZN1yf5IlsvQ5rdZRerDk i2VIj7N4IPwkmkbLbPa3DMnTXgausd9MbXK1rlfXx46gluJi9ZkM5fAOWIFCAIrXV2Hc p2PWBp9rYhL+kCAhit9oSpvf6JRehC0qZJf/AXKsDWBsVAntr79sI7BocDPL5ejGgSP/ vwJKv11SXKt37NOn1h+AURvAuw2CmfU+xMosHmfwuDE4MaoIrS8/lue6DEo/9Cq5XBw2 voXz1At12toS5TeeqCHMxWW+/WB4+Fmog/1h+uQgontcj4xfyqICPnrUViUu6brsGHay 3sBw== 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=kEzlssHlvYsE9SSe+7beq+RlJYR4BZFU16NU0yvEumY=; b=TgjMzI1FU4peac/zcfVWgqBmMSMcCB3Wtz8GfKKTDQY+uGf01qZ34zUvJPG0YW5vq7 ckJ/mBj+BwPyclo6dFgVgS3xqO+ve63TyI6+/op2SARPXgyuPt4Dkj11EQtdf9Zgg/Mq laq/F4dZQXm/foY0wIgdPG+HK/6f1oIOnNdvBEHZwQfN9yiVDJdMdbgduryw1jY0H5sL tcoqst/YO7FYAW1dJD9LZhaqKcnH65hQhtB0fC0pUTEMjJR5XcajV+RZMZ2ZEjBfUdBT VAhRWFetUP0iHfsxmRJHxW5pCpuKHQ9ybDLMmK1RUg+5Tr5FK0JcMXpCeQYU4QSJcV4g NLtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Aj7VhqrI; 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 s9-20020a637709000000b003fc61e0fb47si10112103pgc.799.2022.07.11.03.20.03; Mon, 11 Jul 2022 03:20:15 -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=Aj7VhqrI; 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 S231335AbiGKJNv (ORCPT + 99 others); Mon, 11 Jul 2022 05:13:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231434AbiGKJNO (ORCPT ); Mon, 11 Jul 2022 05:13:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13B6030553; Mon, 11 Jul 2022 02:09:41 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 4E60D611CB; Mon, 11 Jul 2022 09:09:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5732FC34115; Mon, 11 Jul 2022 09:09:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530580; bh=Hu5XHNuadzhnfV07s7lGbtakx0/CBfLfMKsQhHeJ2v4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Aj7VhqrIRsvBxQA6dAR9zZED07dZSCDjv/ZRj/TcRfpNJW6+f6qTNFUDAPu+cQUug 0tCSk1dngjIipkZ/DnjkRKm6Jb9h7IJG3eimao7ZrIUZomxjSv3pdgNQsxIXrROOka x15GzwU4BndkGOTK4UFK7Y2rZbdI1j+FqAjdInwk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vladimir Oltean , Ido Schimmel , Paolo Abeni , Sasha Levin Subject: [PATCH 4.19 20/31] selftests: forwarding: fix flood_unicast_test when h2 supports IFF_UNICAST_FLT Date: Mon, 11 Jul 2022 11:06:59 +0200 Message-Id: <20220711090538.444068869@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090537.841305347@linuxfoundation.org> References: <20220711090537.841305347@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.7 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: Vladimir Oltean [ Upstream commit b8e629b05f5d23f9649c901bef09fab8b0c2e4b9 ] As mentioned in the blamed commit, flood_unicast_test() works by checking the match count on a tc filter placed on the receiving interface. But the second host interface (host2_if) has no interest in receiving a packet with MAC DA de:ad:be:ef:13:37, so its RX filter drops it even before the ingress tc filter gets to be executed. So we will incorrectly get the message "Packet was not flooded when should", when in fact, the packet was flooded as expected but dropped due to an unrelated reason, at some other layer on the receiving side. Force h2 to accept this packet by temporarily placing it in promiscuous mode. Alternatively we could either deliver to its MAC address or use tcpdump_start, but this has the fewest complications. This fixes the "flooding" test from bridge_vlan_aware.sh and bridge_vlan_unaware.sh, which calls flood_test from the lib. Fixes: 236dd50bf67a ("selftests: forwarding: Add a test for flooded traffic") Signed-off-by: Vladimir Oltean Reviewed-by: Ido Schimmel Tested-by: Ido Schimmel Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- tools/testing/selftests/net/forwarding/lib.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh index 08bac6cf1bb3..4d98e8940095 100644 --- a/tools/testing/selftests/net/forwarding/lib.sh +++ b/tools/testing/selftests/net/forwarding/lib.sh @@ -885,6 +885,7 @@ flood_test_do() # Add an ACL on `host2_if` which will tell us whether the packet # was flooded to it or not. + ip link set $host2_if promisc on tc qdisc add dev $host2_if ingress tc filter add dev $host2_if ingress protocol ip pref 1 handle 101 \ flower dst_mac $mac action drop @@ -902,6 +903,7 @@ flood_test_do() tc filter del dev $host2_if ingress protocol ip pref 1 handle 101 flower tc qdisc del dev $host2_if ingress + ip link set $host2_if promisc off return $err } -- 2.35.1