Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp947694imn; Sat, 30 Jul 2022 09:05:40 -0700 (PDT) X-Google-Smtp-Source: AGRyM1seEADAIGu3WEmy8PxRno0/hMC2ODABq8HRW9lkyt6mClk+MuO7IdWkaYD8eLwIWnp+IToO X-Received: by 2002:a17:907:75d9:b0:72b:1472:ba19 with SMTP id jl25-20020a17090775d900b0072b1472ba19mr6305521ejc.657.1659197139737; Sat, 30 Jul 2022 09:05:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659197139; cv=none; d=google.com; s=arc-20160816; b=ckchMPCGU3dKeY8KJ5ZUdxTmqRxgEC9ywJbh9rWuNb7Wp7uO8caJfjIP0pdpo6FtPY RPwbUAcpyTEQdsWY7rwBJ4Ib+qbB38Av1IfC+j77OyK9BnGqHv7g5gjZ5X//QPNG3zyP +cQmQMT8tQYZVMdyelONvtpbeOc/IbEkuKMDcXOuxb30n+Dqr+OrK4w1ErlStiiHwH6F wJ+hp3mb8P87O8GxSVsZJuqXowIOcGyUBxXQHoNbhbd2cShEgTkz/IrdUa4BeH0Ai3oJ LDkPJLt7jM8QWIhzmPkHoYtAbUgWaAT9HJOm58ZiVjtWeXGY37zvs78oOOZ6ymArRTFf 0QUg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=zgmGl0zOLMrX607mh9XkqEoaOPwjCXk2yDE13rCP8S4=; b=s6ec6qUUxPipE9cjvc4sntN4VOVvl8HTtbJbqO+7dezZPGmhpG9aivQQvFdWqIZcAM KCwHmZgzn5QSdsHWQBZUnDCYsroVcEis6fSqgrvkfXzVrCSpvUluv/lrNcYHAQlo05+q hEKvPMwlLFw28Bd9SgFxiB0FeZ1qb96qIvT/zfdcxE8nc5rxN5Cv4xNIfZ195c/dfJ12 NQBPyNmNSLK+zL4+2OljfsBH8HKMofunU7u0i3sCsjmEpYkhXdGrq+edTqiMZJuOlaz8 kIP9Y3AjXABfPxZzlFVK2U7U6AF4WvKckrj6GaIYTE5wtfDAEgoXsY9Hl6m6ppCdjyE/ ldIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=brWrA3BH; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jl24-20020a17090775d800b0072697f3b60csi5194266ejc.505.2022.07.30.09.05.13; Sat, 30 Jul 2022 09:05:39 -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=@gmail.com header.s=20210112 header.b=brWrA3BH; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234860AbiG3QDu (ORCPT + 99 others); Sat, 30 Jul 2022 12:03:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229742AbiG3QDs (ORCPT ); Sat, 30 Jul 2022 12:03:48 -0400 Received: from mail-qv1-xf29.google.com (mail-qv1-xf29.google.com [IPv6:2607:f8b0:4864:20::f29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15D8AC32; Sat, 30 Jul 2022 09:03:44 -0700 (PDT) Received: by mail-qv1-xf29.google.com with SMTP id v2so5581335qvs.12; Sat, 30 Jul 2022 09:03:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zgmGl0zOLMrX607mh9XkqEoaOPwjCXk2yDE13rCP8S4=; b=brWrA3BHLdXgaMLYNPn15nUSgJ+ICxG8mg77/mh6pbRg07FjjG6pva4xRLwxB0eghG Dfq+F+V+x1NOiHFkSbvx4tMx1QCHMIqqEBpB/oHd3QWHQqP92Z2xKTlHXFeP6Dx3NAZe sgtPmxYbpV0bnJUMme0La5BDx5Cp7c0CaFwYJczWmdWyvrpFLdPNJzk0Yv4J8rFViFe4 ha3HU+A9U8BGTgtkjkQaBg7QnHTC3qfTulG7b6UZPbBImBZDyYVk72mOQ+V89AT2p5jo KppSykFsfouzX7UG9IQw2bdyE/Zmw5sx5Xah/jVB5rKs+S/K+2cvEFj2Dk/rj+VK9YS0 4rog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zgmGl0zOLMrX607mh9XkqEoaOPwjCXk2yDE13rCP8S4=; b=0/9/N1hS95GLmR3fB4Jm5sosyv1b8vijso0Poj3TCQ2uMJFpRxZg4pzk9Ui8t3P9AV 1dc0vbWu1A1wGfMcyZi87I9/isoj2svjfth1LlFLI8WoJFoInne2+kXAhHm79NhOlpn2 kl+hcKxTg67sxjNySsWZO8D8xadOy+qhaCaIc2V3/9Bxuwqe76DQo+LtL/KdSqCiy/op l7SCPUezXzYH4oBSNkTXtqVCHYzRCS8ohFUrY9vbs6evoME8NrpcUOZWALSUSmCjEl5n m+61qiQO7mOHYoih1hsmEdZjKeLbY8Gw7TBzUPxrdxporiH4m09DUqZ23XV0IalFxQ5F ULUQ== X-Gm-Message-State: ACgBeo1M58s+o/RF5OJCd3WpVHlRkUqINijDPxAAtXYgu5bA2F5sIhYs oXRGTCb7Gd9kFjkqn5jrHnhn5IW9K0Dr5g== X-Received: by 2002:a05:6214:29c7:b0:473:7b25:f950 with SMTP id gh7-20020a05621429c700b004737b25f950mr7668120qvb.95.1659197023561; Sat, 30 Jul 2022 09:03:43 -0700 (PDT) Received: from ada ([71.58.109.160]) by smtp.gmail.com with ESMTPSA id 206-20020a3703d7000000b006b5840f3eefsm4447103qkd.130.2022.07.30.09.03.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Jul 2022 09:03:42 -0700 (PDT) From: Sevinj Aghayeva To: aroulin@nvidia.com Cc: sbrivio@redhat.com, roopa@nvidia.com, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Nikolay Aleksandrov , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bridge@lists.linux-foundation.org, Sevinj Aghayeva Subject: [PATCH net-next 0/3] net: vlan: fix bridge binding behavior and add selftests Date: Sat, 30 Jul 2022 12:03:29 -0400 Message-Id: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 When bridge binding is enabled for a vlan interface, it is expected that the link state of the vlan interface will track the subset of the ports that are also members of the corresponding vlan, rather than that of all ports. Currently, this feature works as expected when a vlan interface is created with bridge binding enabled: ip link add link br name vlan10 type vlan id 10 protocol 802.1q \ bridge_binding on However, the feature does not work when a vlan interface is created with bridge binding disabled, and then enabled later: ip link add link br name vlan10 type vlan id 10 protocol 802.1q \ bridge_binding off ip link set vlan10 type vlan bridge_binding on After these two commands, the link state of the vlan interface continues to track that of all ports, which is inconsistent and confusing to users. This series fixes this bug and introduces two tests for the valid behavior. Sevinj Aghayeva (3): net: bridge: export br_vlan_upper_change net: 8021q: fix bridge binding behavior for vlan interfaces selftests: net: tests for bridge binding behavior include/linux/if_bridge.h | 9 ++ net/8021q/vlan.h | 2 +- net/8021q/vlan_dev.c | 21 ++- net/bridge/br_vlan.c | 7 +- tools/testing/selftests/net/Makefile | 1 + .../selftests/net/bridge_vlan_binding_test.sh | 143 ++++++++++++++++++ 6 files changed, 176 insertions(+), 7 deletions(-) create mode 100755 tools/testing/selftests/net/bridge_vlan_binding_test.sh -- 2.25.1