From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Lunn Subject: Re: [PATCH v3 net-next 0/5] IGMP snooping for local traffic Date: Wed, 8 Nov 2017 00:17:00 +0100 Message-ID: <20171107231700.GD7601@lunn.ch> References: <1510010818-23223-1-git-send-email-andrew@lunn.ch> <87d14ut405.fsf@weeman.i-did-not-set--mail-host-address--so-tickle-me> <20171107174222.GA15028@lunn.ch> <87mv3y7y52.fsf@weeman.i-did-not-set--mail-host-address--so-tickle-me> <20171107210142.GA21784@lunn.ch> <112f2916-d2de-06c0-87b9-a6c49967bcdf@gmail.com> <20171107221710.GE21784@lunn.ch> <87lgjhhg0j.fsf@weeman.i-did-not-set--mail-host-address--so-tickle-me> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Florian Fainelli , David Miller , netdev To: Vivien Didelot Return-path: Received: from vps0.lunn.ch ([185.16.172.187]:47704 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756799AbdKGXRG (ORCPT ); Tue, 7 Nov 2017 18:17:06 -0500 Content-Disposition: inline In-Reply-To: <87lgjhhg0j.fsf@weeman.i-did-not-set--mail-host-address--so-tickle-me> Sender: netdev-owner@vger.kernel.org List-ID: On Tue, Nov 07, 2017 at 05:37:32PM -0500, Vivien Didelot wrote: > Hi Andrew, > > Andrew Lunn writes: > > >> In a switch case, they all translate to programming a MDB entry for > >> a given switch port, right? > > > > No, in fact it is the exact opposite. > > Yes, they do. The proof is you call dsa_port_mdb_add. Note that i always say switchdev. switchdev has no concept of the CPU port. All switchdev has is the concept of the external ports. So when there is a join on the br0 interface, the bridge code will iterative over each port in the bridge, and make a switchdev call to each of the external ports in the bridge asking it to forward multicast traffic for a group to the host. Now, deep down in DSA, we can translate this to a dsa_port_mdb_add, on the CPU port. And we do that for every call the bridge makes for each of the external ports in the bridge. However, a pure switchdev device won't do that. It does not have a CPU port. It probably needs to add a match/action rule to its tables for the actual external port saying to forward the frame out the slow path. > Still, what I see here _from a switch driver point of view_ is either > program an MDB entry on a user port, or on its CPU port. I agree with this, if you make one change: _from a DSA switch driver point of view_ However, in the general case, this is not true. We need an API which works for Mellonex and Netranome as well, systems without a CPU port. Andrew