From patchwork Fri Jul 6 08:10:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 141263 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2834723ljj; Fri, 6 Jul 2018 01:12:20 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeJn7n2ocWbJCBtL3mB/dG+M3LYH+0iOhHZmTwdKZ3xCkEk9Hgcg24MVAMiPB2E1CukQScv X-Received: by 2002:a1c:4983:: with SMTP id w125-v6mr2651843wma.68.1530864740513; Fri, 06 Jul 2018 01:12:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530864740; cv=none; d=google.com; s=arc-20160816; b=UP/E/L4/9d/qW+2KoFly68Mhy/685eaPa9rRsluT+sS6d29JWkv2DnFZdR+vfFHic6 YHzx//tdkWApZmKog61NaoO5umdcYo+9GWoYpMM1cLI1V0wZ9hmf/0HHtln8AyW0AmmS MBcUB/8WSPRlN3ky1Dc7xPZqfs1TdrhRMEgGczQcPbKKedtEAC4ObkFBRJtvwYafFbTT WhkZnc7IDNbh6oVCsak2UJw7y/30FRP9MCLGPDyyxLPoM2D4sADEaR8uq911rg2dL4nN +gGg4TlSkYuM2vE4JnBPWUiCzxTf1lihhU//tdGM5z8B7vLSNagBJUwvYwn2nRCzKeY/ hIRg== 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:dkim-signature:arc-authentication-results; bh=EISB5PGDWfeiuYZX2AudSn7MbeOKxT5/3ozuIetq9x4=; b=F0ypYMB/OTQhRdqs981AOSGYndXG27e0dbldFEMn3bLqm7ZHAH8WJnPpW8GOZEicoe FoOL6i8L0FzwxMyw6/9EWbCuTMRSN8oqQanegqUqc7MCUpoA8o7cbu2s34xPp9d3hzoL TotMuWmng16QVaQICQ16iQKTSXFURr96NLze7XzEqnGfvvkjKRBqoib65mx3kQPrjIIt lcU51zBI5a27Vr/5vWapd8noZI3Ut9fxkvIdtogSn+7Q0KOmnw23qJ+30f2LPJ3r92H1 hMQRXdcX8Gx1gwp6ygpTctJmW4Gty+xs/mvXqW4zZfC+YRohz9sLspGGydMs0/Vx6261 gn8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=Zdbt2xH7; 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 32-v6si7524686wrc.289.2018.07.06.01.12.20; Fri, 06 Jul 2018 01:12:20 -0700 (PDT) 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; dkim=fail header.i=@nxp.com header.s=selector1 header.b=Zdbt2xH7; 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 146BB1C448; Fri, 6 Jul 2018 10:12:05 +0200 (CEST) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00080.outbound.protection.outlook.com [40.107.0.80]) by dpdk.org (Postfix) with ESMTP id 1DD831C435; Fri, 6 Jul 2018 10:12:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EISB5PGDWfeiuYZX2AudSn7MbeOKxT5/3ozuIetq9x4=; b=Zdbt2xH7VapvuNqSb7qH3Bab0ch064eNeFVtoE8e7yd3/UWQC050wIzQyHEYkI186WclFyzQW/A1WhK28iruCP+gOAw2J6ywag8sXwR/rMq1SAbCxHRhC7KVHK/SiwNypiyACGtTYhdx6BFGBHJ+rafoahHbZpPofYpyhFN6tmA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; Received: from bf-netperf1.ap.freescale.net (14.142.187.166) by AM2PR04MB0755.eurprd04.prod.outlook.com (2a01:111:e400:8411::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.906.23; Fri, 6 Jul 2018 08:11:59 +0000 From: Hemant Agrawal To: dev@dpdk.org Cc: shreyansh.jain@nxp.com, stable@dpdk.org Date: Fri, 6 Jul 2018 13:40:00 +0530 Message-Id: <1530864613-11754-3-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530864613-11754-1-git-send-email-hemant.agrawal@nxp.com> References: <1530697431-1244-1-git-send-email-hemant.agrawal@nxp.com> <1530864613-11754-1-git-send-email-hemant.agrawal@nxp.com> MIME-Version: 1.0 X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: PN1PR01CA0076.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::16) To AM2PR04MB0755.eurprd04.prod.outlook.com (2a01:111:e400:8411::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7def8303-28d1-4d17-2e08-08d5e3182600 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(48565401081)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:AM2PR04MB0755; X-Microsoft-Exchange-Di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fq9lCwfdzuflCWjnp9gpbUwTxy6ct2ntvMAzDl2FoXRkBqYCGkReFFN17v11pzFzSfz9dPDlotcTsg2hkWNIi7TayYlz2/mYYNRc8r24QJ1esXyZn5cObV8obH/gJf3/EFnBW0xPfY3XRYtre0KL/R8hMDXvnrkv482u+4y56rW0dGflqKYmV7bvZn2Kxeuzbt/L+JEBEzC/0t7TbgcpGHOYIilwNPzAYPlRq6qvIHWAguQOTuNjo/50Xyb4i2A17Haqc7GGJA3jhEpHCk765B6DZEOJnEc6fyf6NCluOnOfNC/406ekc0n4gomFa2x7yMOhEQVl6J/n1Ux/UTKbrr5Nu4dfj3T9y5zYQv2zqCbPV1UQy1XES; 4:zZzpPgtdM01r1K54Of+AjatzM8YIfCSGi5R6Vc/cXiICjb8N7pSC2Rdf7IB6Mn//DeQvHF4Ai/ur78s/gAHqt8K5s4s5OYNs8vBx8KHT+9+asHbThEbTWED5ruK+yH8lxqLxAZRS1SFWTZQ44UU6mRSFGM5mEbQ070uWdbooG42eQMWaCmHJ7qBEqtg06WOc9kkDsIKQYRtbg+LHz2oQe1tXqIgy+uvBk3xn0beTBBLQe96Bv7XXtPV4MeRDwKdUIzvhokG8CPGRPHk4cQtqLCZtiNb54kTt6YG7JzR7KGCQOGVkktSgoiBPnVEZnHkN X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:AM2PR04MB0755; BCL:0; PCL:0; RULEID:; SRVR:AM2PR04MB0755; X-Forefront-PRVS: 0725D9E8D0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(396003)(136003)(366004)(346002)(376002)(199004)(189003)(956004)(66066001)(446003)(6116002)(2616005)(476003)(5009440100003)(6916009)(76176011)(186003)(16586007)(16526019)(105586002)(478600001)(86362001)(450100002)(44832011)(106356001)(3846002)(6666003)(4326008)(486006)(11346002)(6486002)(2906002)(25786009)(305945005)(47776003)(50466002)(2361001)(7736002)(5660300001)(6512007)(48376002)(8936002)(68736007)(36756003)(97736004)(55236004)(6506007)(53936002)(26005)(51416003)(50226002)(8676002)(2351001)(81156014)(81166006)(386003)(52116002)(316002)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM2PR04MB0755; H:bf-netperf1.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM2PR04MB0755; 23:Nz2+e0cZ9FockyW39oVOuIMQMz0RrvF8WhZw44hSz?= 0hCPxwxaotOcn7bblFMKXimSj8+JnhA/w5skF99L6HTlrp2rEkIjo+G3kwvESnyMp8oSgWfjLQLmtPjqVmjUHVhmDjaF6Zb62omHgDwjs/iOGqY6dP1H1doI81yXV2EOeWg9olin+oq2KnoYLvLp+P8tPkM6evrXFW3wg41QzXvHDAdEaCYXa+75ePlGy6+hqEI3tsGeuDzZQcq1h6LulP9ffV2K3XpXj4VCtlst+5PI014xHSOCNzF2+eMj98DXeHjaHjQRKUtkZtfi6NlfNIEPCeqWjItr38aQR8hAErPQPdRCFDK8xm+y7FH/CIGYjoL4fwArmDR5j2Pp7lVYkezF6z7ARwe8DGoTVkUZc69P5JH5XBq7EU03fOEOzyhRjfJ8QeX6yFbFzO5WaL4AXZVY0/GngQbIs+RDJZJbipXr/GEVm7zJ2pJwXPY+DZeteoNV7lS/+knlBdmcpyKCH+VXhE5o+9HTJdFwljS1sBENZ6xeKQfCE4rOhoFJzxESSKWaNLnYirtJpGAIxaH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TRM/lhrSWtxWrGVn2ZWkCDCikW6vCxodXrZgUXy5gK4hzCeJrh+xejUSCfXKBOdXM9N94Czl4UDCIxiEjYjhRVdh+Othv6Jfsj6wf43wGwWlx8pSbiwQ7bJBoMf/oeGuaXeCk1B75p5CXJQ X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2018 08:11:59.0262 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7def8303-28d1-4d17-2e08-08d5e3182600 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM2PR04MB0755 Subject: [dpdk-dev] [PATCH v3 03/16] bus/dpaa: fix the buffer offset setting in FMAN 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" The buffer offset was incorrectly being set at 64, thus not honoring the packet headroom. Fixes: 6d6b4f49a155 (bus/dpaa: add FMAN hardware operations") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal --- drivers/bus/dpaa/base/fman/fman_hw.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) -- 2.7.4 Acked-by: Shreyansh Jain diff --git a/drivers/bus/dpaa/base/fman/fman_hw.c b/drivers/bus/dpaa/base/fman/fman_hw.c index 0148b98..7ada7fa 100644 --- a/drivers/bus/dpaa/base/fman/fman_hw.c +++ b/drivers/bus/dpaa/base/fman/fman_hw.c @@ -16,6 +16,8 @@ #include #include +#define FMAN_SP_EXT_BUF_MARG_START_SHIFT 16 + /* Instantiate the global variable that the inline CRC64 implementation (in * ) depends on. */ @@ -422,20 +424,16 @@ fman_if_set_fc_quanta(struct fman_if *fm_if, u16 pause_quanta) int fman_if_get_fdoff(struct fman_if *fm_if) { - u32 fmbm_ricp; + u32 fmbm_rebm; int fdoff; - int iceof_mask = 0x001f0000; - int icsz_mask = 0x0000001f; struct __fman_if *__if = container_of(fm_if, struct __fman_if, __if); assert(fman_ccsr_map_fd != -1); - fmbm_ricp = - in_be32(&((struct rx_bmi_regs *)__if->bmi_map)->fmbm_ricp); - /*iceof + icsz*/ - fdoff = ((fmbm_ricp & iceof_mask) >> 16) * 16 + - (fmbm_ricp & icsz_mask) * 16; + fmbm_rebm = in_be32(&((struct rx_bmi_regs *)__if->bmi_map)->fmbm_rebm); + + fdoff = (fmbm_rebm >> FMAN_SP_EXT_BUF_MARG_START_SHIFT) & 0x1ff; return fdoff; } @@ -502,12 +500,16 @@ fman_if_set_fdoff(struct fman_if *fm_if, uint32_t fd_offset) { struct __fman_if *__if = container_of(fm_if, struct __fman_if, __if); unsigned int *fmbm_rebm; + int val = 0; + int fmbm_mask = 0x01ff0000; + + val = fd_offset << FMAN_SP_EXT_BUF_MARG_START_SHIFT; assert(fman_ccsr_map_fd != -1); fmbm_rebm = &((struct rx_bmi_regs *)__if->bmi_map)->fmbm_rebm; - out_be32(fmbm_rebm, in_be32(fmbm_rebm) | (fd_offset << 16)); + out_be32(fmbm_rebm, (in_be32(fmbm_rebm) & ~fmbm_mask) | val); } void