Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2602749rwl; Mon, 27 Mar 2023 02:33:35 -0700 (PDT) X-Google-Smtp-Source: AKy350ZnkauCSTP0Zey2lYYsJq1v1Tm66+pvDI4vc/YndcqubbHycRxzvd7hqSKumcvbaP24gryv X-Received: by 2002:a17:903:41cb:b0:1a1:d215:ef0c with SMTP id u11-20020a17090341cb00b001a1d215ef0cmr12697981ple.16.1679909615007; Mon, 27 Mar 2023 02:33:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679909614; cv=none; d=google.com; s=arc-20160816; b=nfX9uSwA7NMUWmi5wQhHiaVKubk5mw8ZVOg+Ib0HpcQ2ZjKR5z0IugOtkIw+6rJoVc P/OkVZ9fwOqshicPPqHSwtiZ6j2P+3ZXQQK2X/9bBG2k+b56tRJdlJRQ1dgLLv14k5cv LHcEBDZz86T8JpJf7AavtMwcCbbVPwb3j1WVe/eAWmq7FavO13+hBskmPWs4Ny0soB4M fLCNg8qbEeq5e3mV6LuQlWHAmuyY12hZdNUCEscTNjhp6JonWFu1mgLIPocRF5qRt1I0 2CPBx+5HaHc031nj5uJJBnj/YFjA9M7q83rUC9u18nfIl+6yGMpfsWGeYMmAiHH/t36x E8Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=sdvdlmSiC/Nqt3Kti2m1Eh1Z5e+JngJyHQGtiDEFhOk=; b=OnuzqvuS/hetVszwpCgPRU2RpYTTj9B8VgLswhBRaxudjlf+v8WxbHETA+5klmLzCk WDaxdVuRtB8zLvz/UL22vX/oP66vySmyxXPS2bLkvq9QarIzs8KcjFH1XX/zWFhtsvHg CIQ42ttvgxN1/RNED2ySzpyyOtDwMbUVI1AzSql6pzz0+UoedTXRHC2wTol4p5JYbA4f Bm5QsSY2gpVUxe+qh02k9hyu+oVQNl9ljqYNJYzQHEso09tvJQVYRsoNxYfHVRyafe3v VI6zyisEIzyl9zzjNMeBXOYCIBYqgnI6vT/MpaypM6r1Ybfy10bo3ikjIi12ANYeGXn7 ZuiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=mxqkDJ7y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c17-20020a170902849100b0019f269f06fbsi26113562plo.3.2023.03.27.02.33.23; Mon, 27 Mar 2023 02:33:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=mxqkDJ7y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232810AbjC0JVZ (ORCPT + 99 others); Mon, 27 Mar 2023 05:21:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232587AbjC0JVX (ORCPT ); Mon, 27 Mar 2023 05:21:23 -0400 Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98533210D; Mon, 27 Mar 2023 02:21:21 -0700 (PDT) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 32R9L7wr076969; Mon, 27 Mar 2023 04:21:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1679908867; bh=sdvdlmSiC/Nqt3Kti2m1Eh1Z5e+JngJyHQGtiDEFhOk=; h=From:To:CC:Subject:Date; b=mxqkDJ7yjJN5Z9VnEyW6ixilyPBy5Z3Uy4xLEKkFvjRGQjqSdoDX6w8awY0Fy7eaj u+McX9EZ9T8xkWmLmKaTwgSgOARABJCBZ5H6nYRWC4TOJBflybmgCyjKYCGm9unL2T A4QlF7BDFvZO4Wpsywo4ldObnFV0tBV4ufKnFFlc= Received: from DLEE115.ent.ti.com (dlee115.ent.ti.com [157.170.170.26]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 32R9L7Ui014557 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 27 Mar 2023 04:21:07 -0500 Received: from DLEE112.ent.ti.com (157.170.170.23) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Mon, 27 Mar 2023 04:21:07 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) 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.2507.16 via Frontend Transport; Mon, 27 Mar 2023 04:21:07 -0500 Received: from uda0492258.dhcp.ti.com (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 32R9L3HY008480; Mon, 27 Mar 2023 04:21:04 -0500 From: Siddharth Vadapalli To: , , , , CC: , , , , Subject: [PATCH net-next] net: ethernet: ti: am65-cpsw: enable p0 host port rx_vlan_remap Date: Mon, 27 Mar 2023 14:51:03 +0530 Message-ID: <20230327092103.3256118-1-s-vadapalli@ti.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Grygorii Strashko By default, the tagged ingress packets to the switch from the host port P0 get internal switch priority assigned equal to the DMA CPPI channel number they came from, unless CPSW_P0_CONTROL_REG.RX_REMAP_VLAN is enabled. This causes issues with applying QoS policies and mapping packets on external port fifos, because the default configuration is vlan_aware and DMA CPPI channels are shared between all external ports. Hence enable CPSW_P0_CONTROL_REG.RX_REMAP_VLAN so packet will preserve internal switch priority assigned following the VLAN(priority) tag no matter through which DMA CPPI Channels packets enter the switch. Signed-off-by: Grygorii Strashko Signed-off-by: Siddharth Vadapalli --- drivers/net/ethernet/ti/am65-cpsw-nuss.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c index 9ddb79776c88..907aab7dc89a 100644 --- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c +++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c @@ -86,6 +86,7 @@ /* AM65_CPSW_P0_REG_CTL */ #define AM65_CPSW_P0_REG_CTL_RX_CHECKSUM_EN BIT(0) +#define AM65_CPSW_P0_REG_CTL_RX_REMAP_VLAN BIT(16) /* AM65_CPSW_PORT_REG_PRI_CTL */ #define AM65_CPSW_PORT_REG_PRI_CTL_RX_PTYPE_RROBIN BIT(8) @@ -385,8 +386,8 @@ static int am65_cpsw_nuss_common_open(struct am65_cpsw_common *common) /* set base flow_id */ writel(common->rx_flow_id_base, host_p->port_base + AM65_CPSW_PORT0_REG_FLOW_ID_OFFSET); - /* en tx crc offload */ - writel(AM65_CPSW_P0_REG_CTL_RX_CHECKSUM_EN, host_p->port_base + AM65_CPSW_P0_REG_CTL); + writel(AM65_CPSW_P0_REG_CTL_RX_CHECKSUM_EN | AM65_CPSW_P0_REG_CTL_RX_REMAP_VLAN, + host_p->port_base + AM65_CPSW_P0_REG_CTL); am65_cpsw_nuss_set_p0_ptype(common); -- 2.25.1