Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp374816imu; Mon, 26 Nov 2018 12:09:13 -0800 (PST) X-Google-Smtp-Source: AFSGD/Xcz2yWN5RUa34GcRG/0fGm48vta9CGpOvHKZz/ObGUG9XISCXmzUgg1jvQ+RZM1Pje4O/J X-Received: by 2002:a63:680a:: with SMTP id d10mr26572005pgc.396.1543262953134; Mon, 26 Nov 2018 12:09:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543262953; cv=none; d=google.com; s=arc-20160816; b=K7oSsSoFldJt0iqoF9WdjTuBigMy0Kvv++0BeUiH6oovFKapY7kvOmy2p2y8uRFOor R3+nUqHpIAo83Xic7zX4skKKGVWORenZ2+fP4DaCKCkkJmyRbY0/RaRr4j/rKiNMe7yi Oh35y57BrROF65yztCLmqwxnghZzMX4CM5f0p9scX/sYc3p8kcr9GfzfaNGX8H5maFPQ 7B2pZ4bdXqFJb1fhJnlmi6OG6Xt+bcKhmRm8I61IABFhspzx5YU4cSXwjjq1UBCvmuvb kee1dVAmGLDPHCVdOps+4pSXjZNdf4mzPxOC7tNWBNXLcZ3IJGnoJo6djhWOm7030Fki U0yA== 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-transfer-encoding:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=KJMzzKN1BS/GizbeiG3GSikvDDOTZTohRjoUf482bow=; b=nixh/Uk28UfW6H7PAWallyAtkgIy+Nsis5JEhKVsMU3HN9W/yiH80Lkql2YBUKwjEv 8p8ogMVKxvQOJeo299jMVlBaAoEOOdoypQmo2S71Yloaivy7TjY7SLPrgYQ+FXrCYLoo xwRWOSL5YyyZGg1E2GGXBtKgdjluBEKEd2PhjznQnjSNMA5SpYMItflWDVXyEKHvG3IO exJ4J3uYlJqxJkSORqvSyT5EKPR3jgeAcfF3l3ygGjMs2blld0meHclEAPBviWfR0sqn t1Wzca7iSwKlJvR1OpoCbk5lZy0oIp4q0ZbDtBhRVZ82fvlUnQfuqf11ppz3LOUQtqg9 pfHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HtbO1A7M; 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 d127si1237415pfg.255.2018.11.26.12.08.46; Mon, 26 Nov 2018 12:09:13 -0800 (PST) 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=HtbO1A7M; 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 S1727303AbeK0HDU (ORCPT + 99 others); Tue, 27 Nov 2018 02:03:20 -0500 Received: from mail-lf1-f65.google.com ([209.85.167.65]:41184 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726630AbeK0HDT (ORCPT ); Tue, 27 Nov 2018 02:03:19 -0500 Received: by mail-lf1-f65.google.com with SMTP id c16so14583485lfj.8 for ; Mon, 26 Nov 2018 12:08:04 -0800 (PST) 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:content-transfer-encoding :in-reply-to:user-agent; bh=KJMzzKN1BS/GizbeiG3GSikvDDOTZTohRjoUf482bow=; b=HtbO1A7Mgn4NIJghuzgeEtM0UTIDW2R9hd6XGQvooLTcjmy5OTmt8tFX81KZ1ru8OU oTh9HXVYktqFZG1J66O5BcwM/wDuT2HbuAAi3Eh/TbZkcF+sEYra3S3HXOmLNdAB42Hf bj0t6xtJmsGs8U5v/aHQQaX2BwfyTUjGeWmdk= 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 :content-transfer-encoding:in-reply-to:user-agent; bh=KJMzzKN1BS/GizbeiG3GSikvDDOTZTohRjoUf482bow=; b=Wp0687iYa/xOtHDLD9JE+v50Jc9xXtIgfWclJ42sIAmlhWnBUynP42joQcfGhYFIgL hcJ6EtaUHoeVagzSQGiAuSc6uALlUr6UlundjFFzSMByowyXkPuJ7L63H2ynwmwBaxy7 bs88KtU8ZlUtHhIBzouoAtg5P5CXMPb8TIHjd1u8oLsOKmcDY1o8SslcS5KKyKL1DdB9 8tJ9TklXeq/FuKMXgenWk+0bsPlxqt1+nouxF7lTIZ4YneUiF9D/piF5q5tAqtE68DHK o1dSeGmJjqEBO7pH7QbKQewFXvqK1QrVrcuIKExYSnXS9oA39QxSjXJXNz6LSySlUMRJ gjSw== X-Gm-Message-State: AGRZ1gK1F4WQ5SdsHue5k8t7jSh7jg+GwOn4wHyqqATf5zwVyg6LSp3Q RtN+Qu9TBFcdFR6MVxgc6Z6/IA== X-Received: by 2002:a19:4f0c:: with SMTP id d12mr16113802lfb.121.1543262883580; Mon, 26 Nov 2018 12:08:03 -0800 (PST) Received: from khorivan (59-201-94-178.pool.ukrtel.net. [178.94.201.59]) by smtp.gmail.com with ESMTPSA id p138sm208869lfp.22.2018.11.26.12.08.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 26 Nov 2018 12:08:01 -0800 (PST) Date: Mon, 26 Nov 2018 22:07:59 +0200 From: Ivan Khoronzhuk To: Grygorii Strashko Cc: "David S. Miller" , netdev@vger.kernel.org, Sekhar Nori , linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org Subject: Re: [PATCH net-next] net: ethernet: ti: cpsw: drop vid0 configuration in dual_mac modey Message-ID: <20181126200757.GB23230@khorivan> Mail-Followup-To: Grygorii Strashko , "David S. Miller" , netdev@vger.kernel.org, Sekhar Nori , linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org References: <20181125234626.28474-1-grygorii.strashko@ti.com> <20181126162644.GA23230@khorivan> <7f2c5e66-3b42-f921-c52d-236f5adc44bf@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <7f2c5e66-3b42-f921-c52d-236f5adc44bf@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 Mon, Nov 26, 2018 at 12:57:20PM -0600, Grygorii Strashko wrote: > > >On 11/26/18 10:26 AM, Ivan Khoronzhuk wrote: >> On Sun, Nov 25, 2018 at 05:46:26PM -0600, Grygorii Strashko wrote: >>> In dual_mac mode CPSW driver uses vid1 and vid2 by default to implement >>> dual mac mode wich are used to configure pvids for each external ports. >>> But, historicaly, it also adds vid0 to ALE table and sets "untag" bits for both >>> ext. ports. As result, it's imposible to use priority tagged packets in >>> dual mac mode. >>> >>> Hence, drop vid0 configuration in dual mac mode as it's not required for dual >>> mac mode functionality and, this way, make it possible to use priority >>> tagged packet in dual mac mode. >> So, now it's enabled to be added via regular ndo. >> I have similar change in mind, but was going to send it after >> mcast/ucast, and - enabling same vlans patch... >> >> 2 things stopped me to add this: >> >> 1) Moving it to be enabled via regular call is Ok, but in dual mac mode >> it causes overlaps, at least while vid deletion. So decided to wait till >> same vlans series is applied. > >TI driver documentation mentions this restriction >"While adding VLAN id to the eth interfaces, >same VLAN id should not be added in both interfaces which will lead to VLAN >forwarding and act as switch" It's not accurate now. This sw bug "acting like a switch" was fixed indirectly in LKML ). And at least for upstream version, not TISDK, desc should be updated, but better do this when it fixed completely and merged with TISDK. I know about this "written" restriction (for tiSDK, and it's not TRM after all ...), it can be avoided and it's partly avoided now ... Also, for notice, while you add any of the vlans to any of the ports, vlan0 is added to both of them.....restricted it or not. Thanks to last changes in the driver it's not "acting like a switch" The patch in question enables this in ndo, not me. #ip link add link eth0 name eth0.400 type vlan id 400 [ 326.538989] 8021q: 802.1Q VLAN Support v1.8 [ 326.543217] 8021q: adding VLAN 0 to HW filter on device eth0 [ 326.554645] 8021q: adding VLAN 0 to HW filter on device eth1 [ 326.572236] net eth0: Adding vlanid 400 to vlan filter I just propose to extend it later, when it's correct to do. But if no harm (basically no harm, only if someone decides to add vlan0 to both ports and then delete on one of them) , at least you should take this into account. > >> >> 2) Wanted implement somehow similar handling for single port boards >> in one patch, not only for dual mac mode. This part was not clear and >> not verified completely... >> >> So, if it's needed now, maybe better at this moment only remove >> untag field? and remove vlan0 later, once other vlan changes applied. >> >> Say: >> >> cpsw_ale_add_vlan(cpsw->ale, cpsw->data.default_vlan, >> ????????? ALE_ALL_PORTS, 0, ALE_ALL_PORTS, 0); >> >> instead of: >> cpsw_ale_add_vlan(cpsw->ale, cpsw->data.default_vlan, >> ????????? ALE_ALL_PORTS, ALE_ALL_PORTS, 0, 0); >> > >This patch affects only dual_mac mode and in this mode adding vid0 by default is >definitely make no sense in any case. The above proposition is only to your change, only for dual-mac. > >>> >>> Signed-off-by: Grygorii Strashko >>> --- >>> drivers/net/ethernet/ti/cpsw.c | 7 ++----- >>> 1 file changed, 2 insertions(+), 5 deletions(-) >-- >regards, >-grygorii -- Regards, Ivan Khoronzhuk