Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3090196imm; Fri, 19 Oct 2018 05:05:05 -0700 (PDT) X-Google-Smtp-Source: ACcGV62TDZZg/36qKRJ9MSmakbuhwCbQVNG3+Av2Kffi2HbSlDh0XZB4wXkIbYtRuK6EyE1pLg/E X-Received: by 2002:aa7:8643:: with SMTP id a3-v6mr34244359pfo.247.1539950704981; Fri, 19 Oct 2018 05:05:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539950704; cv=none; d=google.com; s=arc-20160816; b=ZxxbzL337e46ZSkxquM0Bw07PG5RwXp/md0ZTrRZ8g1DR6St3dqqdxwKnrnl1K0U5R AdU6EO8mefHYFdZj3PDvnsjF9/DCPmQ5HSXA75StLT3uE0OAtRruKk2GN9faEYUVlLU5 YKnGYDv//nHeaIFZ9OQLN8m6KJTd+qI+bjSkxhLR95CSan52LNp9VJ5LrKRIKdaOHfuP VolUWXtiuYJXydLr5PUioDHDqed7MmTuS/lK8rg8LlrdMq+ks1yaA+hy/IrjQiT0yKbp 7RbuHEMca2u6FIUA8tV8VCq0/4+WtSviit4Xor/Y5Jj8bw1OOt4kh/El2w4Vcgi944Hr zhTQ== 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:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=1H++qMzwQneFE3P82ChWKgRBDAJgC3rv7qUfQ9N9wnI=; b=oA2J2X5a5aytqfnUgYO5SoPqSBL312SJvM+gptoEafZ9yZfWA9LkABm+fBRVJcF1KK zMDuyR0WGxx0Z4Oea049IzYs4eWc+T92cYrO9LVmBC9PgAfG6T8kbtSLdoU1H+4j1wMw L9NMET1Vm+oUyhArhn8S2vgEi1xdWPmWGVYqMKVJ/vogz5tXeSj7RLk4oswnOcjKhUBf KR9iXl9Dsgh9vb4LUubn+rn1v/n8aLNtTPdxRvrxzNjgMyZa/rjmFFXTOBLrhu3ZZ/xz vvsXHcqrAHwlaV9Sm4pf157yGX3aUOvYAHMdJO1YAg/5Maune/Qjd+AJRErWh/pyGycK gJLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=F3Jpyy10; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h131-v6si24198035pgc.122.2018.10.19.05.04.48; Fri, 19 Oct 2018 05:05:04 -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=@linaro.org header.s=google header.b=F3Jpyy10; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727537AbeJSUKC (ORCPT + 99 others); Fri, 19 Oct 2018 16:10:02 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:43353 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727417AbeJSUKC (ORCPT ); Fri, 19 Oct 2018 16:10:02 -0400 Received: by mail-lf1-f68.google.com with SMTP id p34-v6so25040405lfg.10 for ; Fri, 19 Oct 2018 05:04:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=1H++qMzwQneFE3P82ChWKgRBDAJgC3rv7qUfQ9N9wnI=; b=F3Jpyy10kGvRwPwjPDIF9rFI6/HLaR4UofOkCuUmLa0QatWDlFZOoVkI755l/fOA+1 a3HBral7r4ge1IIdt/QxgbpSYD2ZO1DVmBN8m2pgykRL6ztckkzLF7mAXgAHzais7Ujr LdK5aYOXD1Ga5DrGjkkF8cAF8WjFsykFM6mxA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=1H++qMzwQneFE3P82ChWKgRBDAJgC3rv7qUfQ9N9wnI=; b=K+PD8QfAztH/aSYa+N4/lLHnpskxYkeX1a+EOSGrRktL6QNCmqqBbBkgAd31LDBJCK Hi33oHtjQKkK22cDIQcRdiVh79FfN8pRgG/NytY9hGeNp+g+MJdi1JtNM+jP5RjDgk1i 090udItU/ErjqP8lkeU4IPMhMGkU838nI0mHcZbQkAFFOdgB8q/u8pvgmSRu5AXdYBoG 89Zkp4e/wjHpze1H1fmxUdfyGm/YvUI+7EVVgzYq/XmCh2D7LFUPNXKP4wND4HQDUJsa DASfbIcA/Jq23sASCuO7TgRPGxuWwEtK6EFx3oW9ubIL6PJZaCi3rqHFgRmAYX9ym1Wf Rkpg== X-Gm-Message-State: ABuFfoguZJhx52sDD8O9LLxflTc7TOmdWsnzr3xvQ9J1JxalrWOTDKME fBTXZ4x4E/8xOKGoBfW82ob2OQ== X-Received: by 2002:a19:d612:: with SMTP id n18-v6mr2749803lfg.4.1539950652883; Fri, 19 Oct 2018 05:04:12 -0700 (PDT) Received: from khorivan (59-201-94-178.pool.ukrtel.net. [178.94.201.59]) by smtp.gmail.com with ESMTPSA id p140-v6sm3848811lfe.71.2018.10.19.05.04.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 19 Oct 2018 05:04:12 -0700 (PDT) Date: Fri, 19 Oct 2018 15:04:09 +0300 From: Ivan Khoronzhuk To: Grygorii Strashko Cc: davem@davemloft.net, linux-omap@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next] net: ethernet: ti: cpsw: don't flush mcast entries while switch promisc mode Message-ID: <20181019120408.GA3909@khorivan> Mail-Followup-To: Grygorii Strashko , davem@davemloft.net, linux-omap@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20181018180006.7065-1-ivan.khoronzhuk@linaro.org> <6c34a3ce-dbee-538e-bda7-8dd485315267@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <6c34a3ce-dbee-538e-bda7-8dd485315267@ti.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 18, 2018 at 07:03:06PM -0500, Grygorii Strashko wrote: > > >On 10/18/18 1:00 PM, Ivan Khoronzhuk wrote: >>No need now to flush mcast entries in switch mode while toggling to >>promiscuous mode. It's not needed as vlan reg_mcast = ALL_PORTS >>and mcast/vlan ports = ALL_PORTS, the same happening for vlan >>unreg_mcast, it's set to ALL_PORT_MASK just after calling promisc >>mode routine by calling set allmulti. I suppose main reason to flush >>them is to use unreg_mcast to receive all to host port. Thus, now, all >>mcast packets are received anyway and no reason to flush mcast entries >>unsafely, as they were synced with __dev_mc_sync() previously and are >>not restored. Another way is to _dev_mc_unsync() them, but no need. > >User have possibility to add additional mcast entries or edit existing >in switch-mode, which is now done using custom tool. So, Host in >promisc >mode will not receive packets for mcast address X if port mask for this >addr set to (ALL_PORTS - HOST_PORT). Am I missing smth? I didn't take into account the custom tool changing entries directly, but even in this case there is at least a couple of interesting questions: 1) Before the patch applied only several days ago - 5da1948969bc1991920987ce4361ea56046e5a98 "ti: cpsw: fix lost of mcast packets while rx_mode update" It was impossible to do correctly anyway, as all mcast entries not in the mc list were flushed (after rx_mode cb), by: cpsw_ale_flush_multicast(cpsw->ale, ALE_ALL_PORTS, vid); and those in mc, rewritten by adding them back in corrected form. ... or this cb was not supposed to be called at all ... 2) What is the reason to add mcast switch entires (ALL_PORTS - HOST_PORT) if its function is added anyway by unreq_mcast & (ALL_PORTS - HOST_PORT) ? So, doesn't matter it's added or not - it will work :-|. 3) Even so, toggling promisc mode will clear all these changes anyway, even I will call _dev_mc_unsync() after flushing them. 4) If user can tune ALE table by hand, what stops him do it after moving to promisc mode, seems he knows what he's doing? 5) It could be possible only for not default vlan entries, but mcast vlan support is not supported yet. Who is gona restore those entries after promisc off? This behaviour is arguable, and flushing mcast entries can bring more issues then leaving. For me it doesn't matter, I can archive the same by adding after flush one line, it's even shorter: __dev_mc_unsync(priv->ndev, NULL); > >> >>Signed-off-by: Ivan Khoronzhuk >>--- >> >>Based on net-next/master >>Tasted on am572x EVM and BBB >> >> drivers/net/ethernet/ti/cpsw.c | 3 --- >> 1 file changed, 3 deletions(-) >> >>diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c >>index 226be2a56c1f..0e475020a674 100644 >>--- a/drivers/net/ethernet/ti/cpsw.c >>+++ b/drivers/net/ethernet/ti/cpsw.c >>@@ -638,9 +638,6 @@ static void cpsw_set_promiscious(struct net_device *ndev, bool enable) >> } while (time_after(timeout, jiffies)); >> cpsw_ale_control_set(ale, 0, ALE_AGEOUT, 1); >>- /* Clear all mcast from ALE */ >>- cpsw_ale_flush_multicast(ale, ALE_ALL_PORTS, -1); >>- >> /* Flood All Unicast Packets to Host port */ >> cpsw_ale_control_set(ale, 0, ALE_P0_UNI_FLOOD, 1); >> dev_dbg(&ndev->dev, "promiscuity enabled\n"); >> > >-- >regards, >-grygorii -- Regards, Ivan Khoronzhuk