From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0060.outbound.protection.outlook.com [104.47.2.60]) by dpdk.org (Postfix) with ESMTP id ED31C58C3; Wed, 4 Jul 2018 11:45:28 +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=SiMuzH/uATmZgJgXi08Nk7Gs1Wh+uHvpyTPaqK7S21fobwrKFGASXJ7nl3UkijVOPRmhX6NacG1/ajQjWDQz2ApNuyeX8v6OGBvUXDE7p65SD14o1afkHDcs76hiKyzjNYWWI4WDOXFCeSEpMT0/Tai9U3Ka6Kw1Na68KYkiHrY= 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 DB4PR04MB0765.eurprd04.prod.outlook.com (2a01:111:e400:984d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.906.25; Wed, 4 Jul 2018 09:45:27 +0000 From: Hemant Agrawal To: dev@dpdk.org Cc: stable@dpdk.org Date: Wed, 4 Jul 2018 15:13:38 +0530 Message-Id: <1530697431-1244-3-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530697431-1244-1-git-send-email-hemant.agrawal@nxp.com> References: <1529574244-18997-1-git-send-email-hemant.agrawal@nxp.com> <1530697431-1244-1-git-send-email-hemant.agrawal@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: BM1PR0101CA0008.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::18) To DB4PR04MB0765.eurprd04.prod.outlook.com (2a01:111:e400:984d::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b7a15fa8-cca1-4c66-7e17-08d5e192dfe0 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:DB4PR04MB0765; X-Microsoft-Exchange-Diagnostics: 1; DB4PR04MB0765; 3:wvqMOCrmCGUSXXyxctZO8KJPkEh6eH54J6Jk9Ru4cTZzdmr1jVr/dbf8vtAV53c4k462scHktYIPXpFUFFvzxC5Uw4+kn1ACZYeVmhN0TMX8DR42NCNV9aeEyZT4KsPUDsiduSalKdGNDRNpo0CpsbXYF5Lg+Hl10TciA/r+IOCX88gPRBuOD1yhK6iK1qcR8ebOSd9PfKc2rtJrdEkzS1dVQYeMdRKbedW8hitaC8FVj7Lg52r0txYyYXqqhsoQ; 25:8k2k5tqH59MTG9lS9xdL0M1rWIZ7Te9NalMhuuMANbl5kTAcMQK44fs1EoHzKA4VbZnxtwJf6R2B0/VWheovn/8Hk84dgzG6mTXESAdcBwcW9RlH8FeEpYqyxCcCGdfuFY1CLA3IgRf/9/JCTsuo7DiMU0GJVdsCE4Jmk4f5MapuorioOnl3rR2ocnVThMiAkKI5D6qthFp4N5/8eXAp5oSRgS87NHH8uRGXLUFC88QknyIRbKj8fPtZdGn1RPL3bAk0p9uxfmcASEBqA507jTOj/8UYvHTukyTznWWHZtCOfB/bqYohqJFCTVh7jvfhHPjcUbYmv+oG2HvAPNg15Q==; 31:EZZg0K3jI8UZICTVHZNj+oK3mjGk9q/m53gyqSHUxSY90c9MjYxiGWF/RSaTTKbNqZwz5VupcLclNW0QhPhnPS+gKduz6TLllTQGOd4bLx8Hfn6RpwbG4+4T0A6iNNQxxjZRDnk2h1/YjSoDT738LJz/TJEyna4NltG8gyCf9d42d8bFaJqcltnPTyuMuOQjKC3FqYfXu0GLjCG9gS+4K5nKqwKLgxp7ON7GFUJWv5Q= X-MS-TrafficTypeDiagnostic: DB4PR04MB0765: X-Microsoft-Exchange-Diagnostics: 1; DB4PR04MB0765; 20:AhOkYMny5qpT16Tyw+wFajuMHBi+adnJTgQ5p/KNdPuTv+vwKdT1pHVUaCBrbNAN/WfwuS2JPH4DfaJAIegvGc+iVKr4rl8DdAw5NJy2vij0FcMVkK08LOtOMPecptvcBDiZeEqLTOVE8WG48IUE4P94llVIzRvAEenjLotVaPsUjxnGQG/IbpZ5sZXbVWKC1EGavUP8Mq+HaUgrQ6FbZMoPCvtBrGLx8nQOSc5XThO4McdNDCP79XpQwCVou+5C+sJN8YMy97bcInEmOdo1B5jlxPOXBcz57G/tKHpw7tujvZb2px8KSriEM7zhx7v0aoD7vYLzU92kBCssSCUnTWiTXY4aKpvYSq46dqKO4KjIKShJRuMHvp5tqebbCHxLjYgYupqkfBK+vq2otXPVG0mHtae9ykIHAEnmYqwUPM3wfNrd6aqF/CuEb1yuq7rVV7XyaseUWborN4PXnr6utF8ShX7a/R8dp2iR94Ynw+YZoD6abvupQpO+U7p2rEhA; 4:D43KybYb4Avc4DHQTBBCRqxuEohzPv0UoitCzgdAulr4Hk32AbgDjDjbuuFrJWp27+wT/Cwb74orpvfZXd/NxT8l6rAfnHbf0M0SQGxOa+VvtRk8Kd5Ua9o4YtN4LW8RR0udcKYnHjkupQZMnMwE+zw6g0x7rwUoP8IzYj4dnyj2/puQNrDTbdRXJYJTYOMqv1+xYIHqbP6E99U32AOAWtWC1KM79vV9VFjAjqbyoMP5B0GA2gY65PimLx2V87zgiaa1zOo09ve082qYsmcGkXVL8ayWEQMkf0gDTBezfPfKsEV5TQ0U23RSDaFEr7GH 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)(3231254)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:DB4PR04MB0765; BCL:0; PCL:0; RULEID:; SRVR:DB4PR04MB0765; X-Forefront-PRVS: 0723A02764 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(39860400002)(376002)(136003)(346002)(366004)(199004)(189003)(6512007)(11346002)(476003)(386003)(6506007)(4326008)(55236004)(956004)(2616005)(5660300001)(44832011)(105586002)(68736007)(16526019)(53936002)(446003)(50226002)(316002)(6666003)(5009440100003)(36756003)(16586007)(2351001)(6916009)(106356001)(186003)(86362001)(450100002)(26005)(6486002)(97736004)(305945005)(81166006)(7736002)(8936002)(66066001)(8676002)(478600001)(25786009)(51416003)(486006)(76176011)(3846002)(6116002)(81156014)(48376002)(50466002)(52116002)(2906002)(47776003)(2361001)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:DB4PR04MB0765; 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; DB4PR04MB0765; 23:ayXrWhyWXNaPh8jf2iN4XaWdENCaoDWQCiAMRxMb3?= =?us-ascii?Q?ucDiLSVgzX2FtPGPx0Y4arSKVohloZWrZ0KQepIkbUu3NezJxw9Pb714ddz/?= =?us-ascii?Q?KpTqg4WUJHjRfBTLze/EvbWn2U0mvxHwbpVSIIE6gPGYx4fFUvIU9iodpwnw?= =?us-ascii?Q?/ikvC+dUPKZ0QViJjo42QJ1NVow39rJpGX7swu/MzLA+Avchn9QgjIIVK0mr?= =?us-ascii?Q?QKNb2HLyhn8PuDdgIfLD7VBwgGNHpzAG60D1/XhQYFwvQznGoT27jkPz+i7I?= =?us-ascii?Q?XUXoUsyBiCS/GWb2W3Rdudjcpra23VM7zosA0lnpndIJ/Zn2iFwLEwjyQwKa?= =?us-ascii?Q?OQrkLPkfDHse947kLYS4qYXWTWqszccqLeX//Ylzfk1Dfj5yDrtg3ft8CRJD?= =?us-ascii?Q?9FijiVWPZCwgRa/J8F9XcxGPH4ihEaDEWiAGPyspoUE/bW+9TAcNigz7hfKc?= =?us-ascii?Q?/PRimU3qpqi7kD9yk1397sT5TkxHSQYGWr08auHnnFvpEp0svTVRWmXPHV1B?= =?us-ascii?Q?OeIYDF3TXllLeClP8svmF90yqfTf/xF0oWY+Q1jizgXYGf0048X9Zw4KetIP?= =?us-ascii?Q?+Qz7FYLhd38YPSK3ARjRryYq7P9oRVvcZy3SochUNz0vOexKllQluhhQJbiz?= =?us-ascii?Q?7taxgGXcY+4M0AqJJwHCpp/KgogiQ6Ny84me3cRr4cEkJUopoS35uiMdrEkM?= =?us-ascii?Q?6Tv6gsXCYYT9zepOXHqOOW5gLl6X+nxwEkM5NhB/lKUdSeUzHRc2jEvdTNiF?= =?us-ascii?Q?253AVxWUjGQNBquk4nRsInXLGRWyk6RHCDMeEatTd5MeK38qVMiz5HiO2eJ+?= =?us-ascii?Q?J8PbcGbJTzja+v4YHgIXO6tdjuyaOp0HuDOIZIBZ2NaPDkwyl/waigW81SoS?= =?us-ascii?Q?U5b2XBV1r/KFn4WUdAN0tX9r59voDchrXB+DuADTjcDo3VUStU4TwA7WNNmC?= =?us-ascii?Q?aos2w/459upFKPgBNPnfTGPPK0fv6nQVfg2f+XSOF5XinctvSl+THUEoshtl?= =?us-ascii?Q?x7z9TQETJGzCOt5WJLqyTm3kj9BD6r+APhoyQOW1D6RzsA5PuJyKNPkizjeu?= =?us-ascii?Q?RiSu78uIZDBQKDBfULc6GulWtNRjy56Cu2BkJ4MJosqheZGK91ARu4EvcHkd?= =?us-ascii?Q?AKG7kuQ4oI3tlxxxuI7cmAQIPlf1jYfDpNL54J4J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CX1ns9OFjqJUzVx6mOrF/O4RdalYCSY9ZjyJRkNNd5BpS1LfN1by9Q==; 5:kFVqhIFe93TN6mQC4FptK8LfmIChZ2/BbgW7nGY+hpzmNmpmsXJdRACNQuYPW2mqG430mqJ1bmf1IgU4q/TY3Y1TMv6eUj+CQ/Nu4Jtl7ccmRxFzQ7CNO0Hv6sdlQDgXaIMKasS7aNBL8vhKHqEfuQ8fLk1rH091N58PyjCAymA=; 24:PYB0Sl/oiEeOocX01fuu9hoi3o7cwlJa7F4xmgM1GFR6edvN07+mQNI3COMgPEB84TL372AIGmMQZ3eo+Qk88yP32JiU5DP17oF3yLZ8y6A= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB4PR04MB0765; 7:77Yt4aM8BY9g/PCVFSOQBMQ6NtKUUdZ59gijsvdlY3hIgEq4CziHcE9ngV5Wh9PElOg+sL/cls2rWgTrnNukcIE9o7ICYosYSEA9+BwarilnDnH/M2BbijoeHPFNum0ary/9VVXVN2qNWYaJOzshuzaK20cVcie597V5eOxd30KSHP3FbjLeMArlcHUnjxZZFABd3N4YNrx/Bm+F7gIYpu4KsjIDOMZ25WxvW7cLCjbox/UgQRsV6XEaJVvV3Z50 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2018 09:45:27.4284 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b7a15fa8-cca1-4c66-7e17-08d5e192dfe0 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4PR04MB0765 Subject: [dpdk-dev] [PATCH v2 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: , X-List-Received-Date: Wed, 04 Jul 2018 09:45:29 -0000 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(-) 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 -- 2.7.4