From patchwork Wed Dec 13 12:05:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 121740 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5382445qgn; Wed, 13 Dec 2017 04:07:18 -0800 (PST) X-Google-Smtp-Source: ACJfBovacm1i64TNIYQwHPPzvRHq/Cu/v1HiOPtctVqESULXjn5ADwH9wD1+rU0DSXb1Za+G+fIj X-Received: by 10.28.59.69 with SMTP id i66mr1847865wma.130.1513166838488; Wed, 13 Dec 2017 04:07:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513166838; cv=none; d=google.com; s=arc-20160816; b=g6QOsjFVP3qD7FAnF+YddDzJ2hYJJjKumYP7Ru48HH+0EnHEE6mh/uqwhsyFSTivfH 0y0YSQLvaG79dG+Ed9wh2scH6LTXQHkPWks5C3suYtcbC9a4zn/ZijWLd61gPleANTzR DJnwFqKS54qaHMkbA24Q7KRrueKp02wfi4axVHduWy7WWk2tAyOifdvTmbcrlytoauhh kJaIN7ii3hTT1v5Cx6lYGO6BZ12K6zKKHaPqzCSdlrB9FtRbUGpjUDClraLrvvvnRYvD ej4wHD8JQdwJ1PMYpIRQAVpx2ZuKbi+foGuFNYkrft8AhrPsf+5+WNGEGmuY1tbCW90f piJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=O2thAKx+knAi86TUyXH32xqQZX3Y2TZPYkzRhcUB6yY=; b=l5pXHkaVGdl63KV+WCGKz2vyxz8qAVG2vOfsz8TBt6ZorUBmS+lG+CYTFCOD81TJ2d xMw/wr3jHOFaEFlIx8s40D5vOvHil4D1Alj1KD7o5UBEfw51OEeDawa6KE1kGFbUe0iR DKlidxEGcxpax8rJ7oHBm1gvwv6D/hPh3HeW9GSvZLY7WEGaAatPXXlwf28OrShmzO0A IGj9Ptm3YiwvxWthiJIolLWm3oT0stS7jV+0Q7X9B0Q5Gpxl5+fbwlSwbEBXTdTeSj6E L5h4e1MK2kgRALXpiuDSNglY3QoD+njKt4niPKowNRkHjS0vnOR1imwQnKYFgxBNvPNe xE1g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id j127si1285778wma.251.2017.12.13.04.07.18; Wed, 13 Dec 2017 04:07:18 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 91A9D7D06; Wed, 13 Dec 2017 13:07:04 +0100 (CET) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0065.outbound.protection.outlook.com [104.47.36.65]) by dpdk.org (Postfix) with ESMTP id 45FA12E83; Wed, 13 Dec 2017 13:07:03 +0100 (CET) Received: from BN3PR03CA0078.namprd03.prod.outlook.com (10.167.1.166) by DM5PR03MB2699.namprd03.prod.outlook.com (10.168.197.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Wed, 13 Dec 2017 12:07:01 +0000 Received: from BN1AFFO11FD010.protection.gbl (2a01:111:f400:7c10::167) by BN3PR03CA0078.outlook.office365.com (2a01:111:e400:7a4d::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.302.9 via Frontend Transport; Wed, 13 Dec 2017 12:07:01 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11FD010.mail.protection.outlook.com (10.58.52.70) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.282.5 via Frontend Transport; Wed, 13 Dec 2017 12:06:54 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id vBDC6t9M008652; Wed, 13 Dec 2017 05:06:59 -0700 From: Hemant Agrawal To: CC: , Ashish Jain , Date: Wed, 13 Dec 2017 17:35:43 +0530 Message-ID: <1513166759-13466-3-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131576404146219374; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(336005)(346002)(376002)(39380400002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(189003)(199004)(51416003)(2351001)(77096006)(6666003)(76176011)(68736007)(356003)(16586007)(86362001)(2906002)(305945005)(575784001)(316002)(6916009)(81156014)(81166006)(8656006)(2950100002)(8936002)(8676002)(50226002)(4326008)(97736004)(104016004)(47776003)(5660300001)(498600001)(50466002)(85426001)(106466001)(53936002)(36756003)(105606002)(54906003)(48376002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR03MB2699; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD010; 1:aovIC4f7H6y+OGb0WLJrxWAknHNIv/m/iz/+79s76yUgLfiIq9nbkEptsTn5uQowB3zj/N7HPsbUB697SVqBqB9x+4AgJukKtv8Jf0fgTsQpzgIzDLV5oObUIMIoUxPH MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 61550e0c-26f1-473d-696e-08d54222006c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:DM5PR03MB2699; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2699; 3:UEpYrrr8KbIBby76FRXeTwJAYq6IHZWAl0fde2+N8bgPuikoUZAZtoYAnBMcibey1kmjh8wJZxKK07oU98T3wNp//tXtNDqBVwtDZ3htrAB7S4ySQ0ljtryoRAdPW4AlybOmCvL2Q9qytMjZObyVuuGvmDXwfDvmb1Yz1EOyiRXsrlnajqFcOMCsaxrzgMQtMQzbbvTCCSwVyqi6K66MqwRDgULDNTI6LeczKVKT9TAlUiPG3Or3yQO2cFYAx8cdjVoqyaLQgw08PLldnSjmhuaDkWLw6t5n0DcDIDs6nJ5MHonJwYJUuTsGQMwW4OLTIbvPn7jQwlLeQoYLlLrARQ4eWgHuCtLpWe0GVKQbX3E=; 25:DqOlv+rIJj6qbokdRXyXz1/nVGrk1xbPo+bwsDHEJ60zeDCTxoQNjrxn9NqwyPzM5pzV+FbYpXmD0wvK6sYdXq8VuJ+kOS/nL+C8oYR1NZPVVigbICzqvW9bnqShtpkfuMnt0VzLo5yIoPeMon0AjNS8NWX7JNSQZc/AdzEm1plGN03wyDDLIAqS+v0B9YpEdyUw0ysldl/dhI+QXr8b0YIec8t6CYMhivHoK6oidOxWv/UUNDZozyMl36PUL94QRxAXyGaBLIVk2VlEeJffdMoehziMYouiMP/YS0xqac3P853IuE8QpDs/05d85pf+MWKdEx+Q+j3VcOGdjt5VzA== X-MS-TrafficTypeDiagnostic: DM5PR03MB2699: X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2699; 31:fuv/TzLEB6xK8Toa8R035A37o3dCn8oEitklsplhy0OuOprE362ZXNv5YOBb6cLFEELlJyjC34wVKfD8/G1jGYfdw0bvncA6qRow0eriYIYgyItJlXH2Qgv9+gqhic6Ge3q1zN591WdjuZiwVn0UtXMKAj8QbzIMYgix32JJwUwEwltfCdMXDzkU6O29Rp9tBTHUt3cONysU0XSrEBNVR85vZGpVWyiPHeDdRWCASQE=; 4:jZ3CTCGAzh9+aWV7fsFD2jwYcQ/OA3EkQwe6o5q5VuucBjf+wFuAa1onHXiPWSbgPJ8mf3FtnSfsZvEysMiwB1rpTyWqGHFOMM7nlzTP9p5MODrKh4hchCyZZfgQuJbiSzVP6/eK7uVkePkHhJgEuVX0BdqkIxZpXhHDPa2rjlYj+TY0q/Miu2aWKPEbP0kB9c6Prymj4H0Zfq0zZeWrOsaJwaGmSoBjhrQTRKchH4eMgrZyUEB5Vgj8LSUMlpp3lA34gPGrfmAErA47wDipNv74oX0OLVQtK37J1e+KOMpgUR799/9YBdY0l6myjzPh X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(3231023)(10201501046)(93006095)(93001095)(3002001)(6055026)(6096035)(20161123561025)(20161123565025)(20161123559100)(20161123556025)(20161123563025)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(201708071742011); SRVR:DM5PR03MB2699; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:DM5PR03MB2699; X-Forefront-PRVS: 052017CAF1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR03MB2699; 23:Ajts0tnfaTYq/eAvfcJoWy6IfNJ/J+L1ioJ9g47B+?= mmlXWY5Zk1sth/YZlePL5iNGRyUu54TyTFrhBPU+iWO8hAaISH3ZzddpMJ2mhNj3Bv4pHwJeVsf6OhGeKoRePMBCp3lk6buPQcBX4PfIq5ygMSiIwAuGs1QtaOGXQ0vBBPwBiFptkGN0YQcsXI9+6v/kCOXDd2eDrJXNiOKVRscawLUVleZ5dbMTYWkWcjBvm2c0y6S9KFk6fblJOdL/S23SLp7vFd1n+ZoWO5LE8kKlLPkpt9D0GvSHme09fJ/yxPjoxKOVTEnaMBkCChlvmu36+1LuJvm8ilfu7gQ8OY+7MqaKk5rHCxl4s0XN/cc3cD3dzS0v94EKpSQyEWXU0vE2fF/5JZx3o6XLFV9ptFx2o3k3kJXZ5xuP7e53BmeqKDiBQoQF+GTExEZ0sfJxHFSBQsFLVpMDelD9XVyfWZwCBSY8hsnUyZY0BXvYw5uZjDdjZ1VdHZuZdoQkP7Z/MruwuUgeSwAo9S9d9hN2DVw+BVXO3qtlFpp+f40dTgUwOE8KVotXyiMTAqhpMWq3suffozYorN/XWRVGYJZCTdx1cu5X9iqZvmt1RjJP6/+W0glxV3wfyEqh6MR60AKWWCORapNa3Pkva/LX1uEiWe50kKuxpZGfsS3ES10WHT0zjcSMUUd32lPbEMc8E0gJdTojqbgwHAkTofghB2EPnbW8nGvRaKhY0oTAy1vv/4aX1zWwCk5eMfK2LOcWKN8lJIrfi/0MbJQdG1lUR0WD06IgxdTDgHSqP8BI1b1hjEv/vPeqSWcnkJ3jEQElAQp0yzwyvZB+nyLzfcitj8sXbN5bXpqvKVos+DynFCRBQHtacQDMdWhrEWAq8+ZaVP/qSEYypbxA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BmQJKWno1ldpXeNNuOqTAy5tyHMuI2bRa+pOPp82qoGsbga6pfRHHK0di56HJcoevxIzPxK16YBz3ol5YI4sVQU5Piy SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2017 12:06:54.4503 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 61550e0c-26f1-473d-696e-08d54222006c X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR03MB2699 Subject: [dpdk-dev] [PATCH 02/18] net/dpaa: fix the mbuf packet type if zero X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Ashish Jain Populate the mbuf field packet_type which is required for calculating checksum while transmitting frames Fixes: 8cffdcbe85aa ("net/dpaa: support scattered Rx") Cc: stable@dpdk.org Signed-off-by: Ashish Jain Signed-off-by: Hemant Agrawal --- drivers/net/dpaa/dpaa_rxtx.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) -- 2.7.4 diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index 771e141..c0cfec9 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -58,6 +58,7 @@ #include #include #include +#include #include "dpaa_ethdev.h" #include "dpaa_rxtx.h" @@ -504,6 +505,15 @@ dpaa_eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf, fd->opaque_addr = 0; if (mbuf->ol_flags & DPAA_TX_CKSUM_OFFLOAD_MASK) { + if (!mbuf->packet_type) { + struct rte_net_hdr_lens hdr_lens; + + mbuf->packet_type = rte_net_get_ptype(mbuf, &hdr_lens, + RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK + | RTE_PTYPE_L4_MASK); + mbuf->l2_len = hdr_lens.l2_len; + mbuf->l3_len = hdr_lens.l3_len; + } if (temp->data_off < DEFAULT_TX_ICEOF + sizeof(struct dpaa_eth_parse_results_t)) temp->data_off = DEFAULT_TX_ICEOF @@ -611,6 +621,15 @@ tx_on_dpaa_pool_unsegmented(struct rte_mbuf *mbuf, } if (mbuf->ol_flags & DPAA_TX_CKSUM_OFFLOAD_MASK) { + if (!mbuf->packet_type) { + struct rte_net_hdr_lens hdr_lens; + + mbuf->packet_type = rte_net_get_ptype(mbuf, &hdr_lens, + RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK + | RTE_PTYPE_L4_MASK); + mbuf->l2_len = hdr_lens.l2_len; + mbuf->l3_len = hdr_lens.l3_len; + } if (mbuf->data_off < (DEFAULT_TX_ICEOF + sizeof(struct dpaa_eth_parse_results_t))) { DPAA_DP_LOG(DEBUG, "Checksum offload Err: "