From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0062.outbound.protection.outlook.com [104.47.37.62]) by dpdk.org (Postfix) with ESMTP id 5451E1B1B6 for ; Thu, 28 Sep 2017 14:19:40 +0200 (CEST) Received: from BN6PR03CA0067.namprd03.prod.outlook.com (10.173.137.29) by BN6PR03MB2689.namprd03.prod.outlook.com (10.173.144.8) 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 12:19:39 +0000 Received: from BY2FFO11OLC010.protection.gbl (2a01:111:f400:7c0c::190) by BN6PR03CA0067.outlook.office365.com (2603:10b6:404:4c::29) 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 12:19:38 +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 BY2FFO11OLC010.mail.protection.outlook.com (10.1.15.21) 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 12:19:38 +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 v8SCJ728008785; Thu, 28 Sep 2017 05:19:36 -0700 From: Shreyansh Jain To: CC: , Date: Thu, 28 Sep 2017 17:59:35 +0530 Message-ID: <20170928123000.1711-16-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170928123000.1711-1-shreyansh.jain@nxp.com> References: <20170928113344.12248-1-shreyansh.jain@nxp.com> <20170928123000.1711-1-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131510747789126813; (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)(7966004)(39860400002)(39380400002)(346002)(376002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(1076002)(104016004)(33646002)(50986999)(498600001)(76176999)(356003)(50226002)(8936002)(81166006)(81156014)(4326008)(8676002)(2906002)(53936002)(305945005)(316002)(36756003)(97736004)(5660300001)(189998001)(54906003)(5003940100001)(86362001)(47776003)(48376002)(50466002)(2950100002)(6916009)(85426001)(77096006)(16586007)(8656003)(106466001)(2351001)(105606002)(68736007); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB2689; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11OLC010; 1:o7MM6Ss853UKg+Vutp5S6H0Z5az5LwU0qOObnXOVE+OR43G3dZoMEQE8KFUoMyf50vgjRUN8FWgLIDgj7I6MXGNuvazL4EFg2c/mp0wAWvuwcoV+68fQtdODb56nRvQP MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 657870b1-bbd0-49c9-ec9d-08d5066b3094 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017052603199)(201703131430075)(201703131517081); SRVR:BN6PR03MB2689; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2689; 3:tKABAsYiWomt7Q09YWZmEDK/nam+koxY1SQgqjQiogvj5eArh/HaCLzZd5eJ9ZIrvZLlkvxhJ2gmNbvG7Bkwvp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HBe8GdOpvRPNGQYR5On5Ih3H/gRuT8apIVFC2mMz7fYBGHPRJP18wvW03k7a3ITV8qbIuyvqKQoOkj7m5flvDDsFgaHSKaiJqDKlB/+pgXnUJjehN8AtG0JcL+jPb4GbU4pE9NyeRKKlISdQuhjwDbb+ISTwHCPW84= 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)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(100000703101)(100105400095)(6055026)(6096035)(20161123561025)(20161123565025)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(20161123559100)(20161123556025)(20161123563025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR03MB2689; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR03MB2689; X-Forefront-PRVS: 0444EB1997 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR03MB2689; 23:bwvqWJbg+9aOGv0Peq2M3seNnw7taHgTX16UCo5UZ?= =?us-ascii?Q?95Oh7VjP+r4IHfbz1RnjCCa/PCqiB+MgccsOyk2x44Xh5dPypVYqgSfS9ARt?= =?us-ascii?Q?35CaGv5hxregORyg/os9RheNr+UuG5k21ZmpjemTxofHDPyTWaryBJc7y/SJ?= =?us-ascii?Q?jbtqJGG51DNiKWTcJtNkjcIo/N6ZsTBf+9jSCPBB9XfS8309csdqB7f5SqbU?= =?us-ascii?Q?MaOEWBy/Npq82IcniwgCYv2UiLjeOt0bh3TmV6rv6MtCpybFlpj5H2Vg53P7?= =?us-ascii?Q?EDdoZWAKJtyJ76ja7vxPGQ7mWz+dQpuJGchVpo7ydB3k42PePqfilP2hWvt+?= =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microsoft-Exchange-Diagnostics: 1; BN6PR03MB2689; 6:z+TC1Ahnyr3Ff8cJox3LcVNUkzOkf5upjX2KFqV3NizyomxivBpHUAbnRhv7pdCx36cmBDTB1JgqDpYZAM7F2PHWEdIi781h46ONMQNtv5GcCPJq+AtoV/2/u1nuBK4+nsnYjB81d4as+1KhEPjRwxRUgyKEk1vRy5IROPyEfx9p4BvN+dpqsnbb8ov95WTnjwYGfqCvcq/X0TTPCFPkpKs6H3E65QGkisqyODRjZu8IUw3Pk4Lrgrw/kmu35Dp69S5kM5zRwnuwrGckxSDDRhvM46W9VzSM1Erq40NDB1hr7dtaXlmWNcsB/N0aIk3oiILROXbKNKAaJgVx0L8mNQ==; 5:Ll5cIG9hHKLPEwpH3laIEwu4xuq3CZDqCkpJr3aCdR2PL1AhgDM8ZgJGCWctfatacPJklTnR2m4j7zvzS5nCQPeaSRp9Txo3KbFvAaHtuYMY3Yqkl2z4oxA//VyGw6m//xagVp0cwgC88NjH63h+oA==; 24:RlkAI02lsBGKczVM292b2WaXNYywgMGsnmvMB6e5UC4Qy4pjKpmCKwmmGzL1/fLuEEjSBGQNCi1xmwTu13PjNPywlLoM07mA+NlZaGVJARU=; 7:GD8cP/jvNDA7YStH9xDEAxygbq/NJTF/vUnHQ++QG8QbkFf+NsXyM0/AEyJD3VZw9T3jeNq7Ur8IWwbmw1Ek/XP0EGHKNhzyjiIUdrTm7XKbqgVpc5otpAg8wEejiOSBWsDOUgrs+Eai4bjsYTyyycBBTLvhvt8xN/88Ndqz/r9kjDBVqkPAV5+XsmD29szvI59cyjqj8cUyfADDp0As5/P29V+ErLRYdzFiecfi/Lk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2017 12:19:38.7254 (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: BN6PR03MB2689 Subject: [dpdk-dev] [PATCH v6 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 12:19:42 -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