From patchwork Sun Nov 25 23:46:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 151955 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp4948781ljp; Sun, 25 Nov 2018 15:46:34 -0800 (PST) X-Google-Smtp-Source: AFSGD/XeEeBcxQPZyWy4i0oAtKxtZLWYBdKYehhMYOYCBFz0tGQdpQwdO7qyxJVpSVLc1hz5B80J X-Received: by 2002:a63:c0f:: with SMTP id b15mr22789183pgl.314.1543189593887; Sun, 25 Nov 2018 15:46:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543189593; cv=none; d=google.com; s=arc-20160816; b=tYUQ/2UPfij7krQdyHgj/lWhdTeBT4ZLBBNJuJeeC9OZxyv1wRRP8bFT4u/NyY7CzG kc13YppI1cEZVESmNBw3yIdvlmW8nBFFy3DodywXWewZJe/glzD5fcXXnasJXbCZWzZT w0n7OAoA85L7DqukrHUZ3Tsk9bV/u8IC5SoD8MkmCg8Lk+m8gV3w1kP4kXi+WfFYYcmp nY1luCW5EP7UZmrssa++biK4kdMzsl3DiT4wAKxn9GX8xNoaMggUrsLPMkmGmGXo4hYS VZR35ZM7W3cqatEQxz3mfQ4JP8lBDeKUlzRhw3Qh1xc0rUDDDe+rUTDoGcwMYOrGGvqt RNUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=lf8LtwdUZED+A+ylnyyjZqjtl4ylg+CfCwWhN2BcRJg=; b=qCvqaedlHSuGEGbI9xuj1qfeLUXC5F9oP+xIHMzcgyu3QX7ysuMQQXuz6HbR8XcZOC pjFzfqI98at1jxMpG3pSIfncK4zPLrdlUht8ij9xMGrHKoZzu83Hrb8qboqh7HbCJ7Cx r1XXhpCdan3xu/U0nraLMRjcsFoD7/AiwJ8IU77BDtecbrZvuMi0fFuc09A+JIJbxwiI 4oJ00xmLFIPgitUP2AJloABfaX/eiCikxEcLVpuMwp0urQcuOIeDnOBtLLrWKp4yAQWl SfQAoLHCvGSWG6KSInNBQhHytS+SQljxK+F6XnZjv2IGuotjhThBXoXncecb0C2MATYe 6T3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=JQWzSE4+; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e4si35647652plk.260.2018.11.25.15.46.33; Sun, 25 Nov 2018 15:46:33 -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=@ti.com header.s=ti-com-17Q1 header.b=JQWzSE4+; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726168AbeKZKit (ORCPT + 32 others); Mon, 26 Nov 2018 05:38:49 -0500 Received: from lelv0142.ext.ti.com ([198.47.23.249]:48770 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726027AbeKZKit (ORCPT ); Mon, 26 Nov 2018 05:38:49 -0500 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id wAPNkRfo091030; Sun, 25 Nov 2018 17:46:27 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1543189587; bh=lf8LtwdUZED+A+ylnyyjZqjtl4ylg+CfCwWhN2BcRJg=; h=From:To:CC:Subject:Date; b=JQWzSE4+6TC5xJcikUjvWKs1oSkm2Cft2JTR08nSgriYOyagYK/hslNFE2jgdk+R8 agWc9LWA41TuHQozVOOyINva/to7rDllmC5dUQzOsGF1HmRnkx1l2Ho/QPizfJqhBS la93ZcWq9UpU+8uonhIQw0qlYITrklXTB0EIYdZc= Received: from DLEE112.ent.ti.com (dlee112.ent.ti.com [157.170.170.23]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id wAPNkRbB126123 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 25 Nov 2018 17:46:27 -0600 Received: from DLEE108.ent.ti.com (157.170.170.38) by DLEE112.ent.ti.com (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sun, 25 Nov 2018 17:46:27 -0600 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Sun, 25 Nov 2018 17:46:27 -0600 Received: from legion.dal.desgin.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id wAPNkRJT017822; Sun, 25 Nov 2018 17:46:27 -0600 Received: from localhost (uda0226610.dhcp.ti.com [128.247.59.147]) by legion.dal.desgin.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id wAPNkRU03338; Sun, 25 Nov 2018 17:46:27 -0600 (CST) From: Grygorii Strashko To: "David S. Miller" , CC: Sekhar Nori , , , Ivan Khoronzhuk , Grygorii Strashko Subject: [PATCH net-next] net: ethernet: ti: cpsw: drop vid0 configuration in dual_mac mode Date: Sun, 25 Nov 2018 17:46:26 -0600 Message-ID: <20181125234626.28474-1-grygorii.strashko@ti.com> X-Mailer: git-send-email 2.10.5 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Grygorii Strashko --- drivers/net/ethernet/ti/cpsw.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) -- 2.10.5 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);