Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp105046imu; Mon, 26 Nov 2018 08:29:30 -0800 (PST) X-Google-Smtp-Source: AFSGD/XweM+IV+09W6kHi+8llMy9J2OQh48g6VvYXrms7R0KIrcqxxjWzXATinEuk7dIEeZQLqsg X-Received: by 2002:a62:9913:: with SMTP id d19mr23540244pfe.107.1543249770322; Mon, 26 Nov 2018 08:29:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543249770; cv=none; d=google.com; s=arc-20160816; b=e0xrwf/QwKH92lylokeqmCTaNO8paC7RKiw71Ir2BLkVt06BPu024ybCSLn3wFP0ga HyV5B7C39Nhg17oGdYMilagViTQaFCXiOTpMPS79Qx8CmJtEVTeb9mwgw0sRdJoXC0sB 3eVZIZilLLWpm8d6hJtNn2Utw/UWZIqVvPwuE5R8SdjFTAEnHNc+QD1ug2yvReuJZc3p O2LhcU+6qZsRuYerNFl/IIOPyJNCbwQXxqnJpRzE+tOyHyH88mCxKG8V+sg8O4oKcQSS BZogwj/HqWC+qffEmdp1ETtR2chMHFXnk8T8yJjwQ8ZLGromq0eUKXp6CdJ/8Rq61/kP HWTA== 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=tpctfI38pW3V8sLhZ1hY2ZEepMiZk3cvEKfiZ6FaiQM=; b=VPymI5E4yNxVYebv8Uqg6niLELFVKS+fzCb2MfReJl+xjYsPSPi37HiapaP8Caiy+m J68ElG9B8eus5YzhcGriPmFQuRvdkhtDpGzn3Wlgv2fzcGnsamK/gcMuYaRFm9gUpB2j /Tzb+ng4adK7lIeTRKw3R/hBi5RQDSSqGiGI9EFEiDCR+aj/P3wobGlubuniQRiS4n5B m1rAbWojHk7+Y8GduE8NNPIEb2Wcq9dTJh8RZNCvOkBl+Yr2YtksPT+OYDWY7vIHElP9 uSfofZpUaaU0q/ssKr6NWp5piJqEFPvN3blI6wNJ5wQB0iBKt+JoYddf328Zk+RdgyYN 3vYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OnMduiRt; 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 p187-v6si803323pfb.127.2018.11.26.08.28.47; Mon, 26 Nov 2018 08:29:30 -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=OnMduiRt; 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 S1726745AbeK0DV3 (ORCPT + 99 others); Mon, 26 Nov 2018 22:21:29 -0500 Received: from mail-lj1-f195.google.com ([209.85.208.195]:34237 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726484AbeK0DV2 (ORCPT ); Mon, 26 Nov 2018 22:21:28 -0500 Received: by mail-lj1-f195.google.com with SMTP id u6-v6so17171288ljd.1 for ; Mon, 26 Nov 2018 08:26:51 -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:in-reply-to:user-agent; bh=tpctfI38pW3V8sLhZ1hY2ZEepMiZk3cvEKfiZ6FaiQM=; b=OnMduiRt7YPzaXrleCeUMikwrthn801Abc/Zsgbd9JRvX79hvwqDwK0cXpWmTsJ2GD hkFg2oDyqvNWWp9VBmyRQUXwSBg4TUxQ+uesT1MzFOCkxuaJqoJynaDiLGb0AVCoP/nP CJ4mWiAyyKpHJ1WjUFEhz7SkEVvw85p/cxt5Q= 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=tpctfI38pW3V8sLhZ1hY2ZEepMiZk3cvEKfiZ6FaiQM=; b=tsRI6MGDrBoIQgIbAIBZT8YpQG0BidNXxangRWZzvr7sqHRXYhXhj0xggKToPqDexC WQqZ+konmKTAoM8+QbqrfU92o2dbfqpbFB+w7Xiy7aRMIIRcbga1lvf7CtDFFYGE9ZdS M4Ja+6lMUhbjuPDVFDK6Luk6TH5+mBbSjqdH9nO3qY1PG+ZA1WJiHcGfAZBKd/13eo9z lyo4j4m2Iwhx58KybBE5AB7uEPmH/NkUeaFwQc9JTlIItqMxoL9B9v1Zpgz3wSHt6Gz6 PCKCItt4n4QEE0RCqPMeOdFXYSxXBs0FgyeqLHRlwsyP68JFLbwXowg5TYlIXfUk8JID aZAw== X-Gm-Message-State: AA+aEWa3AXOnlxdthUlcruyk70KeuZq2zIj+63oZ9Q8GcFdD4G0MMGc2 ZU3a9y4zMYVDK1+vV5QIHVuf0jRtJ+akRg== X-Received: by 2002:a2e:9256:: with SMTP id v22-v6mr19105499ljg.178.1543249611046; Mon, 26 Nov 2018 08:26:51 -0800 (PST) Received: from khorivan (59-201-94-178.pool.ukrtel.net. [178.94.201.59]) by smtp.gmail.com with ESMTPSA id f29sm123655lfa.46.2018.11.26.08.26.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 26 Nov 2018 08:26:49 -0800 (PST) Date: Mon, 26 Nov 2018 18:26:47 +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: <20181126162644.GA23230@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20181125234626.28474-1-grygorii.strashko@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 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. 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); > >Signed-off-by: Grygorii Strashko >--- > drivers/net/ethernet/ti/cpsw.c | 7 ++----- > 1 file changed, 2 insertions(+), 5 deletions(-) > >diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c >index 15d563c..4f3a159 100644 >--- a/drivers/net/ethernet/ti/cpsw.c >+++ b/drivers/net/ethernet/ti/cpsw.c >@@ -2036,9 +2036,6 @@ static int cpsw_ndo_open(struct net_device *ndev) > /* Add default VLAN */ > if (!cpsw->data.dual_emac) > cpsw_add_default_vlan(priv); >- else >- cpsw_ale_add_vlan(cpsw->ale, cpsw->data.default_vlan, >- ALE_ALL_PORTS, ALE_ALL_PORTS, 0, 0); > > /* initialize shared resources for every ndev */ > if (!cpsw->usage_count) { >@@ -2490,7 +2487,7 @@ static int cpsw_ndo_vlan_rx_add_vid(struct net_device *ndev, > struct cpsw_common *cpsw = priv->cpsw; > int ret; > >- if (vid == cpsw->data.default_vlan) >+ if (!cpsw->data.dual_emac && vid == cpsw->data.default_vlan) > return 0; > > ret = pm_runtime_get_sync(cpsw->dev); >@@ -2528,7 +2525,7 @@ static int cpsw_ndo_vlan_rx_kill_vid(struct net_device *ndev, > struct cpsw_common *cpsw = priv->cpsw; > int ret; > >- if (vid == cpsw->data.default_vlan) >+ if (!cpsw->data.dual_emac && vid == cpsw->data.default_vlan) > return 0; > > ret = pm_runtime_get_sync(cpsw->dev); >-- >2.10.5 > -- Regards, Ivan Khoronzhuk