From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0079.outbound.protection.outlook.com [104.47.38.79]) by dpdk.org (Postfix) with ESMTP id 98D6A1B194 for ; Thu, 28 Sep 2017 13:23:30 +0200 (CEST) Received: from DM5PR03CA0054.namprd03.prod.outlook.com (10.174.189.171) by CO2PR03MB2357.namprd03.prod.outlook.com (10.166.93.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 28 Sep 2017 11:23:29 +0000 Received: from BY2FFO11FD034.protection.gbl (2a01:111:f400:7c0c::191) by DM5PR03CA0054.outlook.office365.com (2603:10b6:4:3b::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.11 via Frontend Transport; Thu, 28 Sep 2017 11:23:29 +0000 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 BY2FFO11FD034.mail.protection.outlook.com (10.1.14.219) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.56.11 via Frontend Transport; Thu, 28 Sep 2017 11:23:28 +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 v8SBMpFp016035; Thu, 28 Sep 2017 04:23:26 -0700 From: Shreyansh Jain To: CC: , Date: Thu, 28 Sep 2017 17:03:19 +0530 Message-ID: <20170928113344.12248-16-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170928113344.12248-1-shreyansh.jain@nxp.com> References: <20170909112132.13936-1-shreyansh.jain@nxp.com> <20170928113344.12248-1-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131510714089866007; (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)(346002)(376002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(16586007)(4326008)(5003940100001)(5660300001)(106466001)(6916009)(2950100002)(1076002)(33646002)(105606002)(498600001)(316002)(53936002)(2351001)(104016004)(48376002)(76176999)(50986999)(36756003)(86362001)(47776003)(50226002)(6666003)(50466002)(54906003)(8656003)(81166006)(356003)(305945005)(77096006)(97736004)(189998001)(8936002)(81156014)(68736007)(8676002)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR03MB2357; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD034; 1:HmnP6u5+nTmQAJ2rRpkKXXYN6maqAz8dBwSsFbcZhEbO+pQY8UsqAVSeR21TBGLZduDtvO/Py86QM8ffHvDNm5xpPQZnIkBNYHbJnPRx6gVKCm93ZDHvOieMKNwYbXAq MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e6de29ae-0247-4d67-a1b6-08d5066357f0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017052603199)(201703131430075)(201703131517081); SRVR:CO2PR03MB2357; X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2357; 3:s2MHKzoV5fere2LXXQkWyxiNSU4h71N9SLhSJ2RvvPnFGhY+k0bHWrKjvjOyBIagHt8HIMtLMuUviSQa8hDrY8fqCZkMUL2viPnwTKy1FqXqkheHMB34gtkD58Tmv4mezq5yoXwkFd/eDeI8miRhiSK1yHdu5F8K1C5Yp0cyJmV7ifbdDou+kXUDYjc+/J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xRH1dM3gF/jKhTZMfvdm3eaUzcLy9nrvNjWQb+njH2MyAhMA= 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)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(3002001)(6055026)(6096035)(20161123563025)(20161123559100)(20161123556025)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123561025)(20161123565025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CO2PR03MB2357; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CO2PR03MB2357; X-Forefront-PRVS: 0444EB1997 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO2PR03MB2357; 23:ID/IX6fwEcRYYPdE2LgNT+LbWzBBxdnqF30USD+dh?= =?us-ascii?Q?frcQoz/Z/4dC4sO5jOaaKtCWBClfDT4TTQzUoR2evloSi4D4sydaSyP855kC?= =?us-ascii?Q?XLQInpj6R6cBq+xhfHESw6icap/YY8MR6L3gfjGg2GLTNvihrPC8N7DA6DuA?= =?us-ascii?Q?/O7u0cZe2B52Jk5/O5D2t/bH6CCKOgSQOF+mFIoQzc04QFCJkLntVfEy/TQf?= =?us-ascii?Q?0XXuJAZ+8//0rJ7k05dJ4NnQny/mmdByq6eNxwJGtjjK7UNnmEHkAG011ruE?= =?us-ascii?Q?D94FtEzln1ph4PfcMEtZL9TxuM/fExyKDLp9YknFBQZLsMt2HVx1wq3ExTog?= =?us-ascii?Q?1/k7UE+R4YmVAwVROXpAbXdBZIEPrzSLGPRsFbiH0BNFNbAZcWRXi/l8O0f1?= =?us-ascii?Q?MOixpunv2Sso/2PR+A47L4djv7uE+Ni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WYq9b9P6fwCzwEZmc5olYfOuADlsh6hxt4NR+DD76iZIgE0W4j+F5h74kc1DfJ5NF43vcMmj82SGvNnwv0xQjnZVv3wg5K3uFCofOzPPcScpN3TcWeG9vtbQYQSEaWrGe5oQ/gUb4JK5WSe6p2JtzUaV8DKiFBvRLQ8rpqA2mwc/9+h9o0uBb0/PkCvCqE33WMCoqEeuiMOhFjPn3trYF04t4w+iBjQ8veioA==; 5:3XTzolpUGZtTL/KEhVixfqBcB3zg6aRIxNGys9lRYa6b0pnZf+8QVgy3Z4PYRvm7/EoOA4HmLYEv6+Fl9hIoimGzfj5vnbIxmOSckQlY6M/FT8NplUFSo26N65zRxmZblqjzBAXRxDHQAkK8UF1D9A==; 24:CVKtaCjKf+CsJi/mydjnCdlHNSyURGCwp81uaqPJvwn1YdPibmVXEasAnJwcIq/FpmJQ4FAZwgVZVRM1krpI5xGELms1DFqSwOxmyIAoKmg=; 7:g1z3Ykjopav3+EUnlLsCQSuWp1VjmdIF396hK804QBel8L0oOUQkmdFHp9JoRpEl2coNmhLRaFX1xSU3w9vy69cWPyzzqBvuJoUWbeli+2Tw0UfCB4r70AucoQqtjRKxt2nfDifcm1szIDzI6D/y2W5Mw40qYcatpOipzDiy/+Cka/leldgOoYShwjr+94Tcx4/Ajri3zEHXql1llpPc/Hk9F4+q22/gUrLD+vn2VBY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2017 11:23:28.7837 (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: CO2PR03MB2357 Subject: [dpdk-dev] [PATCH v5 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: Thu, 28 Sep 2017 11:23:31 -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