From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0061.outbound.protection.outlook.com [104.47.34.61]) by dpdk.org (Postfix) with ESMTP id A9B691B204 for ; Sat, 9 Sep 2017 13:11:04 +0200 (CEST) Received: from CY1PR03CA0025.namprd03.prod.outlook.com (10.174.128.35) by MWHPR03MB3327.namprd03.prod.outlook.com (10.174.249.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.35.12; Sat, 9 Sep 2017 11:11:03 +0000 Received: from BN1BFFO11FD047.protection.gbl (2a01:111:f400:7c10::1:199) by CY1PR03CA0025.outlook.office365.com (2603:10b6:600::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.35.12 via Frontend Transport; Sat, 9 Sep 2017 11:11:03 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; 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 BN1BFFO11FD047.mail.protection.outlook.com (10.58.145.2) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1385.11 via Frontend Transport; Sat, 9 Sep 2017 11:11:01 +0000 Received: from Tophie.ap.freescale.net ([10.232.14.39]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v89BAUhF026326; Sat, 9 Sep 2017 04:10:59 -0700 From: Shreyansh Jain To: CC: , Date: Sat, 9 Sep 2017 16:51:06 +0530 Message-ID: <20170909112132.13936-16-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170909112132.13936-1-shreyansh.jain@nxp.com> References: <20170823141213.25476-1-shreyansh.jain@nxp.com> <20170909112132.13936-1-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131494290626329796; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39380400002)(39860400002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(1076002)(110136004)(33646002)(68736007)(2906002)(189998001)(54906002)(356003)(305945005)(48376002)(50466002)(76176999)(50986999)(5003940100001)(86362001)(36756003)(50226002)(53936002)(8936002)(81166006)(81156014)(8676002)(104016004)(77096006)(47776003)(5660300001)(498600001)(2351001)(4326008)(6666003)(2950100002)(6916009)(85426001)(105606002)(106466001)(8656003)(97736004); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB3327; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD047; 1:s4snDTMFA4QJCxOlCOSoiXdqeA2EG83NdRJvOaqKLXRAh6ZXW6bqHMsK6//3LFyF1zfhnOQBllAxt4QHfczL5SMXXvyx1tP1LfmAA+0HbiOfm6ReHpE6PNVNF6F9bse8 MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e7944719-ab87-40cc-db65-08d4f773753a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(300000503095)(300135400095)(2017052603199)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:MWHPR03MB3327; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB3327; 3:eaSvdY8Rtvb+1Fi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mfznM1q2XGM1/kTWqN3ivXj0/oV02gEUBz4UItUaYngG8J9qgoFfTq9dZfQzpX1TKxXXlQkjJCkl/VOTrFD6CRQSWQ25PuZZwy911VtyzlFKP6FRUlfqHQ9vbbaYSaolS85TMltb2ioDUA/OtPw1As+tbRnOoomxjP0Hi94ldN+4wT06gJBX4Q4gsGd0ldG4FQQcC0AYbvblbSoK8YdqA6nQ= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(6055026)(6096035)(20161123559100)(20161123563025)(20161123561025)(20161123565025)(20161123556025)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR03MB3327; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR03MB3327; X-Forefront-PRVS: 0425A67DEF X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR03MB3327; 23:4YQfWznntB2aNy9dTVLLsvaWccDGIJuBc9hFjDJuR?= =?us-ascii?Q?VJj27yAHKEGclr7dGGZW9FnwCnVFVVJhtbRireFx4dsx1wo5t3ZRGIFF5Zp9?= =?us-ascii?Q?5zYocGhZBWKhhvQ6BwpglpHlDR6fdzW5TM1kmLt+z0qGI+SzG+5NMUwKzJY3?= =?us-ascii?Q?tCNIeFnJnwJCjimrlieQ+5GwgdEfJv9qv+xaT77r4E+6zM9LmcfZlYfsmyXl?= =?us-ascii?Q?YYaielo29xp/0mfY8G0puld3S5fxM7qGoZas6A6p3KcNe+/9YLUBWzb4+2ZU?= =?us-ascii?Q?vhkmxxAI047c7wbGMX68X8rphzEe6YhPPj2P2NmnMQLCk9EzgGHP5WCtaJOv?= =?us-ascii?Q?vewOTFkB29e5O4kpQieCRtfK2THkmuOmSBfU5HxiLaO50nFs+5PnIvNS2stO?= =?us-ascii?Q?wwK7YFpK7Qm2/GUOioXrjPjRdFyQGL+fv0UO2XEy+o+PXYDemwcQkq08Lxj0?= =?us-ascii?Q?xNsWTQd567UmmHeLJLxQ2N7dYQvnxsd2EIT420qXwbZjUwQm2UMCnXxGss9E?= =?us-ascii?Q?8BkoKWmcWeqBEkBhIdDU74pn8/9elHVoE8lfYTNttd9biixUvFRC6tnvV8NE?= =?us-ascii?Q?30zS6obcNAenKj+3c3tIbSMvVICarSVgzf2ITxuAU5P2z3kdB01MlewmuuKR?= =?us-ascii?Q?OfvA8UYqrWpfFZDw2BymlDmuUQ9oBPH0wweKMSceEywASqn/f5PhSKmcm3bO?= =?us-ascii?Q?jg0fxl+WWoKWkGgJcL64uSr9asq+XpmWsi390H0OzR9KJxMnne0W/w6jq22l?= =?us-ascii?Q?gm/j/3hZe/0KgFPuSZ3UjuXafYsWH7TWkxYZduaclfIOhp6X/U/aMn2wdkNc?= =?us-ascii?Q?3XWONt6kCFbEueG7MnbVft7Tvsrh7p/8rUI7jBa8pgnVPjo2IysM0eoaOsE3?= =?us-ascii?Q?tYxSTxp59psUWKyAXoZvHJ2TRDVScXcTaWvLSU7VvmeXm++OaS0563GFfnOf?= =?us-ascii?Q?/zJdXc1klvM+6fjbWZ5eMOzP0oKn4VmlSxESAm/7wRixKFglmlRwvq7d+6cm?= =?us-ascii?Q?6Uy4hXbVl50X6lrHTJ7j/QsRgheg3yfORe0FmMdgtNpuRD9wbJnfNwQgcbvX?= =?us-ascii?Q?ZM6jg6hjRCtVoI5udtLDi6Vbc4sx8t5IVULHlMBbNXYmNqbpgCnpHqqqDdsj?= =?us-ascii?Q?YIX6lu9pbaRem2yxXFehhJ9eRuqj243?= X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB3327; 6:FAo3Yx7z+ZyrI37eSnyuE/Qul9uwph1GnLCQQcP6GRYSHzFmnzMH5whCmAqBD6tQYbXWUKfvGLVmr7C4dS1NLjSp+QUnFikg81i+GfFgS8afcFh7CBSE2+a2+kg4/x/6jCGhFMXebzifoPiZW53ruFVz+nDq3hwO+hlmNM4o7KOtXfoufMe0mszjEF8N+9OP0DX0AUmQZCBZN9DkCnPo0OkkR/c3kwVqpYaT7ouVAAW19RsAW1hK6N/eSU3fuI3wHCSGRwE27xFZoMwvdfEceCxIA7tZ/Jqr75FAudx5R2QomZXgQK9qh7nTE5aKZZ7/YT6A5oCrqyZvQJh63UF+ZA==; 5:dYE8mwC8rA8/As6/6Uf9FDEOwXIdXO0AyGE/rIbRNzy+5e3hsJuo96HH7QdhC2STZOERREgy+ZKBhMaAVvGN6DwTejeEmaKQWA6uEOEbUKsTNeesrKAIZ7puRA1JRaxbMvZ3v0Zj6AjPFKoCQf+pUA==; 24:b4rYmfdGUYal/vQHSqZNVyhqS9FfWhZxvcs3W6WE76UmaXtmK52Z7qxfesvzy9gFHRaOqt67MXPaS8d0eKJseKuwbwcoxD5UcnvTA/bBvTw=; 7:d/K/5KNwzW8POWBmn7ElyTo6UwHboMpiWXs7BkQaj1ExOFMUPR/WcRYVwjP958IVEOtbQ1zUMki4dw777qoYS1tRt79fxYNSo2hGXij+OXtoBl7fIrRBsBAax5xjbMHImmR+/Xt0eUjnjeH8Z/Qp1dr3k6LR8EBkG8Rhs2RkgmNT/W2T/QQSKX4txnl6dQ+jPbp7ccMks7mVi7GRFQ4Av9ntp+KOz5eU16Hp80yBvxg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Sep 2017 11:11:01.4161 (UTC) 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: MWHPR03MB3327 Subject: [dpdk-dev] [PATCH v4 15/41] bus/dpaa: add fman flow control threshold setting 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: Sat, 09 Sep 2017 11:11:05 -0000 Signed-off-by: Geoff Thorpe Signed-off-by: Roy Pledge Signed-off-by: Hemant Agrawal Signed-off-by: Shreyansh Jain --- drivers/bus/dpaa/base/fman/fman_hw.c | 28 ++++++++++++++++++++++++++++ drivers/bus/dpaa/include/fsl_fman.h | 7 +++++++ 2 files changed, 35 insertions(+) diff --git a/drivers/bus/dpaa/base/fman/fman_hw.c b/drivers/bus/dpaa/base/fman/fman_hw.c index a7ca661..077c17c 100644 --- a/drivers/bus/dpaa/base/fman/fman_hw.c +++ b/drivers/bus/dpaa/base/fman/fman_hw.c @@ -37,6 +37,7 @@ */ #include #include +#include /* Instantiate the global variable that the inline CRC64 implementation (in * ) depends on. @@ -393,6 +394,33 @@ fman_if_set_bp(struct fman_if *fm_if, unsigned num __always_unused, } int +fman_if_get_fc_threshold(struct fman_if *fm_if) +{ + struct __fman_if *__if = container_of(fm_if, struct __fman_if, __if); + unsigned int *fmbm_mpd; + + assert(fman_ccsr_map_fd != -1); + + fmbm_mpd = &((struct rx_bmi_regs *)__if->bmi_map)->fmbm_mpd; + return in_be32(fmbm_mpd); +} + +int +fman_if_set_fc_threshold(struct fman_if *fm_if, u32 high_water, + u32 low_water, u32 bpid) +{ + struct __fman_if *__if = container_of(fm_if, struct __fman_if, __if); + unsigned int *fmbm_mpd; + + assert(fman_ccsr_map_fd != -1); + + fmbm_mpd = &((struct rx_bmi_regs *)__if->bmi_map)->fmbm_mpd; + out_be32(fmbm_mpd, FMAN_ENABLE_BPOOL_DEPLETION); + return bm_pool_set_hw_threshold(bpid, low_water, high_water); + +} + +int fman_if_get_fc_quanta(struct fman_if *fm_if) { struct __fman_if *__if = container_of(fm_if, struct __fman_if, __if); diff --git a/drivers/bus/dpaa/include/fsl_fman.h b/drivers/bus/dpaa/include/fsl_fman.h index ac38082..95aee67 100644 --- a/drivers/bus/dpaa/include/fsl_fman.h +++ b/drivers/bus/dpaa/include/fsl_fman.h @@ -112,6 +112,13 @@ void fman_if_loopback_disable(struct fman_if *p); void fman_if_set_bp(struct fman_if *fm_if, unsigned int num, int bpid, size_t bufsize); +/* Get Flow Control threshold parameters on specific interface */ +int fman_if_get_fc_threshold(struct fman_if *fm_if); + +/* Enable and Set Flow Control threshold parameters on specific interface */ +int fman_if_set_fc_threshold(struct fman_if *fm_if, + u32 high_water, u32 low_water, u32 bpid); + /* Get Flow Control pause quanta on specific interface */ int fman_if_get_fc_quanta(struct fman_if *fm_if); -- 2.9.3