Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp551924imm; Fri, 10 Aug 2018 16:59:25 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxKN2V3e8r7XHnDPOt6t79Ow5IKumS+ynL7UkLWB66dDZ4SGYnJXyhHk3gQe2Gl63t8jlgT X-Received: by 2002:a62:6104:: with SMTP id v4-v6mr9103916pfb.122.1533945565528; Fri, 10 Aug 2018 16:59:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533945565; cv=none; d=google.com; s=arc-20160816; b=SzJ7FfmoXqUtZ00fXz03Hfu8Yrn4W6kOjeUo22+9F1z38dSZQvqv7Zuf3fqncjK+Hu PV1aAxOcebcMSuwfFJXQPzUSmOeGdCLLALblYxVo99w/xCaPFq2SC88tVPqw9Y+NJH6i eQhwZtCoB3CE8TRIvT8U5dWLI2k05mBvMvryq8Yg3JwnH1ShYWe6o3n7/wCDuDU/YpJ9 JT0aWh9ozrAOv3s999L527ssH1sIgxOni5N2vLNjRhsn8drCMhIFKKXcWXqSVeGhDN06 6rXkqpW9h6fqRdQk/rqiKfwHOwIh8PibySrO7IibXb/oYkvWAeAFZBJCCbipxws6Q5kq Bg9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject :dkim-signature:arc-authentication-results; bh=/rPtkvK6VGyzH7m8qJNwZAJ1M7VqUh7QIpcBaVKllpg=; b=bb/UpzzIMIbtYkxGXU5J7PmzGwvTsEddMTYf/2vCfITzd9aRhapfz9DkV+J+8iu29h DOXqXY4T2HU+S3l0ieknGOlzev5cwVQgSD1sSI0FBcnRjdlepr2J38G96xlQlZJiS2TV xXQDHXg50zgoGg8hz5UiJDln0+cLB3dqW3vzqZkL8ZNR5f+eaoR02Aac6TfWg9ITkrU7 3rQ5kJXWAAjli+xCDMSbuFA9HFwotVB8Sv+7+aVNDAV6AT1imBSh+aRtIwlB58SVoQYc FaXisG7xIc8X32ca61BLDitulgbChWgCnCirOEtvCPh7iSlTBhEoE4kstUXd8E2+yua8 sL1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uV8WVZc1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 12-v6si10540988plb.203.2018.08.10.16.59.10; Fri, 10 Aug 2018 16:59:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uV8WVZc1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727249AbeHKCaZ (ORCPT + 99 others); Fri, 10 Aug 2018 22:30:25 -0400 Received: from mail-qt0-f195.google.com ([209.85.216.195]:47092 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726747AbeHKCaZ (ORCPT ); Fri, 10 Aug 2018 22:30:25 -0400 Received: by mail-qt0-f195.google.com with SMTP id d4-v6so12055449qtn.13; Fri, 10 Aug 2018 16:58:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=/rPtkvK6VGyzH7m8qJNwZAJ1M7VqUh7QIpcBaVKllpg=; b=uV8WVZc1ORIo+iqnVx2NedVCtzX6WXboMtllCPY4nEmY0R/IU3VUeOj021o/vnMla9 I6vjzJxb2oD+I19zPCWzJzPgtpiUchYwSjpePwYBEcsz+PuUg3L+n0TnbP8n22qOvg2c ZhYKOw8hJDOD5z4kNyIcdEGqgWOXJ6xMt1eAjU5NllRGPIzud4Zxg30OoY2nLe86mg6L 0OH4lC+r7AY0beNgA0AoVvbS2DhdtHbNy3JcyI36pLu2bvvuzAs5RpYlHXN+RjjDvWus 2P/hz5wALD98aUbt18+r+uDbyQRgoXvIuC7wySuDFi6p9GtieK/3o1ShnxIZc3Wf4Sdt oG7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=/rPtkvK6VGyzH7m8qJNwZAJ1M7VqUh7QIpcBaVKllpg=; b=Cr4twBzPYiSjTxQ6U1AfvD+oi7HA+gDVLZJu6JB32UXHRAnLXq8G4xr/Y6fifIAqZh k3Yy2jNrmVN78BW+jp+gXLBmUy5ODGlQjipIbhyrzek1u4l3t1cQTyZP0uxQmAiz7+k+ lR5BErIgnRIZK66QYcCg5MaiTB+FptRjGIXZjdcK8Ojb+2KcMGe2t7LMqSNDnGb4e2Fg sy3Dhp4IE3yCOFF65McIrg0WDZw1JrwLNLC5lvnefQb8p4XXSBy7Pus95Hg0d23IHMJ9 DwD6zGOj8E9pEp1E8sZFysYZJLP+ZMMRGUrMbW9HsYs+hHGPMEdhlTxv55aMn8K9fQvi Ycgg== X-Gm-Message-State: AOUpUlE7MPnjM0/Qgbo6uW66kF+x4et12QK6Zb5iZ2JEvss1ym6GJClx N+dqjvWpwTpLPsJRYFunNzxni2jT X-Received: by 2002:a0c:a482:: with SMTP id x2-v6mr7490540qvx.76.1533945499269; Fri, 10 Aug 2018 16:58:19 -0700 (PDT) Received: from [10.69.41.93] ([192.19.223.250]) by smtp.googlemail.com with ESMTPSA id e20-v6sm8250421qkh.32.2018.08.10.16.58.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 16:58:18 -0700 (PDT) Subject: Re: [PATCH RFT] net: dsa: Allow configuring CPU port VLANs To: Ilias Apalodimas , Petr Machata Cc: netdev@vger.kernel.org, jiri@mellanox.com, Andrew Lunn , Vivien Didelot , "David S. Miller" , open list References: <20180624153339.13572-1-f.fainelli@gmail.com> <20180625091713.GA13442@apalos> From: Florian Fainelli Openpgp: preference=signencrypt Autocrypt: addr=f.fainelli@gmail.com; prefer-encrypt=mutual; keydata= xsDiBEjPuBIRBACW9MxSJU9fvEOCTnRNqG/13rAGsj+vJqontvoDSNxRgmafP8d3nesnqPyR xGlkaOSDuu09rxuW+69Y2f1TzjFuGpBk4ysWOR85O2Nx8AJ6fYGCoeTbovrNlGT1M9obSFGQ X3IzRnWoqlfudjTO5TKoqkbOgpYqIo5n1QbEjCCwCwCg3DOH/4ug2AUUlcIT9/l3pGvoRJ0E AICDzi3l7pmC5IWn2n1mvP5247urtHFs/uusE827DDj3K8Upn2vYiOFMBhGsxAk6YKV6IP0d ZdWX6fqkJJlu9cSDvWtO1hXeHIfQIE/xcqvlRH783KrihLcsmnBqOiS6rJDO2x1eAgC8meAX SAgsrBhcgGl2Rl5gh/jkeA5ykwbxA/9u1eEuL70Qzt5APJmqVXR+kWvrqdBVPoUNy/tQ8mYc nzJJ63ng3tHhnwHXZOu8hL4nqwlYHRa9eeglXYhBqja4ZvIvCEqSmEukfivk+DlIgVoOAJbh qIWgvr3SIEuR6ayY3f5j0f2ejUMYlYYnKdiHXFlF9uXm1ELrb0YX4GMHz80nRmxvcmlhbiBG YWluZWxsaSA8Zi5mYWluZWxsaUBnbWFpbC5jb20+wmYEExECACYCGyMGCwkIB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06y/E449rWZFSTwGqb0FS0seTcYNvxt8PB2izX+ HZA8SL54j479ubxhfuoTu5nXdtFYFj5Lj5x34LKPx7MpgAmj0H7SDhpFWF2FzcC1bjiW9mjW HaKaX23Awt97AqQZXegbfkJwX2Y53ufq8Np3e1542lh3/mpiGSilCsaTahEGrHK+lIusl6mz Joil+u3k01ofvJMK0ZdzGUZ/aPMZ16LofjFA+MNxWrZFrkYmiGdv+LG45zSlZyIvzSiG2lKy kuVag+IijCIom78P9jRtB1q1Q5lwZp2TLAJlz92DmFwBg1hyFzwDADjZ2nrDxKUiybXIgZp9 aU2d++ptEGCVJOfEW4qpWCCLPbOT7XBr+g/4H3qWbs3j/cDDq7LuVYIe+wchy/iXEJaQVeTC y5arMQorqTFWlEOgRA8OP47L9knl9i4xuR0euV6DChDrguup2aJVU8JPBBgRAgAPAhsMBQJU X9LxBQkeXB3fAAoJEGFXmRW1Y3YOj4UAn3nrFLPZekMeqX5aD/aq/dsbXSfyAKC45Go0YyxV HGuUuzv+GKZ6nsysJw== Message-ID: <9ce291a4-b40d-81d8-1c1a-c4311e5cc113@gmail.com> Date: Fri, 10 Aug 2018 16:58:10 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180625091713.GA13442@apalos> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/25/2018 02:17 AM, Ilias Apalodimas wrote: > On Mon, Jun 25, 2018 at 12:13:10PM +0300, Petr Machata wrote: >> Florian Fainelli writes: >> >>> if (netif_is_bridge_master(vlan->obj.orig_dev)) >>> - return -EOPNOTSUPP; >>> + info.port = dp->cpu_dp->index; >> >> The condition above will trigger also when a VLAN is added on a member >> port, and there's no other port with that VLAN. In that case the VLAN >> comes without the BRIDGE_VLAN_INFO_BRENTRY flag. In mlxsw we have this >> to get the bridge VLANs: >> >> if (netif_is_bridge_master(orig_dev)) { >> [...] >> if ((vlan->flags & BRIDGE_VLAN_INFO_BRENTRY) && >> [...] >> >> This doesn't appear to be done in DSA unless I'm missing something. > Petr's right. This will trigger for VLANs added on 'not cpu ports' if the VLAN > is not already a member. > > This command has BRIDGE_VLAN_INFO_BRENTRY set: > bridge vlan add dev br0 vid 100 pvid untagged self > I had the same issue on my CPSW RFC and solved it > exactly the same was as Petr suggested. Humm, there must be something obvious I am missing, but the following don't exactly result in what I would expect after adding a check for vlan->flags & BRIDGE_VLAN_INFO_BRENTRY: brctl addbr br0 echo 1 > /sys/class/net/br0/bridge/vlan_filtering brctl addif br0 lan1 #1 results in lan1 being programmed with VID 1, PVID, untagged, but not the CPU port. I would have sort of expected that the bridge layer would also push the configuration to br0/CPU port since this is the default VLAN: bridge vlan show dev br0 port vlan ids br0 1 PVID Egress Untagged But it does not. bridge vlan add vid 2 dev lan1 #2 same thing, results in only lan1 being programmed with VID 2, tagged but that is expected because we are creating the VLAN only for the user-facing port. bridge vlan add vid 3 dev br0 self #3 results in the CPU port being programmed with VID 3, tagged, again, this is expected because we are only programming the bridge master/CPU port here. Does #1 also happen for cpsw and mlxsw or do you actually get events about the bridge's default VLAN configuration? Or does the switch driver actually need to obtain that at the time the port is enslaved somehow? Thanks! -- Florian