From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-eopbgr50064.outbound.protection.outlook.com ([40.107.5.64]:63648 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751096AbeCINkI (ORCPT ); Fri, 9 Mar 2018 08:40:08 -0500 Date: Fri, 9 Mar 2018 15:39:57 +0200 From: Ido Schimmel To: netdev@vger.kernel.org, davem@davemloft.net, sfr@canb.auug.org.au Cc: jiri@mellanox.com, petrm@mellanox.com, mlxsw@mellanox.com Subject: Re: [PATCH net 2/2] mlxsw: spectrum: Prevent duplicate mirrors Message-ID: <20180309133957.GA9718@splinter> References: <20180309133353.9558-1-idosch@mellanox.com> <20180309133353.9558-3-idosch@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180309133353.9558-3-idosch@mellanox.com> Sender: netdev-owner@vger.kernel.org List-ID: +Stephen On Fri, Mar 09, 2018 at 03:33:53PM +0200, Ido Schimmel wrote: > From: Petr Machata > > The Spectrum ASIC doesn't support mirroring more than once from a single > binding point (which is a port-direction pair). Therefore detect that a > second binding of a given binding point is attempted. > > To that end, extend struct mlxsw_sp_span_inspected_port to track whether > a given binding point is bound or not. Extend > mlxsw_sp_span_entry_port_find() to look for ports based on the full > unique key: port number, direction, and boundness. > > Besides fixing the overt bug where configured mirrors are not offloaded, > this also fixes a more subtle bug: mlxsw_sp_span_inspected_port_del() > just defers to mlxsw_sp_span_entry_bound_port_find(), and that used to > find the first port with the right number (disregarding the type). Thus > by adding and removing egress and ingress mirrors in the right order, > one could trick the system into believing it has no egress mirrors when > in fact it did have some. That then caused that > mlxsw_sp_span_port_mtu_update() didn't update mirroring buffer when MTU > was changed. > > Fixes: 763b4b70afcd ("mlxsw: spectrum: Add support in matchall mirror TC offloading") > Signed-off-by: Petr Machata > Signed-off-by: Ido Schimmel Hi Dave, Stephen, Please note that this is going to conflict with recent mirroring to GRE tap work when you merge net into net-next. The resolution is available here: git@github.com:jpirko/linux_mlxsw.git (branch: linux-next-fix) Or simply here: https://github.com/jpirko/linux_mlxsw/commit/8175f7c4736fe9f6a4dac330ee79b45593502a6c Thanks and sorry about the added work.