From patchwork Tue Oct 27 18:59:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Aleksandrov X-Patchwork-Id: 298536 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB08DC4363A for ; Tue, 27 Oct 2020 19:00:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7A4D5208B8 for ; Tue, 27 Oct 2020 19:00:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=blackwall-org.20150623.gappssmtp.com header.i=@blackwall-org.20150623.gappssmtp.com header.b="yAQv4R8r" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1817099AbgJ0TAx (ORCPT ); Tue, 27 Oct 2020 15:00:53 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:41551 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S371355AbgJ0TAI (ORCPT ); Tue, 27 Oct 2020 15:00:08 -0400 Received: by mail-wr1-f68.google.com with SMTP id s9so3112875wro.8 for ; Tue, 27 Oct 2020 12:00:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=blackwall-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qug/l2PaHPdn5nmmo5MAN4jJnMHDysyaTDj3MD0cWk8=; b=yAQv4R8rgsLyHmAPm5o97IiojoAcx5+7ufwQVOSCinvt1RK0kxjCmtYzdoTwaAxiou H6764HMhlANaqp75yBugcbRLxBenWlYjL1RNs/AsO3qN6EG2Gnqi4Jh4ZRD+RhtCFIe3 m7WKVivxJCNzzQkJkhyQqAnbbjUHQgmf9KyG+lIcXEjB6Qh+6uUZMHNiUX82WdN1oQRB Bl37O8AaW0AjdVaylhO0oyAylaFTbNwLNhz6BGZVQA92XSxulTg/eQTyCoXxSC/uLQZ2 aFtorS94NL2uFpOTsjL6rSA15nxmKDWko6YzsdR3uE10HG+zWjn4a3gg3Dnky701E9Fh cuMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qug/l2PaHPdn5nmmo5MAN4jJnMHDysyaTDj3MD0cWk8=; b=QGAaWuThkqDQEOsztE4bs7yEgr62tzrOdVUTMicZH57sVmd+5q3CIcDBCdTOA59Amk 2yNMjbpN/Fn1AZrVGX63mZpJzF9JJtaYD8QQynQY4zUKPfn25bZHKrcfiIgPcKX+rVi9 QHl2StDrey6AJux0CnuLhOKEeBUvLvdpUP1F7szOMzjuYsxw0JLdKp6PI9ARSGcuaIET zkbZnaPs6MAfZgvjJbAtYjWEYXG1j+SbO3XfX+vfwBDOCp8TgYvhLRiC7VcEDn8ise63 ivauD60uusCoYezovWE69hIUyS2f/iEXnUUbNmgViQ1MfWSfBDh6lVaEKny/e6uowDHw dWEA== X-Gm-Message-State: AOAM532UR3/Yo/6s17rDXIwfLnFKoyx53xUm7xYgAFSG8zeM2idYJVrs ETMcfDG++XQ5UIQdgCZBjQwZn9OIvMxMqH/G X-Google-Smtp-Source: ABdhPJw3dbU05kDu9XZ1JYoYS3bQsbXcEpPRJ+5nT0Cj2GCgiJCFERh1UrhYdAvjEY2KTjzvS651kQ== X-Received: by 2002:adf:c3c6:: with SMTP id d6mr4586243wrg.206.1603825206322; Tue, 27 Oct 2020 12:00:06 -0700 (PDT) Received: from localhost.localdomain (84-238-136-197.ip.btc-net.bg. [84.238.136.197]) by smtp.gmail.com with ESMTPSA id x6sm3219803wmb.17.2020.10.27.12.00.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 12:00:05 -0700 (PDT) From: Nikolay Aleksandrov To: netdev@vger.kernel.org Cc: roopa@nvidia.com, kuba@kernel.org, bridge@lists.linux-foundation.org, Nikolay Aleksandrov Subject: [PATCH net-next 01/16] selftests: net: bridge: rename current igmp tests to igmpv2 Date: Tue, 27 Oct 2020 20:59:19 +0200 Message-Id: <20201027185934.227040-2-razor@blackwall.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20201027185934.227040-1-razor@blackwall.org> References: <20201027185934.227040-1-razor@blackwall.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Nikolay Aleksandrov To prepare the bridge_igmp.sh for IGMPv3 we need to rename the current test to IGMPv2. Signed-off-by: Nikolay Aleksandrov --- tools/testing/selftests/net/forwarding/bridge_igmp.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/net/forwarding/bridge_igmp.sh b/tools/testing/selftests/net/forwarding/bridge_igmp.sh index 88d2472ba151..481198300b72 100755 --- a/tools/testing/selftests/net/forwarding/bridge_igmp.sh +++ b/tools/testing/selftests/net/forwarding/bridge_igmp.sh @@ -1,7 +1,7 @@ #!/bin/bash # SPDX-License-Identifier: GPL-2.0 -ALL_TESTS="reportleave_test" +ALL_TESTS="v2reportleave_test" NUM_NETIFS=4 CHECK_TC="yes" TEST_GROUP="239.10.10.10" @@ -110,7 +110,7 @@ mcast_packet_test() return $seen } -reportleave_test() +v2reportleave_test() { RET=0 ip address add dev $h2 $TEST_GROUP/32 autojoin @@ -118,12 +118,12 @@ reportleave_test() sleep 5 bridge mdb show dev br0 | grep $TEST_GROUP 1>/dev/null - check_err $? "Report didn't create mdb entry for $TEST_GROUP" + check_err $? "IGMPv2 report didn't create mdb entry for $TEST_GROUP" mcast_packet_test $TEST_GROUP_MAC $TEST_GROUP $h1 $h2 check_fail $? "Traffic to $TEST_GROUP wasn't forwarded" - log_test "IGMP report $TEST_GROUP" + log_test "IGMPv2 report $TEST_GROUP" RET=0 bridge mdb show dev br0 | grep $TEST_GROUP 1>/dev/null @@ -139,7 +139,7 @@ reportleave_test() mcast_packet_test $TEST_GROUP_MAC $TEST_GROUP $h1 $h2 check_err $? "Traffic to $TEST_GROUP was forwarded without mdb entry" - log_test "IGMP leave $TEST_GROUP" + log_test "IGMPv2 leave $TEST_GROUP" } trap cleanup EXIT From patchwork Tue Oct 27 18:59:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Aleksandrov X-Patchwork-Id: 298534 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C9B0C4363A for ; Tue, 27 Oct 2020 19:01:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E95B021D24 for ; Tue, 27 Oct 2020 19:01:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=blackwall-org.20150623.gappssmtp.com header.i=@blackwall-org.20150623.gappssmtp.com header.b="Pbbgzu7U" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1829212AbgJ0TBE (ORCPT ); Tue, 27 Oct 2020 15:01:04 -0400 Received: from mail-wr1-f53.google.com ([209.85.221.53]:45061 "EHLO mail-wr1-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S371356AbgJ0TAK (ORCPT ); Tue, 27 Oct 2020 15:00:10 -0400 Received: by mail-wr1-f53.google.com with SMTP id e17so3085440wru.12 for ; Tue, 27 Oct 2020 12:00:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=blackwall-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tLPWNUeiDX6YqJv0P1s9lGNPu+RgfZ8zS9WrTNhZtwU=; b=Pbbgzu7Uim9URoVPsODKBzIRpIWNZUV/sc1OsVCs/ctmhcIQJuqP1Da07kJ2ti9/rK zwadkwjLlxDK6vSMPMNy7hOKGF9z/TVWXc++pM9nsU6I2AuCe/CIsrnng25YCjNkjb4f nyOsGMfA8wywQAx2ipPq2e+Cm42KAUKXLliz5jwbRyp1GGAZtlPV0gPBOKSl6pt+XRkh jhlsFvNWPtpOonDa/1z7uV3cBIFFMK7HjMxd29Pc6KJwjY0diRy6Y9jWj3DpTW9TVLii jpwVVOEsvNW0ITz2hhefUMxxEdpP8Qt870u1sEdMawZhO0x30jL4RKpm3No+NrtAJE0S WLTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tLPWNUeiDX6YqJv0P1s9lGNPu+RgfZ8zS9WrTNhZtwU=; b=F5NKwBvaYg5eMtIoSMmyBb0GblSMJKsJEIYMMIYsHHGyfXE+KU7ymyTqQoA6qSGz2c hL6HIjvCSzUodmkFKkWIicDnI5Xl60CXBfzDeGtNIL8FIiTo4B5xFQIDcsX+n2zjmDfC mzo3srsIQPu1P1BfKi+/mvbpay2Pr6FNbSVlljLKVjotKcIVj58pPvGvaaW0ZJFB9mAU OvfSlwgizTn4qR6fJAY5p0MMpET6dWwNxYMujNc7hriITYvlmnryQd/BR8OOLAxo9w5I xEQJ5you028sgsnBfkwgmLKOqp7DsC8ENUYyyZEtS2j4n8bypTBS2lNCvvS1GQXByKFX 5eZQ== X-Gm-Message-State: AOAM530hqO1OfUcYszSUJvU16o7MOnmD8rETUCALvtRFnuXtJGejDzsJ SpBlQV9RZ9DWGX9hm2Y/Fv5sCf02/6P0Gov6 X-Google-Smtp-Source: ABdhPJzG/OSgYLmz2HBNiIC8mB9c1vzZDllDh54O3gAqpvWndh4V2M5gurPd/JiO/Om2Nd0bKkjvbA== X-Received: by 2002:adf:94e6:: with SMTP id 93mr4299190wrr.190.1603825207449; Tue, 27 Oct 2020 12:00:07 -0700 (PDT) Received: from localhost.localdomain (84-238-136-197.ip.btc-net.bg. [84.238.136.197]) by smtp.gmail.com with ESMTPSA id x6sm3219803wmb.17.2020.10.27.12.00.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 12:00:07 -0700 (PDT) From: Nikolay Aleksandrov To: netdev@vger.kernel.org Cc: roopa@nvidia.com, kuba@kernel.org, bridge@lists.linux-foundation.org, Nikolay Aleksandrov Subject: [PATCH net-next 02/16] selftests: net: bridge: igmp: add support for packet source address Date: Tue, 27 Oct 2020 20:59:20 +0200 Message-Id: <20201027185934.227040-3-razor@blackwall.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20201027185934.227040-1-razor@blackwall.org> References: <20201027185934.227040-1-razor@blackwall.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Nikolay Aleksandrov Add support for one more argument which specifies the source address to use. It will be later used for IGMPv3 S,G entry testing. Signed-off-by: Nikolay Aleksandrov --- .../testing/selftests/net/forwarding/bridge_igmp.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tools/testing/selftests/net/forwarding/bridge_igmp.sh b/tools/testing/selftests/net/forwarding/bridge_igmp.sh index 481198300b72..1c19459dbc58 100755 --- a/tools/testing/selftests/net/forwarding/bridge_igmp.sh +++ b/tools/testing/selftests/net/forwarding/bridge_igmp.sh @@ -83,9 +83,10 @@ cleanup() mcast_packet_test() { local mac=$1 - local ip=$2 - local host1_if=$3 - local host2_if=$4 + local src_ip=$2 + local ip=$3 + local host1_if=$4 + local host2_if=$5 local seen=0 # Add an ACL on `host2_if` which will tell us whether the packet @@ -94,7 +95,7 @@ mcast_packet_test() tc filter add dev $host2_if ingress protocol ip pref 1 handle 101 \ flower dst_mac $mac action drop - $MZ $host1_if -c 1 -p 64 -b $mac -B $ip -t udp "dp=4096,sp=2048" -q + $MZ $host1_if -c 1 -p 64 -b $mac -A $src_ip -B $ip -t udp "dp=4096,sp=2048" -q sleep 1 tc -j -s filter show dev $host2_if ingress \ @@ -120,7 +121,7 @@ v2reportleave_test() bridge mdb show dev br0 | grep $TEST_GROUP 1>/dev/null check_err $? "IGMPv2 report didn't create mdb entry for $TEST_GROUP" - mcast_packet_test $TEST_GROUP_MAC $TEST_GROUP $h1 $h2 + mcast_packet_test $TEST_GROUP_MAC 192.0.2.1 $TEST_GROUP $h1 $h2 check_fail $? "Traffic to $TEST_GROUP wasn't forwarded" log_test "IGMPv2 report $TEST_GROUP" @@ -136,7 +137,7 @@ v2reportleave_test() bridge mdb show dev br0 | grep $TEST_GROUP 1>/dev/null check_fail $? "Leave didn't delete mdb entry for $TEST_GROUP" - mcast_packet_test $TEST_GROUP_MAC $TEST_GROUP $h1 $h2 + mcast_packet_test $TEST_GROUP_MAC 192.0.2.1 $TEST_GROUP $h1 $h2 check_err $? "Traffic to $TEST_GROUP was forwarded without mdb entry" log_test "IGMPv2 leave $TEST_GROUP" From patchwork Tue Oct 27 18:59:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Aleksandrov X-Patchwork-Id: 298535 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E760BC4363A for ; Tue, 27 Oct 2020 19:01:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A63F820878 for ; Tue, 27 Oct 2020 19:01:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=blackwall-org.20150623.gappssmtp.com header.i=@blackwall-org.20150623.gappssmtp.com header.b="P4jRtSiv" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1829206AbgJ0TBA (ORCPT ); Tue, 27 Oct 2020 15:01:00 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:41556 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S371357AbgJ0TAM (ORCPT ); Tue, 27 Oct 2020 15:00:12 -0400 Received: by mail-wr1-f65.google.com with SMTP id s9so3113073wro.8 for ; Tue, 27 Oct 2020 12:00:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=blackwall-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=a8a/oVFoV9MTiz2akf3h4usj7NJQcCNmdh3b+TKbrQA=; b=P4jRtSivE3zFaJhLu81Q2XNew3IIJiT+Px3Whj9g1g8Gc7u3qcaobFj+YtwCNzgSSs bo8/7GN+l7b3fv3p3sWA2JZy8UXUxtly4N3B3zPvjQR1pdN/IVrQ1FeDuifm+bibZmge j/SvIb2kbVUtNsodCKc879jyO1WDZPwI/+7Jo4MkjSpcwzVFBujXq+tZl655OLydnq88 OR/k0qUg3B/RDIvTRZyEA4zUbLE3exjfJh1yGXSXi753GzDTqdyAMNZzQGHpR5VIWkvh 6F2C1sBxCrTzh022tfqYSSsKeSxdVQBHKJT8HwqC2s/KSMIhucdtCW3A8YwyoCntzkPy 9YjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=a8a/oVFoV9MTiz2akf3h4usj7NJQcCNmdh3b+TKbrQA=; b=iNexRAmkbtZco+jwfyx+nzPageMV3ACttg649gq/x87udQEzpx14gJXVYV60epfkJZ AHXZSJtwTBIl59WmYMmQmH9emP1Bww2U9bfiiT3oVvf6dtv4SkBKtYnp7kmkbG/0yoAu Wc903XYFnKGeO50NO/kpS+QOMlyPq3O7vX6vZj552VjijsYfa1sYy8xE6B6DaEE9GG5f Uu9CWwHqAkqS/y8bdN6IkKbfk1fERLs4GmqxkLx7ivT2Zal+kD6ZdinpUe/1liUaPXu3 PWZBlQ8JG+f8/+nRgAw9ffLyL4JD2q9NxRlE94qMjsxWpOOriDr8wzqKbCFs++PxxVCy qGaQ== X-Gm-Message-State: AOAM530EXoiyRbcv828JZ6SM2APO43q4DLxr00vi74TUXm4vBIPdF5M0 wA5Qnf5TILpCBhbh11nkJAc7mrl3obflewyA X-Google-Smtp-Source: ABdhPJy6oZTZKiqP/ci+0HGrgHauw0AUcqHOwQrQTf7wYMyuZtDGcv00BLROWYVJvzm94AUKlbObSg== X-Received: by 2002:adf:f1cd:: with SMTP id z13mr4456623wro.197.1603825209356; Tue, 27 Oct 2020 12:00:09 -0700 (PDT) Received: from localhost.localdomain (84-238-136-197.ip.btc-net.bg. [84.238.136.197]) by smtp.gmail.com with ESMTPSA id x6sm3219803wmb.17.2020.10.27.12.00.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 12:00:08 -0700 (PDT) From: Nikolay Aleksandrov To: netdev@vger.kernel.org Cc: roopa@nvidia.com, kuba@kernel.org, bridge@lists.linux-foundation.org, Nikolay Aleksandrov Subject: [PATCH net-next 03/16] selftests: net: bridge: igmp: check for specific udp ip protocol Date: Tue, 27 Oct 2020 20:59:21 +0200 Message-Id: <20201027185934.227040-4-razor@blackwall.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20201027185934.227040-1-razor@blackwall.org> References: <20201027185934.227040-1-razor@blackwall.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Nikolay Aleksandrov We have to specifically check for udp protocol in addition to the mac address because in IGMPv3 tests group-specific queries will use the same mac address. Signed-off-by: Nikolay Aleksandrov --- tools/testing/selftests/net/forwarding/bridge_igmp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/forwarding/bridge_igmp.sh b/tools/testing/selftests/net/forwarding/bridge_igmp.sh index 1c19459dbc58..5562aef14c0a 100755 --- a/tools/testing/selftests/net/forwarding/bridge_igmp.sh +++ b/tools/testing/selftests/net/forwarding/bridge_igmp.sh @@ -93,7 +93,7 @@ mcast_packet_test() # was received by it or not. 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 + flower ip_proto udp dst_mac $mac action drop $MZ $host1_if -c 1 -p 64 -b $mac -A $src_ip -B $ip -t udp "dp=4096,sp=2048" -q sleep 1 From patchwork Tue Oct 27 18:59:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Aleksandrov X-Patchwork-Id: 298532 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80477C4363A for ; Tue, 27 Oct 2020 19:01:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2C4AD21556 for ; Tue, 27 Oct 2020 19:01:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=blackwall-org.20150623.gappssmtp.com header.i=@blackwall-org.20150623.gappssmtp.com header.b="EaoDx91o" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S371426AbgJ0TBV (ORCPT ); Tue, 27 Oct 2020 15:01:21 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:36361 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S371361AbgJ0TAQ (ORCPT ); Tue, 27 Oct 2020 15:00:16 -0400 Received: by mail-wr1-f68.google.com with SMTP id x7so3130160wrl.3 for ; Tue, 27 Oct 2020 12:00:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=blackwall-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6HkZ/6PSGeiabpA/B/b1jjSowyj9GrVJsqEVL3OW8Gg=; b=EaoDx91o8fUnm+lClViM5aHRXCtgSqhpTvwagt0QiZHxRXIG3ecz2TV5FXYqwvZy/7 WfTOwmHr9FuytAtR4t1WHSoXgJWOhZaLPmgD9oaoP8s9KZ0/JLVLSfbp219p549kTkAL huDVbXJvA+dein2g84RfRSCUYq2fWYegvCM3M/WMH4VZZSKzR7jBiKCKYXUQWjpzpfrX 4KsjZLQxfUaspFK+Nyv4FH6+k40pEpnHgjqtJxfa4b2MZgyHeZC6wG8CBU8ZkUwfUYWg NenQfUaYyhQdjCpZCr3bZ5g2f/eX94etr3sLMzInM41du1AKFkUE75yDjge2ZDwITFAe v2bA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6HkZ/6PSGeiabpA/B/b1jjSowyj9GrVJsqEVL3OW8Gg=; b=KR3jOGKJO6dCB0RwVvU47lK3UbeLJt7CHGssYbwwlDZx2OZ2kvgEkHnAuPrTAJT6xg 6G3I74ORAvj9ocGRzXDdwNw+ZZ/oPvUgARVwQvRuEaWhAlXnO4bv+LnLKHNet5p+POru at7+f+F9VQdl/1d6lV+UqPTPUMlT6Kql/BRGtLR9gzXeN/h8n9ZWz8JAoKUBymnKlidu qrbF+W/dIup5izaQeGpdaj0Ix89EG6cakQno61q/Jyul7Q4ckDxfBsIBvD7ocA/u3NZi 0kXKrs9zP5wbNF8UTn+YSubDLw5FsUkamtZFqmkp/fXDgxlTIgfAReEVw2fSCq1gHUde 9BzA== X-Gm-Message-State: AOAM532GJV7zAHn25UPIfLBrHK8HjBV3K2shI7jiwOk21Fxn2XrZV2jb CTEnrABHSo1nMGky7x+2IIsec5K3v9GEZu2i X-Google-Smtp-Source: ABdhPJwVyXBlPxDCcS/ezwgZhQ9U5RFWEwJvAKWbxEftL+IxAF+WoSxAwD3UCUVXxJDFlvwjeKaD0w== X-Received: by 2002:adf:a557:: with SMTP id j23mr4716801wrb.95.1603825213429; Tue, 27 Oct 2020 12:00:13 -0700 (PDT) Received: from localhost.localdomain (84-238-136-197.ip.btc-net.bg. [84.238.136.197]) by smtp.gmail.com with ESMTPSA id x6sm3219803wmb.17.2020.10.27.12.00.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 12:00:12 -0700 (PDT) From: Nikolay Aleksandrov To: netdev@vger.kernel.org Cc: roopa@nvidia.com, kuba@kernel.org, bridge@lists.linux-foundation.org, Nikolay Aleksandrov Subject: [PATCH net-next 06/16] selftests: net: bridge: add test for igmpv3 inc -> is_include report Date: Tue, 27 Oct 2020 20:59:24 +0200 Message-Id: <20201027185934.227040-7-razor@blackwall.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20201027185934.227040-1-razor@blackwall.org> References: <20201027185934.227040-1-razor@blackwall.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Nikolay Aleksandrov The test checks for the following case: state report result action INCLUDE (A) IS_IN (B) INCLUDE (A+B) (B)=GMI Signed-off-by: Nikolay Aleksandrov --- .../selftests/net/forwarding/bridge_igmp.sh | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/forwarding/bridge_igmp.sh b/tools/testing/selftests/net/forwarding/bridge_igmp.sh index e9999e346ea6..added5c69e8b 100755 --- a/tools/testing/selftests/net/forwarding/bridge_igmp.sh +++ b/tools/testing/selftests/net/forwarding/bridge_igmp.sh @@ -1,7 +1,7 @@ #!/bin/bash # SPDX-License-Identifier: GPL-2.0 -ALL_TESTS="v2reportleave_test v3include_test v3inc_allow_test" +ALL_TESTS="v2reportleave_test v3include_test v3inc_allow_test v3inc_is_include_test" NUM_NETIFS=4 CHECK_TC="yes" TEST_GROUP="239.10.10.10" @@ -12,6 +12,8 @@ ALL_MAC="01:00:5e:00:00:01" # IGMPv3 is_in report: grp 239.10.10.10 is_include 192.0.2.1,192.0.2.2,192.0.2.3 MZPKT_IS_INC="22:00:9d:de:00:00:00:01:01:00:00:03:ef:0a:0a:0a:c0:00:02:01:c0:00:02:02:c0:00:02:03" +# IGMPv3 is_in report: grp 239.10.10.10 is_include 192.0.2.10,192.0.2.11,192.0.2.12 +MZPKT_IS_INC2="22:00:9d:c3:00:00:00:01:01:00:00:03:ef:0a:0a:0a:c0:00:02:0a:c0:00:02:0b:c0:00:02:0c" # IGMPv3 allow report: grp 239.10.10.10 allow 192.0.2.10,192.0.2.11,192.0.2.12 MZPKT_ALLOW="22:00:99:c3:00:00:00:01:05:00:00:03:ef:0a:0a:0a:c0:00:02:0a:c0:00:02:0b:c0:00:02:0c" @@ -290,6 +292,27 @@ v3inc_allow_test() v3cleanup $swp1 $TEST_GROUP } +v3inc_is_include_test() +{ + RET=0 + local X=("192.0.2.10" "192.0.2.11" "192.0.2.12") + + v3include_prepare $h1 $ALL_MAC $ALL_GROUP + + $MZ $h1 -c 1 -b $ALL_MAC -B $ALL_GROUP -t ip "proto=2,p=$MZPKT_IS_INC2" -q + sleep 1 + check_sg_entries "is_include" "${X[@]}" + + check_sg_state 0 "${X[@]}" + + check_sg_fwding 1 "${X[@]}" + check_sg_fwding 0 "192.0.2.100" + + log_test "IGMPv3 report $TEST_GROUP include -> is_include" + + v3cleanup $swp1 $TEST_GROUP +} + trap cleanup EXIT setup_prepare From patchwork Tue Oct 27 18:59:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Aleksandrov X-Patchwork-Id: 298533 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BAB07C55178 for ; Tue, 27 Oct 2020 19:01:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5671121527 for ; Tue, 27 Oct 2020 19:01:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=blackwall-org.20150623.gappssmtp.com header.i=@blackwall-org.20150623.gappssmtp.com header.b="oolbQbp+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S371414AbgJ0TBR (ORCPT ); Tue, 27 Oct 2020 15:01:17 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:37168 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S371364AbgJ0TAS (ORCPT ); Tue, 27 Oct 2020 15:00:18 -0400 Received: by mail-wr1-f66.google.com with SMTP id w1so3136156wrm.4 for ; Tue, 27 Oct 2020 12:00:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=blackwall-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JzKJIP19qAr7tycB0lsJIxtVUIVBOP2rnZUT6EMgcEg=; b=oolbQbp+RAdedRw2nl+g+MjzgZviiwdPjEqDHPDZCSGcD3xrCoiLMsyr3koqNz8Ktw CLZzaS0+/Tqq85mwNfhRvB7Ss1MgrTNj4FrzV+k5qb6Wjp3iL4yvaLLsDJ/TRdi83ELD RhQJ2kOtqYB8yjj6WXeHSG3RlK8TRnBHX9PZvBKTA9KNcX6feOUfAa73W2GqEKR5Y2Ca SmgigMaPSmu1cabKPV7Z2fZt5zXoVYVkaa3ebFI1GMC4QY+7+UvWWVPMP8wUHGY6qOhg b6VUwZc3qGoNXesQZStDnyF51OyheA0lpUR3MVCdaPOyuDUR7GLXgy4hEC0tElvRBPKV dy5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JzKJIP19qAr7tycB0lsJIxtVUIVBOP2rnZUT6EMgcEg=; b=YuvqG9qtL8v8Bx9cHu5kfIxr5vuPbaz+8qUIvgyo4H70SoDWCvR40wPsPR/p3u3PuK vHWjeeaZ8GAZ88QfFfU4XS4GYbGXdMCpHSkV57KYZtRgXH75Ze6k+4WIG1Aw9i7hR4Jr aGENr3/N1nh+B8K5rw3zyWsvKe9z3/IybuYYuMlJYyvWJp/5TD1OxJZV5M3ozYH2hzy0 7HKLombLj4tQl7N719beHT5dYqI+4qJ08K/rtqWOsXAJ/wH2ey+2q7xe+LyCu2+utvG9 xMkoB9NdiW9uTYzsv2ayEvS+x7d2yaYpo8uRdw/TX/kSKzmKKF/kObfj/lQWlYZ94ibV SmDg== X-Gm-Message-State: AOAM53126YU2NsMXmN4Vlwc3KCJ9+IXCT2CokXF1Rqgt1Nl7gPiHGWjG C5i/3qxQfyZpGQzV97WVLI0jp7HLFnlssb/P X-Google-Smtp-Source: ABdhPJzgvwtSVBngsQIJw0RAb4dfZsKGeznf5cPLM5c7KM64w0zdnWtACQQSyHWUPLNLlOKVbBcP8Q== X-Received: by 2002:adf:f4d2:: with SMTP id h18mr4229152wrp.99.1603825215763; Tue, 27 Oct 2020 12:00:15 -0700 (PDT) Received: from localhost.localdomain (84-238-136-197.ip.btc-net.bg. [84.238.136.197]) by smtp.gmail.com with ESMTPSA id x6sm3219803wmb.17.2020.10.27.12.00.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 12:00:15 -0700 (PDT) From: Nikolay Aleksandrov To: netdev@vger.kernel.org Cc: roopa@nvidia.com, kuba@kernel.org, bridge@lists.linux-foundation.org, Nikolay Aleksandrov Subject: [PATCH net-next 08/16] selftests: net: bridge: add test for igmpv3 inc -> to_exclude report Date: Tue, 27 Oct 2020 20:59:26 +0200 Message-Id: <20201027185934.227040-9-razor@blackwall.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20201027185934.227040-1-razor@blackwall.org> References: <20201027185934.227040-1-razor@blackwall.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Nikolay Aleksandrov The test checks for the following case: state report result action INCLUDE (A) TO_EX (B) EXCLUDE (A*B,B-A) (B-A)=0 Delete (A-B) Send Q(G,A*B) Group Timer=GMI Signed-off-by: Nikolay Aleksandrov --- .../selftests/net/forwarding/bridge_igmp.sh | 51 ++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/forwarding/bridge_igmp.sh b/tools/testing/selftests/net/forwarding/bridge_igmp.sh index 34d2c4370fa6..36f10a3168cc 100755 --- a/tools/testing/selftests/net/forwarding/bridge_igmp.sh +++ b/tools/testing/selftests/net/forwarding/bridge_igmp.sh @@ -2,7 +2,7 @@ # SPDX-License-Identifier: GPL-2.0 ALL_TESTS="v2reportleave_test v3include_test v3inc_allow_test v3inc_is_include_test \ - v3inc_is_exclude_test" + v3inc_is_exclude_test v3inc_to_exclude_test" NUM_NETIFS=4 CHECK_TC="yes" TEST_GROUP="239.10.10.10" @@ -19,6 +19,8 @@ MZPKT_IS_INC2="22:00:9d:c3:00:00:00:01:01:00:00:03:ef:0a:0a:0a:c0:00:02:0a:c0:00 MZPKT_ALLOW="22:00:99:c3:00:00:00:01:05:00:00:03:ef:0a:0a:0a:c0:00:02:0a:c0:00:02:0b:c0:00:02:0c" # IGMPv3 is_ex report: grp 239.10.10.10 is_exclude 192.0.2.1,192.0.2.2,192.0.2.20,192.0.2.21 MZPKT_IS_EXC="22:00:da:b6:00:00:00:01:02:00:00:04:ef:0a:0a:0a:c0:00:02:01:c0:00:02:02:c0:00:02:14:c0:00:02:15" +# IGMPv3 to_ex report: grp 239.10.10.10 to_exclude 192.0.2.1,192.0.2.20,192.0.2.30 +MZPKT_TO_EXC="22:00:9a:b1:00:00:00:01:04:00:00:03:ef:0a:0a:0a:c0:00:02:01:c0:00:02:14:c0:00:02:1e" source lib.sh @@ -352,6 +354,53 @@ v3inc_is_exclude_test() v3cleanup $swp1 $TEST_GROUP } +v3inc_to_exclude_test() +{ + RET=0 + local X=("192.0.2.1") + local Y=("192.0.2.20" "192.0.2.30") + + v3include_prepare $h1 $ALL_MAC $ALL_GROUP + + ip link set dev br0 type bridge mcast_last_member_interval 500 + check_err $? "Could not change mcast_last_member_interval to 5s" + + $MZ $h1 -c 1 -b $ALL_MAC -B $ALL_GROUP -t ip "proto=2,p=$MZPKT_TO_EXC" -q + sleep 1 + bridge -j -d -s mdb show dev br0 \ + | jq -e ".[].mdb[] | \ + select(.grp == \"$TEST_GROUP\" and \ + .source_list != null and .filter_mode == \"exclude\")" &>/dev/null + check_err $? "Wrong *,G entry filter mode" + + check_sg_entries "to_exclude" "${X[@]}" "${Y[@]}" + + check_sg_state 0 "${X[@]}" + check_sg_state 1 "${Y[@]}" + + bridge -j -d -s mdb show dev br0 \ + | jq -e ".[].mdb[] | \ + select(.grp == \"$TEST_GROUP\" and \ + .source_list != null and + .source_list[].address == \"192.0.2.2\")" &>/dev/null + check_fail $? "Wrong *,G entry source list, 192.0.2.2 entry still exists" + bridge -j -d -s mdb show dev br0 \ + | jq -e ".[].mdb[] | \ + select(.grp == \"$TEST_GROUP\" and \ + .source_list != null and + .source_list[].address == \"192.0.2.21\")" &>/dev/null + check_fail $? "Wrong *,G entry source list, 192.0.2.21 entry still exists" + + check_sg_fwding 1 "${X[@]}" 192.0.2.100 + check_sg_fwding 0 "${Y[@]}" + + log_test "IGMPv3 report $TEST_GROUP include -> to_exclude" + + ip link set dev br0 type bridge mcast_last_member_interval 100 + + v3cleanup $swp1 $TEST_GROUP +} + trap cleanup EXIT setup_prepare From patchwork Tue Oct 27 18:59:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Aleksandrov X-Patchwork-Id: 298531 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08F88C4363A for ; Tue, 27 Oct 2020 19:01:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B05AB20878 for ; Tue, 27 Oct 2020 19:01:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=blackwall-org.20150623.gappssmtp.com header.i=@blackwall-org.20150623.gappssmtp.com header.b="NRIRVoOb" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S371439AbgJ0TB2 (ORCPT ); Tue, 27 Oct 2020 15:01:28 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:37875 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S371371AbgJ0TAV (ORCPT ); Tue, 27 Oct 2020 15:00:21 -0400 Received: by mail-wm1-f65.google.com with SMTP id c16so2551943wmd.2 for ; Tue, 27 Oct 2020 12:00:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=blackwall-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Asc85PeAu34wOOUcZ5M4BI/jMYTqZqHRSKn8fRmFp+Q=; b=NRIRVoObB74sv3K3+hxR4HW1wX78cjMhupA5bRlj+8nJTuZ9MYgojs81gDBM/niY8o Fj8uKXZvLxaYYc+zsO30MLCgqwiLldUeQcuQSnmi1cXFKwjixQtgv4YmXz+GUnIDuoXD hQPQRuynPvAlIS7vM6kQXZXmB1vm2wxxnunCFknDQ5agLf8twnBnsjpVZLtZCBbNlL9/ 9a/xzzZoOdyfHLU4GBQhlHP2kGjZHetDc+miIswIDLqIic8HaSiDVO2y4t6YoR4W560W /odot+qz7elCLafQIH1RKcnCowgo1G7Fo2G+mU5RGZoiOmXiBreP5RzpM/e8lSeBhKGO tkaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Asc85PeAu34wOOUcZ5M4BI/jMYTqZqHRSKn8fRmFp+Q=; b=UzZAWeibJw+64t+9Bu1Ud7UMJdrsiRzFneh3YnGD1lA9W4l5zyhwbCGs/L4S5zCU2A vm10wVHx/Hv9POnbyjBKDW/wYgbACegJa3nEFrCxaqlYLUL6RopSx2ynC7oIDsVI44io 5/OY9PvDbwQKQc0+mxUEWz9oNA6YWIUT1J9cP78cxP8nr3fEmPEpg2ozXE3NctMw+Gow uAB9k6MO69hqa1OOXbOjE6i1DdM/VF3xNoS2BOdoP5C6h5J8oy/53u2epmToE35QxCl7 yoXtsyRYIlsu1bdVFsU+a0OVqCr5c2qaaslnVhbWSMbDEfqkbnvW9gF9WA9EGtukzvo9 LFDw== X-Gm-Message-State: AOAM531696dcZZnbBRrxrsEgEB1g3MbWRISOhxwG1eDaaR5emP/TpOn1 l5kO8xrbzsCLq7qcJiV87asQ0wa5+tgCAcHJ X-Google-Smtp-Source: ABdhPJz6HKK/h/k1yqee0HneGTNOMuCc/QnrFT6p+vKJyGWponzQy7Xl18wdF9hms41zfsEiVhmL5Q== X-Received: by 2002:a7b:cf04:: with SMTP id l4mr4297731wmg.33.1603825217071; Tue, 27 Oct 2020 12:00:17 -0700 (PDT) Received: from localhost.localdomain (84-238-136-197.ip.btc-net.bg. [84.238.136.197]) by smtp.gmail.com with ESMTPSA id x6sm3219803wmb.17.2020.10.27.12.00.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 12:00:16 -0700 (PDT) From: Nikolay Aleksandrov To: netdev@vger.kernel.org Cc: roopa@nvidia.com, kuba@kernel.org, bridge@lists.linux-foundation.org, Nikolay Aleksandrov Subject: [PATCH net-next 09/16] selftests: net: bridge: add test for igmpv3 exc -> allow report Date: Tue, 27 Oct 2020 20:59:27 +0200 Message-Id: <20201027185934.227040-10-razor@blackwall.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20201027185934.227040-1-razor@blackwall.org> References: <20201027185934.227040-1-razor@blackwall.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Nikolay Aleksandrov The test checks for the following case: state report result action EXCLUDE (X,Y) ALLOW (A) EXCLUDE (X+A,Y-A) (A)=GMI Signed-off-by: Nikolay Aleksandrov --- .../selftests/net/forwarding/bridge_igmp.sh | 83 +++++++++++++------ 1 file changed, 59 insertions(+), 24 deletions(-) diff --git a/tools/testing/selftests/net/forwarding/bridge_igmp.sh b/tools/testing/selftests/net/forwarding/bridge_igmp.sh index 36f10a3168cc..d786e75abe2c 100755 --- a/tools/testing/selftests/net/forwarding/bridge_igmp.sh +++ b/tools/testing/selftests/net/forwarding/bridge_igmp.sh @@ -2,7 +2,7 @@ # SPDX-License-Identifier: GPL-2.0 ALL_TESTS="v2reportleave_test v3include_test v3inc_allow_test v3inc_is_include_test \ - v3inc_is_exclude_test v3inc_to_exclude_test" + v3inc_is_exclude_test v3inc_to_exclude_test v3exc_allow_test" NUM_NETIFS=4 CHECK_TC="yes" TEST_GROUP="239.10.10.10" @@ -17,6 +17,8 @@ MZPKT_IS_INC="22:00:9d:de:00:00:00:01:01:00:00:03:ef:0a:0a:0a:c0:00:02:01:c0:00: MZPKT_IS_INC2="22:00:9d:c3:00:00:00:01:01:00:00:03:ef:0a:0a:0a:c0:00:02:0a:c0:00:02:0b:c0:00:02:0c" # IGMPv3 allow report: grp 239.10.10.10 allow 192.0.2.10,192.0.2.11,192.0.2.12 MZPKT_ALLOW="22:00:99:c3:00:00:00:01:05:00:00:03:ef:0a:0a:0a:c0:00:02:0a:c0:00:02:0b:c0:00:02:0c" +# IGMPv3 allow report: grp 239.10.10.10 allow 192.0.2.20,192.0.2.30 +MZPKT_ALLOW2="22:00:5b:b4:00:00:00:01:05:00:00:02:ef:0a:0a:0a:c0:00:02:14:c0:00:02:1e" # IGMPv3 is_ex report: grp 239.10.10.10 is_exclude 192.0.2.1,192.0.2.2,192.0.2.20,192.0.2.21 MZPKT_IS_EXC="22:00:da:b6:00:00:00:01:02:00:00:04:ef:0a:0a:0a:c0:00:02:01:c0:00:02:02:c0:00:02:14:c0:00:02:15" # IGMPv3 to_ex report: grp 239.10.10.10 to_exclude 192.0.2.1,192.0.2.20,192.0.2.30 @@ -250,6 +252,38 @@ v3include_prepare() check_sg_entries "is_include" "${X[@]}" } +v3exclude_prepare() +{ + local host1_if=$1 + local mac=$2 + local group=$3 + local pkt=$4 + local X=("192.0.2.1" "192.0.2.2") + local Y=("192.0.2.20" "192.0.2.21") + + v3include_prepare $host1_if $mac $group + + $MZ $host1_if -c 1 -b $mac -B $group -t ip "proto=2,p=$MZPKT_IS_EXC" -q + sleep 1 + bridge -j -d -s mdb show dev br0 \ + | jq -e ".[].mdb[] | \ + select(.grp == \"$TEST_GROUP\" and \ + .source_list != null and .filter_mode == \"exclude\")" &>/dev/null + check_err $? "Wrong *,G entry filter mode" + + check_sg_entries "is_exclude" "${X[@]}" "${Y[@]}" + + check_sg_state 0 "${X[@]}" + check_sg_state 1 "${Y[@]}" + + bridge -j -d -s mdb show dev br0 \ + | jq -e ".[].mdb[] | \ + select(.grp == \"$TEST_GROUP\" and \ + .source_list != null and + .source_list[].address == \"192.0.2.3\")" &>/dev/null + check_fail $? "Wrong *,G entry source list, 192.0.2.3 entry still exists" +} + v3cleanup() { local port=$1 @@ -321,30 +355,8 @@ v3inc_is_include_test() v3inc_is_exclude_test() { RET=0 - local X=("192.0.2.1" "192.0.2.2") - local Y=("192.0.2.20" "192.0.2.21") - - v3include_prepare $h1 $ALL_MAC $ALL_GROUP - - $MZ $h1 -c 1 -b $ALL_MAC -B $ALL_GROUP -t ip "proto=2,p=$MZPKT_IS_EXC" -q - sleep 1 - bridge -j -d -s mdb show dev br0 \ - | jq -e ".[].mdb[] | \ - select(.grp == \"$TEST_GROUP\" and \ - .source_list != null and .filter_mode == \"exclude\")" &>/dev/null - check_err $? "Wrong *,G entry filter mode" - - check_sg_entries "is_exclude" "${X[@]}" "${Y[@]}" - check_sg_state 0 "${X[@]}" - check_sg_state 1 "${Y[@]}" - - bridge -j -d -s mdb show dev br0 \ - | jq -e ".[].mdb[] | \ - select(.grp == \"$TEST_GROUP\" and \ - .source_list != null and - .source_list[].address == \"192.0.2.3\")" &>/dev/null - check_fail $? "Wrong *,G entry source list, 192.0.2.3 entry still exists" + v3exclude_prepare $h1 $ALL_MAC $ALL_GROUP check_sg_fwding 1 "${X[@]}" 192.0.2.100 check_sg_fwding 0 "${Y[@]}" @@ -401,6 +413,29 @@ v3inc_to_exclude_test() v3cleanup $swp1 $TEST_GROUP } +v3exc_allow_test() +{ + RET=0 + local X=("192.0.2.1" "192.0.2.2" "192.0.2.20" "192.0.2.30") + local Y=("192.0.2.21") + + v3exclude_prepare $h1 $ALL_MAC $ALL_GROUP + + $MZ $h1 -c 1 -b $ALL_MAC -B $ALL_GROUP -t ip "proto=2,p=$MZPKT_ALLOW2" -q + sleep 1 + check_sg_entries "allow" "${X[@]}" "${Y[@]}" + + check_sg_state 0 "${X[@]}" + check_sg_state 1 "${Y[@]}" + + check_sg_fwding 1 "${X[@]}" 192.0.2.100 + check_sg_fwding 0 "${Y[@]}" + + log_test "IGMPv3 report $TEST_GROUP exclude -> allow" + + v3cleanup $swp1 $TEST_GROUP +} + trap cleanup EXIT setup_prepare From patchwork Tue Oct 27 18:59:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Aleksandrov X-Patchwork-Id: 298529 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AC83DC388F9 for ; Tue, 27 Oct 2020 19:01:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 56DD821556 for ; Tue, 27 Oct 2020 19:01:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=blackwall-org.20150623.gappssmtp.com header.i=@blackwall-org.20150623.gappssmtp.com header.b="uFAh3qD+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1829243AbgJ0TBh (ORCPT ); Tue, 27 Oct 2020 15:01:37 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:33989 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S371382AbgJ0TAX (ORCPT ); Tue, 27 Oct 2020 15:00:23 -0400 Received: by mail-wr1-f67.google.com with SMTP id i1so3157412wro.1 for ; Tue, 27 Oct 2020 12:00:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=blackwall-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GkauxuTNWiSF9oMdr/Q/tgJ/GE3iMvf1VO5Jw7M5+xs=; b=uFAh3qD+tDMpttSW6AZo2oHmMqnlE/L9/+Hto2jryq9hxQWSn7IW0ju6HGCycstPp0 H0f6qtJqmac7tUfLC4b7nNKIFi/021FZUX0STCsIysgbaN6NIOgUZEHytzNwAAXZmDSV Qr1esn/thg3+Dx1UYG4ul1cmqB/LNJCUvpPHK4bzXBNUeUfWGViXsSr2GcxNob8IZiRW k6BDsH4PovXv/VUBlcOloRE4WEStDzZLFH4YcDG3Z/kEBRD9o5ZY7DeP+RE0BjOZpimq 4MDQNQU6jjdhSNsZ+f9MH8JGza0NaBmOOC5D9JIeP5NWqYwwuUNhWBR1yod++gkD1shl GXQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GkauxuTNWiSF9oMdr/Q/tgJ/GE3iMvf1VO5Jw7M5+xs=; b=FXwdUYuoAUdcC+bGB8d69aaeF0XrSY87UvmMzOdMDH0iiG11Qw2NBpOBX5IQNo9+18 CLq69+Q8SYmJ9wkeYtiB0S7XdjSRZAI60zGbSyYJHjwEnFeKDhC/wZIT2ZlUgb3M2uMy ax5DD1m7abO5wR0mLKMjPq8CZMkdLitVRd94Nw1/aaEYGVo6JCBSSQ/vDEGbLUDyDOJF JITRKi8SzmWNgJQhi5Ys3TFi7e32YJEWko9guW4/6Cg4vxuuVp/Ag+2DvNCEZEkK+Sqm RHJ+ZxMP8DUI5p2CyRr4aAV3eJPq5hc0Tue1eSmDtHLSWB1VUOI+009Vt1o+DtG1L3up WzTg== X-Gm-Message-State: AOAM532xGVGZeR7WQZobuArELl2eZhdYcl13O9DD91b+hi1g8KyS931p +otCBGwOUpLOHL7x61BIEfpiICUaDghnxExc X-Google-Smtp-Source: ABdhPJzeAzyPZ503wQzC31NBDWhLz0G6RpVsHLo4W4PaX1fa3CRC6CqBBsE/4zLiXLtFF2amELEfwg== X-Received: by 2002:adf:bc4a:: with SMTP id a10mr4513962wrh.253.1603825220478; Tue, 27 Oct 2020 12:00:20 -0700 (PDT) Received: from localhost.localdomain (84-238-136-197.ip.btc-net.bg. [84.238.136.197]) by smtp.gmail.com with ESMTPSA id x6sm3219803wmb.17.2020.10.27.12.00.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 12:00:20 -0700 (PDT) From: Nikolay Aleksandrov To: netdev@vger.kernel.org Cc: roopa@nvidia.com, kuba@kernel.org, bridge@lists.linux-foundation.org, Nikolay Aleksandrov Subject: [PATCH net-next 12/16] selftests: net: bridge: add test for igmpv3 exc -> to_exclude report Date: Tue, 27 Oct 2020 20:59:30 +0200 Message-Id: <20201027185934.227040-13-razor@blackwall.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20201027185934.227040-1-razor@blackwall.org> References: <20201027185934.227040-1-razor@blackwall.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Nikolay Aleksandrov The test checks for the following case: state report result action EXCLUDE (X,Y) TO_EX (A) EXCLUDE (A-Y,Y*A) (A-X-Y)=Group Timer Delete (X-A) Delete (Y-A) Send Q(G,A-Y) Group Timer=GMI Signed-off-by: Nikolay Aleksandrov --- .../selftests/net/forwarding/bridge_igmp.sh | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/forwarding/bridge_igmp.sh b/tools/testing/selftests/net/forwarding/bridge_igmp.sh index 91b0b26428f6..3cfc30b88285 100755 --- a/tools/testing/selftests/net/forwarding/bridge_igmp.sh +++ b/tools/testing/selftests/net/forwarding/bridge_igmp.sh @@ -3,7 +3,7 @@ ALL_TESTS="v2reportleave_test v3include_test v3inc_allow_test v3inc_is_include_test \ v3inc_is_exclude_test v3inc_to_exclude_test v3exc_allow_test v3exc_is_include_test \ - v3exc_is_exclude_test" + v3exc_is_exclude_test v3exc_to_exclude_test" NUM_NETIFS=4 CHECK_TC="yes" TEST_GROUP="239.10.10.10" @@ -487,6 +487,34 @@ v3exc_is_exclude_test() v3cleanup $swp1 $TEST_GROUP } +v3exc_to_exclude_test() +{ + RET=0 + local X=("192.0.2.1" "192.0.2.30") + local Y=("192.0.2.20") + + v3exclude_prepare $h1 $ALL_MAC $ALL_GROUP + + ip link set dev br0 type bridge mcast_last_member_interval 500 + check_err $? "Could not change mcast_last_member_interval to 5s" + + $MZ $h1 -c 1 -b $ALL_MAC -B $ALL_GROUP -t ip "proto=2,p=$MZPKT_TO_EXC" -q + sleep 1 + check_sg_entries "to_exclude" "${X[@]}" "${Y[@]}" + + check_sg_state 0 "${X[@]}" + check_sg_state 1 "${Y[@]}" + + check_sg_fwding 1 "${X[@]}" 192.0.2.100 + check_sg_fwding 0 "${Y[@]}" + + log_test "IGMPv3 report $TEST_GROUP exclude -> to_exclude" + + ip link set dev br0 type bridge mcast_last_member_interval 100 + + v3cleanup $swp1 $TEST_GROUP +} + trap cleanup EXIT setup_prepare From patchwork Tue Oct 27 18:59:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Aleksandrov X-Patchwork-Id: 298530 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 016A4C388F9 for ; Tue, 27 Oct 2020 19:01:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AF9CD21D41 for ; Tue, 27 Oct 2020 19:01:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=blackwall-org.20150623.gappssmtp.com header.i=@blackwall-org.20150623.gappssmtp.com header.b="PTJAjWIX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S371443AbgJ0TBb (ORCPT ); Tue, 27 Oct 2020 15:01:31 -0400 Received: from mail-wm1-f49.google.com ([209.85.128.49]:52914 "EHLO mail-wm1-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S371395AbgJ0TAY (ORCPT ); Tue, 27 Oct 2020 15:00:24 -0400 Received: by mail-wm1-f49.google.com with SMTP id c194so2387463wme.2 for ; Tue, 27 Oct 2020 12:00:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=blackwall-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hkVjZ+YIjaJPktJubl8CMRKBr4zOyIIs4Cgi4AHtLdg=; b=PTJAjWIXqOo10ByygiLJ17DkXHRBd0InDc1XoZkYKuJDCetemkNTNVfz90gu14BKh7 0BrMoX5uDOM0VJX9WcgZ4lqupcvM6DzRH9vBAbuq+/OfpLCjfR9dpU4gkopT3DAZuME9 M7qalhxnqYzcc7QCLJxbxNqFxk2HzsZcTviDPVGh2Tf3Ut4p6hHK8xrIPbjiTx2ANOKf Ooa/o+G7i9+OwYkAkt5+4gnJnAxAuGqioCvIJ8483O0aLVk5aN5JgDb0CIVPPstjHnXo 9KA90zhtNs/+EP5N8JDxEOcu7xn0Ste9Ck3JDQRrIJh7brvgRhMCyyJ1m5m+WXJbtMBq 0d8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hkVjZ+YIjaJPktJubl8CMRKBr4zOyIIs4Cgi4AHtLdg=; b=dCx1x+p7nvxE6ImwVRQ+NkSW+zCy3NBWl3NUB3ldmirsrqGkRw5fexpA2CRNqt8tL0 /M0OUtMQlxWUdI8yK7cxy8JnD2akyTG4//XuH6LQLDvy0fX8RPpQ7XC2lyamFNMUCXcM xr6RdresKaOcwcfIIsDk2qddl238/lVZwF43eKNmlcCS3jn6hbTvg8vlLdXD5jmf+BgP TvOLgzLrsUojDleXVkrW4LM+kzjNThHXUkP1M2YhrGx2GR2yS9aThRmw7R7NNaColdhs WvdPKp92qqcYVmW36KXntGoSOvEcs4r25AOjAZAKMY+lAvzzJ+P7QEddQBNW3SmKUxxE lshw== X-Gm-Message-State: AOAM532j8ux7Eafx8uqQi9UbPwfx3nrYxNxO1KX1amy4t+1rLitvtO8N OkOFHj1UIFkxOeOtJEjwgPOgVeCPiBoXmZ/a X-Google-Smtp-Source: ABdhPJzykSANs+MMEVckVqeXmwguDl6k4AlfnQ9uUtkIG4KhetLOK2QqJDR7NQLT6HotSLqdyArmsw== X-Received: by 2002:a1c:9641:: with SMTP id y62mr4356126wmd.145.1603825221626; Tue, 27 Oct 2020 12:00:21 -0700 (PDT) Received: from localhost.localdomain (84-238-136-197.ip.btc-net.bg. [84.238.136.197]) by smtp.gmail.com with ESMTPSA id x6sm3219803wmb.17.2020.10.27.12.00.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 12:00:21 -0700 (PDT) From: Nikolay Aleksandrov To: netdev@vger.kernel.org Cc: roopa@nvidia.com, kuba@kernel.org, bridge@lists.linux-foundation.org, Nikolay Aleksandrov Subject: [PATCH net-next 13/16] selftests: net: bridge: add test for igmpv3 inc -> block report Date: Tue, 27 Oct 2020 20:59:31 +0200 Message-Id: <20201027185934.227040-14-razor@blackwall.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20201027185934.227040-1-razor@blackwall.org> References: <20201027185934.227040-1-razor@blackwall.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Nikolay Aleksandrov The test checks for the following case: state report result action INCLUDE (A) BLOCK (B) INCLUDE (A) Send Q(G,A*B) Signed-off-by: Nikolay Aleksandrov --- .../selftests/net/forwarding/bridge_igmp.sh | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/forwarding/bridge_igmp.sh b/tools/testing/selftests/net/forwarding/bridge_igmp.sh index 3cfc30b88285..3772c7a066c9 100755 --- a/tools/testing/selftests/net/forwarding/bridge_igmp.sh +++ b/tools/testing/selftests/net/forwarding/bridge_igmp.sh @@ -3,7 +3,7 @@ ALL_TESTS="v2reportleave_test v3include_test v3inc_allow_test v3inc_is_include_test \ v3inc_is_exclude_test v3inc_to_exclude_test v3exc_allow_test v3exc_is_include_test \ - v3exc_is_exclude_test v3exc_to_exclude_test" + v3exc_is_exclude_test v3exc_to_exclude_test v3inc_block_test" NUM_NETIFS=4 CHECK_TC="yes" TEST_GROUP="239.10.10.10" @@ -28,6 +28,8 @@ MZPKT_IS_EXC="22:00:da:b6:00:00:00:01:02:00:00:04:ef:0a:0a:0a:c0:00:02:01:c0:00: MZPKT_IS_EXC2="22:00:5e:b4:00:00:00:01:02:00:00:02:ef:0a:0a:0a:c0:00:02:14:c0:00:02:1e" # IGMPv3 to_ex report: grp 239.10.10.10 to_exclude 192.0.2.1,192.0.2.20,192.0.2.30 MZPKT_TO_EXC="22:00:9a:b1:00:00:00:01:04:00:00:03:ef:0a:0a:0a:c0:00:02:01:c0:00:02:14:c0:00:02:1e" +# IGMPv3 block report: grp 239.10.10.10 block 192.0.2.1,192.0.2.20,192.0.2.30 +MZPKT_BLOCK="22:00:98:b1:00:00:00:01:06:00:00:03:ef:0a:0a:0a:c0:00:02:01:c0:00:02:14:c0:00:02:1e" source lib.sh @@ -515,6 +517,35 @@ v3exc_to_exclude_test() v3cleanup $swp1 $TEST_GROUP } +v3inc_block_test() +{ + RET=0 + local X=("192.0.2.2" "192.0.2.3") + + v3include_prepare $h1 $ALL_MAC $ALL_GROUP + + $MZ $h1 -c 1 -b $ALL_MAC -B $ALL_GROUP -t ip "proto=2,p=$MZPKT_BLOCK" -q + # make sure the lowered timers have expired (by default 2 seconds) + sleep 3 + check_sg_entries "block" "${X[@]}" + + check_sg_state 0 "${X[@]}" + + bridge -j -d -s mdb show dev br0 \ + | jq -e ".[].mdb[] | \ + select(.grp == \"$TEST_GROUP\" and \ + .source_list != null and + .source_list[].address == \"192.0.2.1\")" &>/dev/null + check_fail $? "Wrong *,G entry source list, 192.0.2.1 entry still exists" + + check_sg_fwding 1 "${X[@]}" + check_sg_fwding 0 "192.0.2.100" + + log_test "IGMPv3 report $TEST_GROUP include -> block" + + v3cleanup $swp1 $TEST_GROUP +} + trap cleanup EXIT setup_prepare From patchwork Tue Oct 27 18:59:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Aleksandrov X-Patchwork-Id: 298528 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F722C4363A for ; Tue, 27 Oct 2020 19:01:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ED2B821527 for ; Tue, 27 Oct 2020 19:01:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=blackwall-org.20150623.gappssmtp.com header.i=@blackwall-org.20150623.gappssmtp.com header.b="OpuUHStq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1829227AbgJ0TBe (ORCPT ); Tue, 27 Oct 2020 15:01:34 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:36871 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S371399AbgJ0TA2 (ORCPT ); Tue, 27 Oct 2020 15:00:28 -0400 Received: by mail-wm1-f67.google.com with SMTP id c16so2552288wmd.2 for ; Tue, 27 Oct 2020 12:00:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=blackwall-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HWwH1mzK26OWStIyr7YQx947cp92x7ujWn8BN7kPbwM=; b=OpuUHStqMculoVADiWHShDs8jkbf6mK4yTc4KiX2t5Tru35iyhx3OjPGf4omufYeJq 48Vha9bTSNQ45A6ZbF97QFusOaeyQ5pzXRWZ0Xnbulxx8HIoCbsX9e6GC98u7nLDLkyy NtvzKZEc9WEvGEPNL3D3/TOah2z7SRiLsW91bmPgqDzy9zgi3oJS7GOqPZZH1da+rwo1 SJtGDzjkc/ZB9nABYEHVPuzazu7Xz+qwytjWc3VetNZjerP0G/QiiUDKHWNEomjhWJzZ etO5OfBG4tyTCvLJy5cm6N/nNGlzoKyqshPzi52Nxo4nEr9ma8U0UGgAnm493MKwl3gC Bb7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HWwH1mzK26OWStIyr7YQx947cp92x7ujWn8BN7kPbwM=; b=S+uz+xBei/1un7ZOhKdHFgt1O2OLCW9+ti4oPSNHA4dziywoz3WoONo6QPaBOmgkc9 ccv130vbt8A3y9Mcw0aWMkpLTBK+QJstbTs8KH8uYsFVIGHjCA3+puYPKHo4DvTEurSN d6AC/x6hbnq/+q+VIjaeP+ry+LCFbQEXPmDK6zmqUAEIW2Gia8XNsWoffGQeynOzR1Ti LLH8Uqo0BMJcRBXTVp39UDYnu2LV9tPhmAmtEjfwQun5dukiKEWKk6PPwDfba9aUHJnH WJ6I44DrCACqx5vNr8qXW0RM/gELH9pjeu1KbedW5CA1t92APng+OL7G3aJgLkzbgh3E krBQ== X-Gm-Message-State: AOAM5320kNIPP/tNBoIyj407lCJoN606rM/DbMnKGYQ68BUnep+YZrJM swYxey5ScGPk0j5cLfcCUd5xgH0Jl+GjT80E X-Google-Smtp-Source: ABdhPJxxo103u+lxleVTEnlhpF+mLQdkEkTDFatbmlZ4/KjzqV69h9H52pHB2LImZcZmsTNPIa/tmw== X-Received: by 2002:a7b:cc09:: with SMTP id f9mr4166353wmh.93.1603825225122; Tue, 27 Oct 2020 12:00:25 -0700 (PDT) Received: from localhost.localdomain (84-238-136-197.ip.btc-net.bg. [84.238.136.197]) by smtp.gmail.com with ESMTPSA id x6sm3219803wmb.17.2020.10.27.12.00.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 12:00:24 -0700 (PDT) From: Nikolay Aleksandrov To: netdev@vger.kernel.org Cc: roopa@nvidia.com, kuba@kernel.org, bridge@lists.linux-foundation.org, Nikolay Aleksandrov Subject: [PATCH net-next 16/16] selftests: net: bridge: add test for igmpv3 *, g auto-add Date: Tue, 27 Oct 2020 20:59:34 +0200 Message-Id: <20201027185934.227040-17-razor@blackwall.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20201027185934.227040-1-razor@blackwall.org> References: <20201027185934.227040-1-razor@blackwall.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Nikolay Aleksandrov When we have *,G ports in exclude mode and a new S,G,port is added the kernel has to automatically create an S,G entry for each exclude port to get proper forwarding. Signed-off-by: Nikolay Aleksandrov --- .../selftests/net/forwarding/bridge_igmp.sh | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/forwarding/bridge_igmp.sh b/tools/testing/selftests/net/forwarding/bridge_igmp.sh index db0a03e30868..0e71abdd7a03 100755 --- a/tools/testing/selftests/net/forwarding/bridge_igmp.sh +++ b/tools/testing/selftests/net/forwarding/bridge_igmp.sh @@ -4,7 +4,7 @@ ALL_TESTS="v2reportleave_test v3include_test v3inc_allow_test v3inc_is_include_test \ v3inc_is_exclude_test v3inc_to_exclude_test v3exc_allow_test v3exc_is_include_test \ v3exc_is_exclude_test v3exc_to_exclude_test v3inc_block_test v3exc_block_test \ - v3exc_timeout_test" + v3exc_timeout_test v3star_ex_auto_add_test" NUM_NETIFS=4 CHECK_TC="yes" TEST_GROUP="239.10.10.10" @@ -621,6 +621,35 @@ v3exc_timeout_test() v3cleanup $swp1 $TEST_GROUP } +v3star_ex_auto_add_test() +{ + RET=0 + + v3exclude_prepare $h1 $ALL_MAC $ALL_GROUP + + $MZ $h2 -c 1 -b $ALL_MAC -B $ALL_GROUP -t ip "proto=2,p=$MZPKT_IS_INC" -q + sleep 1 + bridge -j -d -s mdb show dev br0 \ + | jq -e ".[].mdb[] | \ + select(.grp == \"$TEST_GROUP\" and .src == \"192.0.2.3\" and \ + .port == \"$swp1\")" &>/dev/null + check_err $? "S,G entry for *,G port doesn't exist" + + bridge -j -d -s mdb show dev br0 \ + | jq -e ".[].mdb[] | \ + select(.grp == \"$TEST_GROUP\" and .src == \"192.0.2.3\" and \ + .port == \"$swp1\" and \ + .flags[] == \"added_by_star_ex\")" &>/dev/null + check_err $? "Auto-added S,G entry doesn't have added_by_star_ex flag" + + check_sg_fwding 1 192.0.2.3 + + log_test "IGMPv3 S,G port entry automatic add to a *,G port" + + v3cleanup $swp1 $TEST_GROUP + v3cleanup $swp2 $TEST_GROUP +} + trap cleanup EXIT setup_prepare