{"id":814917,"url":"http://patchwork.ozlabs.org/api/1.2/patches/814917/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/patch/20170918130408.23114-3-antoine.tenart@free-electrons.com/","project":{"id":7,"url":"http://patchwork.ozlabs.org/api/1.2/projects/7/?format=json","name":"Linux network development","link_name":"netdev","list_id":"netdev.vger.kernel.org","list_email":"netdev@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20170918130408.23114-3-antoine.tenart@free-electrons.com>","list_archive_url":null,"date":"2017-09-18T13:04:07","name":"[net,2/3] net: mvpp2: fix parsing fragmentation detection","commit_ref":null,"pull_url":null,"state":"changes-requested","archived":true,"hash":"5365a282d16d228cf05cc28a7a00e84c2b3145a2","submitter":{"id":61603,"url":"http://patchwork.ozlabs.org/api/1.2/people/61603/?format=json","name":"Antoine Tenart","email":"antoine.tenart@free-electrons.com"},"delegate":{"id":34,"url":"http://patchwork.ozlabs.org/api/1.2/users/34/?format=json","username":"davem","first_name":"David","last_name":"Miller","email":"davem@davemloft.net"},"mbox":"http://patchwork.ozlabs.org/project/netdev/patch/20170918130408.23114-3-antoine.tenart@free-electrons.com/mbox/","series":[{"id":3642,"url":"http://patchwork.ozlabs.org/api/1.2/series/3642/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/list/?series=3642","date":"2017-09-18T13:04:06","name":"net: mvpp2: various fixes","version":1,"mbox":"http://patchwork.ozlabs.org/series/3642/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/814917/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/814917/checks/","tags":{},"related":[],"headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xwmV85qppz9s3w\n\tfor <patchwork-incoming@ozlabs.org>;\n\tMon, 18 Sep 2017 23:06:24 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S932640AbdIRNGM (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tMon, 18 Sep 2017 09:06:12 -0400","from mail.free-electrons.com ([62.4.15.54]:35883 \"EHLO\n\tmail.free-electrons.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1752631AbdIRNFD (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Mon, 18 Sep 2017 09:05:03 -0400","by mail.free-electrons.com (Postfix, from userid 110)\n\tid 04FCB20EFD; Mon, 18 Sep 2017 15:05:02 +0200 (CEST)","from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr\n\t[90.63.216.87])\n\tby mail.free-electrons.com (Postfix) with ESMTPSA id CA5E820985;\n\tMon, 18 Sep 2017 15:05:01 +0200 (CEST)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on\n\tmail.free-electrons.com","X-Spam-Level":"","X-Spam-Status":"No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT,\n\tURIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0","From":"Antoine Tenart <antoine.tenart@free-electrons.com>","To":"davem@davemloft.net","Cc":"Stefan Chulski <stefanc@marvell.com>, andrew@lunn.ch,\n\tgregory.clement@free-electrons.com, thomas.petazzoni@free-electrons.com,\n\tmiquel.raynal@free-electrons.com, nadavh@marvell.com,\n\tlinux@armlinux.org.uk, linux-kernel@vger.kernel.org,\n\tmw@semihalf.com, netdev@vger.kernel.org,\n\tAntoine Tenart <antoine.tenart@free-electrons.com>","Subject":"[PATCH net 2/3] net: mvpp2: fix parsing fragmentation detection","Date":"Mon, 18 Sep 2017 15:04:07 +0200","Message-Id":"<20170918130408.23114-3-antoine.tenart@free-electrons.com>","X-Mailer":"git-send-email 2.13.5","In-Reply-To":"<20170918130408.23114-1-antoine.tenart@free-electrons.com>","References":"<20170918130408.23114-1-antoine.tenart@free-electrons.com>","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"},"content":"From: Stefan Chulski <stefanc@marvell.com>\n\nParsing fragmentation detection failed due to wrong configured\nparser TCAM entry's. Some traffic was marked as fragmented in RX\ndescriptor, even it wasn't IP fragmented. The hardware also failed to\ncalculate checksums which lead to use software checksum and caused\nperformance degradation.\n\nFixes: 3f518509dedc (\"ethernet: Add new driver for Marvell Armada 375 network unit\")\nSigned-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>\n---\n drivers/net/ethernet/marvell/mvpp2.c | 20 ++++++++++++++------\n 1 file changed, 14 insertions(+), 6 deletions(-)","diff":"diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c\nindex 7024d4dbb461..56d474414cfa 100644\n--- a/drivers/net/ethernet/marvell/mvpp2.c\n+++ b/drivers/net/ethernet/marvell/mvpp2.c\n@@ -676,6 +676,7 @@ enum mvpp2_tag_type {\n #define MVPP2_PRS_RI_L3_MCAST\t\t\tBIT(15)\n #define MVPP2_PRS_RI_L3_BCAST\t\t\t(BIT(15) | BIT(16))\n #define MVPP2_PRS_RI_IP_FRAG_MASK\t\t0x20000\n+#define MVPP2_PRS_RI_IP_FRAG_TRUE\t\tBIT(17)\n #define MVPP2_PRS_RI_UDF3_MASK\t\t\t0x300000\n #define MVPP2_PRS_RI_UDF3_RX_SPECIAL\t\tBIT(21)\n #define MVPP2_PRS_RI_L4_PROTO_MASK\t\t0x1c00000\n@@ -2315,7 +2316,7 @@ static int mvpp2_prs_ip4_proto(struct mvpp2 *priv, unsigned short proto,\n \t    (proto != IPPROTO_IGMP))\n \t\treturn -EINVAL;\n \n-\t/* Fragmented packet */\n+\t/* Not fragmented packet */\n \ttid = mvpp2_prs_tcam_first_free(priv, MVPP2_PE_FIRST_FREE_TID,\n \t\t\t\t\tMVPP2_PE_LAST_FREE_TID);\n \tif (tid < 0)\n@@ -2334,8 +2335,12 @@ static int mvpp2_prs_ip4_proto(struct mvpp2 *priv, unsigned short proto,\n \t\t\t\t  MVPP2_PRS_SRAM_OP_SEL_UDF_ADD);\n \tmvpp2_prs_sram_ai_update(&pe, MVPP2_PRS_IPV4_DIP_AI_BIT,\n \t\t\t\t MVPP2_PRS_IPV4_DIP_AI_BIT);\n-\tmvpp2_prs_sram_ri_update(&pe, ri | MVPP2_PRS_RI_IP_FRAG_MASK,\n-\t\t\t\t ri_mask | MVPP2_PRS_RI_IP_FRAG_MASK);\n+\tmvpp2_prs_sram_ri_update(&pe, ri, ri_mask | MVPP2_PRS_RI_IP_FRAG_MASK);\n+\n+\tmvpp2_prs_tcam_data_byte_set(&pe, 2, 0x00,\n+\t\t\t\t     MVPP2_PRS_TCAM_PROTO_MASK_L);\n+\tmvpp2_prs_tcam_data_byte_set(&pe, 3, 0x00,\n+\t\t\t\t     MVPP2_PRS_TCAM_PROTO_MASK);\n \n \tmvpp2_prs_tcam_data_byte_set(&pe, 5, proto, MVPP2_PRS_TCAM_PROTO_MASK);\n \tmvpp2_prs_tcam_ai_update(&pe, 0, MVPP2_PRS_IPV4_DIP_AI_BIT);\n@@ -2346,7 +2351,7 @@ static int mvpp2_prs_ip4_proto(struct mvpp2 *priv, unsigned short proto,\n \tmvpp2_prs_shadow_set(priv, pe.index, MVPP2_PRS_LU_IP4);\n \tmvpp2_prs_hw_write(priv, &pe);\n \n-\t/* Not fragmented packet */\n+\t/* Fragmented packet */\n \ttid = mvpp2_prs_tcam_first_free(priv, MVPP2_PE_FIRST_FREE_TID,\n \t\t\t\t\tMVPP2_PE_LAST_FREE_TID);\n \tif (tid < 0)\n@@ -2358,8 +2363,11 @@ static int mvpp2_prs_ip4_proto(struct mvpp2 *priv, unsigned short proto,\n \tpe.sram.word[MVPP2_PRS_SRAM_RI_CTRL_WORD] = 0x0;\n \tmvpp2_prs_sram_ri_update(&pe, ri, ri_mask);\n \n-\tmvpp2_prs_tcam_data_byte_set(&pe, 2, 0x00, MVPP2_PRS_TCAM_PROTO_MASK_L);\n-\tmvpp2_prs_tcam_data_byte_set(&pe, 3, 0x00, MVPP2_PRS_TCAM_PROTO_MASK);\n+\tmvpp2_prs_sram_ri_update(&pe, ri | MVPP2_PRS_RI_IP_FRAG_TRUE,\n+\t\t\t\t ri_mask | MVPP2_PRS_RI_IP_FRAG_MASK);\n+\n+\tmvpp2_prs_tcam_data_byte_set(&pe, 2, 0x00, 0x0);\n+\tmvpp2_prs_tcam_data_byte_set(&pe, 3, 0x00, 0x0);\n \n \t/* Update shadow table and hw entry */\n \tmvpp2_prs_shadow_set(priv, pe.index, MVPP2_PRS_LU_IP4);\n","prefixes":["net","2/3"]}