Received: by 2002:a05:6359:322:b0:b3:69d0:12d8 with SMTP id ef34csp282120rwb; Wed, 10 Aug 2022 08:11:31 -0700 (PDT) X-Google-Smtp-Source: AA6agR6RLrKK2bHOBF8HWPEt9tuvvwiJP+Hf0UbxFrfV+55R9z2AViJ6O9JFnoZtbjLmslV6/BmU X-Received: by 2002:a63:b95e:0:b0:41d:6498:2ad5 with SMTP id v30-20020a63b95e000000b0041d64982ad5mr13314120pgo.446.1660144290629; Wed, 10 Aug 2022 08:11:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660144290; cv=none; d=google.com; s=arc-20160816; b=xFv55DH6VNEdVeKB+ZCxlvIO9v8q6Qmn6QMFw46v/G5y8OrVciUvrH5OejoWtSE4rb p+MS37uaZE2SCjfZImutp5SC7daux3dhzv0tSvR4sWcegEsQTxOmm8zo4cGm1fuqu9Bh jayrIJCYXBxQhbhEBtirDfIaShqMTydtMFc/+tCWCvJZkOfWq1S1ttIvW2oxeHs1eYg9 +3H8ceZwDJFCJsX2jDZL8onFMR5Joze6HwUy4hPkH478OqlMTlohEDhhO9otQ8lpBr+n jBy80nm8LWRTWIn7FXsbNMv/lJmSnPrQ4WLBdMWtunzVMHlnOW94nHuXRE2GFud69sFY v5SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=r4FpLYfUs7tX4DLeiy0sj/1t8j21OoA6g793iTCGiF8=; b=HSbajF4x8WzerwUDcHz3grlanYCSEVeEfJRcR7R6zQ/EHNXiO90lPqvCT6x7Yyeesw QXRQfVop46Jt8EjwyOI/io3O6+LEU9Lhb6ON6k9QzXMj/S6qy383hgiuDhDhjclzWqhE cdOGvyxZ+oOoPILcqrDwq+Vyi60hJv7j4vNwz6MsJDwcOOsfsE/+bX1KYF8Y9TfKGOmF Z5f50GvA2XMg4qd32Vof3/Ch43ay8d8eYoo69z1vNOqOPIaHOmMS80969qyMWcNSXfvo sRBti4ElglpHhJLqQH8jzVzJ8JjE5xbeMCnNd8iJwJ2lIIG3KxMbAAnUvcNejNZJ/rK3 eYcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@blackwall-org.20210112.gappssmtp.com header.s=20210112 header.b=MuyQbiTU; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m13-20020a170902db0d00b0016a17da4ad3si20276488plx.339.2022.08.10.08.11.13; Wed, 10 Aug 2022 08:11:30 -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=@blackwall-org.20210112.gappssmtp.com header.s=20210112 header.b=MuyQbiTU; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231675AbiHJOuo (ORCPT + 99 others); Wed, 10 Aug 2022 10:50:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230176AbiHJOum (ORCPT ); Wed, 10 Aug 2022 10:50:42 -0400 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DC6A5FAC8 for ; Wed, 10 Aug 2022 07:50:38 -0700 (PDT) Received: by mail-ed1-x52b.google.com with SMTP id x21so19416012edd.3 for ; Wed, 10 Aug 2022 07:50:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=blackwall-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc; bh=r4FpLYfUs7tX4DLeiy0sj/1t8j21OoA6g793iTCGiF8=; b=MuyQbiTUTET9fzrBqJrVL6Ql0nSXUtWfMkTeV0mBDzSdpEipm6LSkDAk2TRRbHhcFY wVXtGIvSLp1zX+ayyhX9X9Vs+G2gYlKwvu7a0380tbAKcuP1OMT0qzWuHj78nZ6s+5MV t7/FErcC+guIKzh+XsumAfNKFOBs5o98HzCcm86P6Pb7sPlqjHuwEAFyORUJ/mWGU2Q4 tMlLXdYAJp+1RoMLB7y3vb09dzb4EQ8j1WhNkiMxxY35xsjpbBAxJEJn1GI8y/2KAxrJ 1lmT/LXOZ1+yOgsNG4F02V5uDcBUPxy4GJFG4mXV4sXABfGskmeZY1ccjVG3XET/SiJP TJLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc; bh=r4FpLYfUs7tX4DLeiy0sj/1t8j21OoA6g793iTCGiF8=; b=4EWEXdXvWlS/hlpHZPRqKNHI01ulpIUFe4TlsuGVM+cwBC55payk9A45X6PX3qkii8 XieJgM8McAC8qNXh059V3afj+35wK0CiyOK3fVKMWCsuaK33tuJjQVw+4DWer+UTh5WX TjwJsbtArRYwRTdzelXyX2kgQ1latzZYr3zEbbLbqY47+D5bvNnVwWqRVCfxlnRRIX6Z h28lKnwrmn/WZF/fnZevur1w8NMo5xpp6nlIg4U06HFvr0bmS1Zhbt+hxoMufEpQ2rx8 SBn0Nig4mNvovqSsj7FauGD3IS9eaxq9UdltvjR282cR91lojjFmvc3UiHw9g5Im6GCZ q91g== X-Gm-Message-State: ACgBeo37ngJ/G6S/DvQg/uKvLb0+o5qhZSpDbqgKYuVdlI8FqeBpxYU+ 4wf6XISWW9rLHpDPmzJ464FVFA== X-Received: by 2002:a05:6402:43c4:b0:43b:c5eb:c9dd with SMTP id p4-20020a05640243c400b0043bc5ebc9ddmr26620352edc.402.1660143036615; Wed, 10 Aug 2022 07:50:36 -0700 (PDT) Received: from [192.168.0.111] (87-243-81-1.ip.btc-net.bg. [87.243.81.1]) by smtp.gmail.com with ESMTPSA id x7-20020a170906440700b00730cc173c6asm2369268ejo.43.2022.08.10.07.50.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Aug 2022 07:50:36 -0700 (PDT) Message-ID: <49f933c3-7430-a133-9add-ed76c395023b@blackwall.org> Date: Wed, 10 Aug 2022 17:50:34 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH RFC net-next 0/3] net: vlan: fix bridge binding behavior and add selftests Content-Language: en-US To: Sevinj Aghayeva Cc: netdev@vger.kernel.org, aroulin@nvidia.com, sbrivio@redhat.com, roopa@nvidia.com, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org, bridge@lists.linux-foundation.org References: <94ec6182-0804-7a0e-dcba-42655ff19884@blackwall.org> From: Nikolay Aleksandrov In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 On 10/08/2022 17:42, Sevinj Aghayeva wrote: > > > On Wed, Aug 10, 2022 at 4:54 AM Nikolay Aleksandrov > wrote: > > On 10/08/2022 06:11, Sevinj Aghayeva wrote: > > 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: core: export call_netdevice_notifiers_info > >   net: 8021q: fix bridge binding behavior for vlan interfaces > >   selftests: net: tests for bridge binding behavior > > > >  include/linux/netdevice.h                     |   2 + > >  net/8021q/vlan.h                              |   2 +- > >  net/8021q/vlan_dev.c                          |  25 ++- > >  net/core/dev.c                                |   7 +- > >  tools/testing/selftests/net/Makefile          |   1 + > >  .../selftests/net/bridge_vlan_binding_test.sh | 143 ++++++++++++++++++ > >  6 files changed, 172 insertions(+), 8 deletions(-) > >  create mode 100755 tools/testing/selftests/net/bridge_vlan_binding_test.sh > > > > Hi, > NETDEV_CHANGE event is already propagated when the vlan changes flags, > > > I'm not sure if NETDEV_CHANGE is actually propagated when the vlan changes flags. The two functions in the bridge module that handle NETDEV_CHANGE are br_vlan_port_event  and br_vlan_bridge_event. I've installed probes for both, and when I'm changing flags using "sudo ip link set vlan10 type vlan bridge_binding on", I don't see any of those functions getting called, although I do see vlan_dev_change_flags getting called. I think there may be a bug in core/dev.c:__dev_notify_flags. are both vlan and bridge interfaces up? what exactly are you probing for? I can see the NETDEV_CHANGE event go through when changing the loose binding.