Received: by 10.213.65.68 with SMTP id h4csp719818imn; Fri, 23 Mar 2018 14:26:42 -0700 (PDT) X-Google-Smtp-Source: AG47ELvbL+Lc+d+tpqqI9rRtzRCttiS3mYL2PMPFvvhIIIpc5cdFmMdvkAw7vOtFUHP/Or8TR3cH X-Received: by 2002:a17:902:c6:: with SMTP id a64-v6mr25643542pla.408.1521840402573; Fri, 23 Mar 2018 14:26:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521840402; cv=none; d=google.com; s=arc-20160816; b=vht0a1ZpRzTwwuUkOq1yml+Fjr/FPB7kw2Vuq/5Zb+4QJbXjolbiXymGeIZt1tDS3Z zbFaIF1V1nikoK1ucL584R7bWb/jxNCCph81dTmvezEH0WFXZXfM5ENOM8DhyCCdC3ID LQNlrXC5s7O+w6PP94Vuhac7vs2bGosBB0kaulyfvi+2WV+obYVVpRoONL76R4rAALNt PYMjK9yMkpKv6vA91cO7tbi6ddo6R7selVO/yOtercYCtMrAiT6CG/Pzs4ghpsdxu4kr P/yjmDkIUL32GgIc502XFQAdIsSqA7INRamDBz9SSsEg9voPrxLepl7JkT7DqcEOvSJb v9pQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=Ug1UTu6P436xwLo/CQ0tRzEz1a170nAIwjatkf6FQDI=; b=K1WKI0MtSpUSRi4k6ovnXbw3+o+PbRGUgXiosg5lnai7HGF5u8S3cXQrEkz7hEjgQw IlIkPlH6zGLaboNQBHmGctK+A1rTdobV6EtjXTQTNQugQIdBv3SZK0MNxmhALQVXmfsl Y8di62cCpse3H+YBiNv3Uh/x4AGXUXU1yCqOh0/blBaYdIbEoQysvSckbY3gIVesrPgk iUuEWyLunyEArmE9VFeTaj4i4lCJSmxksyKj6fwJAuXgeTPcovYIKVejure2IvyhRKeL 4gbJ2SW1+yrf6TBz4Bbf65qeRA1cAN2/xe/Vql4IaoNxd7L/eWsLutfBZHjzk0Vl06Uw U1kQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=m29iUAPj; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w130si7303205pfd.280.2018.03.23.14.26.27; Fri, 23 Mar 2018 14:26:42 -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=@lunn.ch header.s=20171124 header.b=m29iUAPj; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752066AbeCWVZY (ORCPT + 99 others); Fri, 23 Mar 2018 17:25:24 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:40658 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751471AbeCWVZX (ORCPT ); Fri, 23 Mar 2018 17:25:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=Ug1UTu6P436xwLo/CQ0tRzEz1a170nAIwjatkf6FQDI=; b=m29iUAPjptb+D20YmeiUyczAL93MRm/eKcULbmbB9ASfcBvfX+vsEF4DnPOmkrgxJLWjcJfBT/5hR5uqskd+Im872MdWS2EI0AgZGifpY2bm+9DBqOVQJuq8as6Gx62HldkS0I7hffeGcyzWVRDYGgNgXWddQWm1vlSg8fn9RIs=; Received: from andrew by vps0.lunn.ch with local (Exim 4.84_2) (envelope-from ) id 1ezUBY-0005ic-U8; Fri, 23 Mar 2018 22:25:16 +0100 Date: Fri, 23 Mar 2018 22:25:16 +0100 From: Andrew Lunn To: Alexandre Belloni Cc: "David S . Miller" , Allan Nielsen , razvan.stefanescu@nxp.com, po.liu@nxp.com, Thomas Petazzoni , Florian Fainelli , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@linux-mips.org Subject: Re: [PATCH net-next 5/8] net: mscc: Add initial Ocelot switch support Message-ID: <20180323212516.GU24361@lunn.ch> References: <20180323201117.8416-1-alexandre.belloni@bootlin.com> <20180323201117.8416-6-alexandre.belloni@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180323201117.8416-6-alexandre.belloni@bootlin.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Alexandre > +static int ocelot_port_bridge_join(struct ocelot_port *ocelot_port, > + struct net_device *bridge) > +{ > + struct ocelot *ocelot = ocelot_port->ocelot; > + > + if (!ocelot->bridge_mask) { > + ocelot->hw_bridge_dev = bridge; > + } else { > + if (ocelot->hw_bridge_dev != bridge) > + return -ENODEV; //TODO: do something clever here > + } > + > + ocelot->bridge_mask |= BIT(ocelot_port->chip_port); > + > + return 0; > +} I could be missing something here, but this looks way too simple. By default, you have individual ports. They can just forward frames between the host CPU and the port. There is no port-to-port traffic allowed. You then create a bridge, and add ports to the bridge. When you add a port, you need to program the hardware that it can now forward frames from this port to other parts in the same bridge. You also need to tell other parts in the same bridge it can forward frames to it. You might also need to tell the port which forwarding database it should use, since each bridge might have its own. Andrew