From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0072.outbound.protection.outlook.com [104.47.34.72]) by dpdk.org (Postfix) with ESMTP id DC1DA914D for ; Wed, 23 Aug 2017 16:02:59 +0200 (CEST) Received: from CY4PR03CA0016.namprd03.prod.outlook.com (10.168.162.26) by MWHPR03MB3328.namprd03.prod.outlook.com (10.174.249.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1362.18; Wed, 23 Aug 2017 14:02:58 +0000 Received: from BY2FFO11FD046.protection.gbl (2a01:111:f400:7c0c::184) by CY4PR03CA0016.outlook.office365.com (2603:10b6:903:33::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1362.18 via Frontend Transport; Wed, 23 Aug 2017 14:02:58 +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 BY2FFO11FD046.mail.protection.outlook.com (10.1.15.170) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15 via Frontend Transport; Wed, 23 Aug 2017 14:02:57 +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 v7NE2Q31004389; Wed, 23 Aug 2017 07:02:55 -0700 From: Shreyansh Jain To: CC: , Date: Wed, 23 Aug 2017 19:41:48 +0530 Message-ID: <20170823141213.25476-16-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170823141213.25476-1-shreyansh.jain@nxp.com> References: <1499179471-19145-1-git-send-email-shreyansh.jain@nxp.com> <20170823141213.25476-1-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131479705780953907; (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)(39860400002)(39380400002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(2906002)(6666003)(50986999)(76176999)(106466001)(189998001)(97736004)(47776003)(5003940100001)(104016004)(54906002)(81166006)(305945005)(8656003)(68736007)(110136004)(8936002)(81156014)(50226002)(50466002)(48376002)(1076002)(33646002)(356003)(2351001)(5660300001)(53936002)(86362001)(498600001)(77096006)(85426001)(36756003)(626005)(6916009)(2950100002)(4326008)(105606002)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB3328; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD046; 1:htP+KgPkEjQbGKCRe1cwhbYaJN8ZKB06xuytFxo/ukZHAMdo9v+TnJHvPTct939c1SpWangmMQX7GRTyrRcy2eSo04jJNjmBBhfGTDdl55nogqCHSjTpVagrZC58R447 MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9c7540a2-a633-4e40-c1d4-08d4ea2fa8b3 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(300000503095)(300135400095)(2017052603185)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:MWHPR03MB3328; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB3328; 3:6TeAWWy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ckcZhK/RoOjw92nCs+ovzFGGWAqqFdaXLU32N4wDeBBKHDhXQxZZ7HQPVoP+NxFby5qGxzaOq4DUeL6ZRdd+/sGw3UwpC+XYXIe7mEESKu/YKV48kQfKqWJ3ja1AEnbMuyZ5a3QurZcdrQ2x8EftTVtS1pzDDJGQqW8gv0e86cVdGnBbPK1x01i7YR6lHc5BMETK9jeel1aAEDvome9VSQDyAaLOk5vRTB2A= 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)(601004)(2401047)(13016025)(13018025)(5005006)(8121501046)(3002001)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(6055026)(6096035)(20161123561025)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123556025)(20161123565025)(20161123559100)(20161123563025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR03MB3328; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR03MB3328; X-Forefront-PRVS: 040866B734 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR03MB3328; 23:cb73UklLMBOIFjCh/4jHKQHzv8wH4rglUMUH8Fx7H?= =?us-ascii?Q?p559QQB8e5+YmSt0Q2c9i7cqP2H9FK8BDYiW3behiMbn6FVLLFP/qaxislm9?= =?us-ascii?Q?clYLhfAiSxXNmGiZHmVZCK3NpBUReMgYHv5fqWkmMP7y/9vEhqRUeSab0qwn?= =?us-ascii?Q?2txDaBPYjG0VeJGXvGJaUCSArHXxOBXLRK5iOA6qfgnBoVN0QNyrUkw25y9E?= =?us-ascii?Q?t4925rT1a6/NG1gmlMfIVOFuCVgXX8mFyc3KfQLWn7vyxCVHXj2nh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Cb76ESxY32u?= X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB3328; 6:/tOvrAKsds4Px6JBSOtfLNaavy42cdjwGuEVy0+lPD7rJ4orwvnXlC6wR2xmYqSj/NJKPU6Bs2rP8qkgvElhdFedGBcQ1MQSV3iMPKdF5tErDzM0c2GefZ0q7NaPt5ObzCJPYeKaen4uiaZovKedczEqCHl9B719xXWGyUp8GaomEwsfqo4PyKV6JejpUtIhnbgEj69YYDJLmsUJhut81JyaVeuPyHaimXbS0ivRMzJtQbeIbfPqYXeFqfdoBVCvHKc+vC/8eLT4JSAAHDyZ3VbRHDPvQ6z1VBMBdXQzdUAoD726rOJHO9hEqo6d90vpdwPzNRQ+IgAjup0NN/mRPg==; 5:RWJY41HM8mxpl6Sx2wugyLXeIWLv+yZrcyuvbmD10xNN/me6sOiO7b+0zQVYqMqFt9Ihf/MkhDPyD+SB+jKhGa3NAycVVG2CkfeAsTZggytJUdEFFO0BVgLzJYcetdwZ9E6zNVbatIG2wm66jt9nkg==; 24:8P9AbhLiuxvFfeFuGxX36ctSMbjTcEHPvbDSUNPel7LOecFP+zsoaQJG4+79Vrg8/kD08PUFYpjXjqo0Bwsi1YEcOvDm3m6flr2jjEDz8bk=; 7:FmwHTllCAC+UFrdWkOVjfn52dFS1OgyadlI3kTjAuvT0CbCmKwTRIOp2DnozVXmPXxxaaAVfPppnowcl2LkVNBA4U03hN0Jkpq/CSHcXMdNLeTEww6BsVCQH2jEyRadhTiNEe3coK4xhi1grozjiks21eRO4wjBEybSJp5EEPhvYweUnxDkXy0YSsTZaPE+tu321Y+2E/gTjeIkBfJqPmdafW7OHL7Mm/5LhnFNgmas= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2017 14:02:57.8925 (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: MWHPR03MB3328 Subject: [dpdk-dev] [PATCH v3 15/40] 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: Wed, 23 Aug 2017 14:03:00 -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 77908ec..7618fc1 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. @@ -437,6 +438,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 0aff22c..b94bc56 100644 --- a/drivers/bus/dpaa/include/fsl_fman.h +++ b/drivers/bus/dpaa/include/fsl_fman.h @@ -120,6 +120,13 @@ void fman_if_loopback_disable(struct fman_if *); 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