From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0082.outbound.protection.outlook.com [104.47.41.82]) by dpdk.org (Postfix) with ESMTP id B65D11B1C6 for ; Wed, 10 Jan 2018 11:48:29 +0100 (CET) Received: from DM5PR03CA0050.namprd03.prod.outlook.com (10.174.189.167) by CY1PR03MB2362.namprd03.prod.outlook.com (10.166.207.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.366.8; Wed, 10 Jan 2018 10:48:28 +0000 Received: from BL2FFO11FD012.protection.gbl (2a01:111:f400:7c09::126) by DM5PR03CA0050.outlook.office365.com (2603:10b6:4:3b::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.386.5 via Frontend Transport; Wed, 10 Jan 2018 10:48:28 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; NXP1.onmicrosoft.com; dkim=none (message not signed) header.d=none;NXP1.onmicrosoft.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 BL2FFO11FD012.mail.protection.outlook.com (10.173.161.18) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Wed, 10 Jan 2018 10:47:56 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id w0AAljSZ007124; Wed, 10 Jan 2018 03:48:25 -0700 From: Hemant Agrawal To: CC: , , Sunil Kumar Kori Date: Wed, 10 Jan 2018 16:16:39 +0530 Message-ID: <1515581201-29784-18-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515581201-29784-1-git-send-email-hemant.agrawal@nxp.com> References: <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> <1515581201-29784-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131600548769449194; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(376002)(39380400002)(39860400002)(396003)(346002)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(105606002)(316002)(296002)(77096006)(104016004)(6666003)(2351001)(2950100002)(6916009)(5660300001)(50466002)(97736004)(48376002)(106466001)(86362001)(50226002)(8936002)(8676002)(68736007)(305945005)(356003)(47776003)(54906003)(81166006)(16586007)(2906002)(81156014)(36756003)(8656006)(498600001)(51416003)(53936002)(85426001)(59450400001)(4326008)(76176011); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB2362; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD012; 1:nuzXN/nSua0s/yj2tYCaFnK5N6FePFBBA0Z75ckcu3dJ5AUybCyPiABJVMMmVFjZGYg0MvybTcE97U9YM5gkqZnKUt5xVDHxP4HzM/DpjAm7TCVU4WkW5GfSn9kIs+vp MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9bf88683-a1d2-43d8-44ea-08d558179c1d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:CY1PR03MB2362; X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2362; 3:o43Hs6mtj6bTeyOqW76/r7G2muoBEf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OQXVbecwHMeI68K+y4rOjAAsruZ8JS7QzXv1Gdr18zFVr3sR0GrGLgyYvYFUiw+K1S8SZ/Xan6YtooE7A+u2QxGukxo+FsvReSughVSLiC3E+mxy1yvQIHSxAYEt85vFNyEhAlwO+MQfcxd4Qf8tWtvOeQnPWK88B9LiGv8hL083JXbRkujSslR0wbDWMeJIe8ytOf/bL0wVudb2VkupmV3+w0 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(10201501046)(3002001)(3231023)(944510075)(944921075)(946801075)(946901075)(93006095)(93001095)(6055026)(6096035)(20161123561025)(20161123556025)(201703131430075)(201703131520075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123559100)(20161123563025)(20161123565025)(201708071742011); SRVR:CY1PR03MB2362; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:CY1PR03MB2362; X-Forefront-PRVS: 0548586081 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR03MB2362; 23:5cwUGIxPEqOSxCGppuvC8e3EnQ8VjkF5E1d9zAVQl?= =?us-ascii?Q?ILv7f1EUHiPCHmXdulvFT/FfVG0uTzKTa13wjqs6pRw7YGC3svT4HwHosIko?= =?us-ascii?Q?O9A9HnoBrsMrSRyCUg3YUJH9Dd8nIxjOVP9dQZLFlS4IKhKHS606Gg8fIum8?= =?us-ascii?Q?HZTMg4BibNFXQ5E2SQKByLzTYIYnV4LqN853Q8FOM77O4zG5OqwSgFyhZjHE?= =?us-ascii?Q?awO5LX1m8CLJiI23vNkFledzKPkHBMYkYQ7qe/xEhqKerQV3kTjqjvuqpYGN?= =?us-ascii?Q?h8FtDceb6hOw8MWroAPD3UndP420R9/huNUSDgjun60SAd6ZXsDkOXkAnzZk?= =?us-ascii?Q?AK7TxVeHTZ4dOmu+1jB4ntlI0G91n94Lk2ggNyX4L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9uarl0NyILUB8YjfaGCQEoNfDjqP7E+XnPo7P5Yugu7DVmxKDauhczMUQ7FtL8AJ7UHTv1qQPUi2msilc0pcNeRDYoLb4kiqttq+1UTm3EpBX23cNAO5kh2LD7rWD5Xbpe6rmP+wopUuMxnMIbLSc6A1oJYxJyTUwptaWzbYkI6TWkcQzOCcmdRUWZa4hgHhKuuChlKKiKmbSfvHZ9jwjmF2++HQPI0HSVlz7jrRM8LK78jHuDHVNcsemYSxkYbI=; 5:l6DzthysF32iQGV/OskPEGQ28tOwjEsr1Pa2dZY8ISSXiEDO/GCAkXKqnypKgWhFkMGm+NL34Sc7HNUcabLVdHp/O4g0oUipFKENvCp8u3C7g2SYr60Dx45TY5XLJyr8zCCQNCzDl5EPtyS6LpIwLzhDvMsi3UhQy+h8xum04+s=; 24:TI2x8vd2vVFgaKMBugG9kr1bFlcn9Cro8aKrKI8NgUopAL3GunNNhRavnVEXFgZwihcBFGAu3cu/vnS9oYAeTnQBAymXVK4LOaSZTmcqp7w=; 7:OgeBekZ+wp3vVQvWZVQBdrz14Mfg3zdtWddg0SwoitYnOZDv8qSPoF+4hxZzUH384AWSTpM0jpWbumcrthGceSESFrwFdA/tLmkzCNoskA+xMgIuNQ7GXP93xjU8JSsyZ9KW3fl8K99sFlbg6yChPhsExxD1Kx6LiiMtsN7UuaBDXvNh17jWRle4KbvH5f3tJYS+kuKgEv9G3hdNoxBDWJ4n1uAFPjdPlo0mqq7AnER/evaWVkdydZuUQotkP/gA SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2018 10:47:56.7733 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9bf88683-a1d2-43d8-44ea-08d558179c1d 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: CY1PR03MB2362 Subject: [dpdk-dev] [PATCH v3 17/19] bus/dpaa: add support for static queues 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, 10 Jan 2018 10:48:30 -0000 DPAA hardware support two kinds of queues: 1. Pull mode queue - where one needs to regularly pull the packets. 2. Push mode queue - where the hw pushes the packet to queue. These are high performance queues, but limited in number. This patch add the driver support for push mode queues. Signed-off-by: Sunil Kumar Kori Signed-off-by: Hemant Agrawal --- drivers/bus/dpaa/base/qbman/qman.c | 64 +++++++++++++++++++++++++++++++ drivers/bus/dpaa/base/qbman/qman.h | 4 +- drivers/bus/dpaa/include/fsl_qman.h | 14 ++++++- drivers/bus/dpaa/rte_bus_dpaa_version.map | 4 ++ 4 files changed, 83 insertions(+), 3 deletions(-) diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c index ffb008e..7e285a5 100644 --- a/drivers/bus/dpaa/base/qbman/qman.c +++ b/drivers/bus/dpaa/base/qbman/qman.c @@ -1051,6 +1051,70 @@ u16 qman_affine_channel(int cpu) return affine_channels[cpu]; } +unsigned int qman_portal_poll_rx(unsigned int poll_limit, + void **bufs, + struct qman_portal *p) +{ + const struct qm_dqrr_entry *dq; + struct qman_fq *fq; + enum qman_cb_dqrr_result res; + unsigned int limit = 0; +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ + struct qm_dqrr_entry *shadow; +#endif + unsigned int rx_number = 0; + + do { + qm_dqrr_pvb_update(&p->p); + dq = qm_dqrr_current(&p->p); + if (unlikely(!dq)) + break; +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ + /* If running on an LE system the fields of the + * dequeue entry must be swapper. Because the + * QMan HW will ignore writes the DQRR entry is + * copied and the index stored within the copy + */ + shadow = &p->shadow_dqrr[DQRR_PTR2IDX(dq)]; + *shadow = *dq; + dq = shadow; + shadow->fqid = be32_to_cpu(shadow->fqid); + shadow->contextB = be32_to_cpu(shadow->contextB); + shadow->seqnum = be16_to_cpu(shadow->seqnum); + hw_fd_to_cpu(&shadow->fd); +#endif + + /* SDQCR: context_b points to the FQ */ +#ifdef CONFIG_FSL_QMAN_FQ_LOOKUP + fq = get_fq_table_entry(dq->contextB); +#else + fq = (void *)(uintptr_t)dq->contextB; +#endif + /* Now let the callback do its stuff */ + res = fq->cb.dqrr_dpdk_cb(NULL, p, fq, dq, &bufs[rx_number]); + rx_number++; + /* Interpret 'dq' from a driver perspective. */ + /* + * Parking isn't possible unless HELDACTIVE was set. NB, + * FORCEELIGIBLE implies HELDACTIVE, so we only need to + * check for HELDACTIVE to cover both. + */ + DPAA_ASSERT((dq->stat & QM_DQRR_STAT_FQ_HELDACTIVE) || + (res != qman_cb_dqrr_park)); + qm_dqrr_cdc_consume_1ptr(&p->p, dq, res == qman_cb_dqrr_park); + /* Move forward */ + qm_dqrr_next(&p->p); + /* + * Entry processed and consumed, increment our counter. The + * callback can request that we exit after consuming the + * entry, and we also exit if we reach our processing limit, + * so loop back only if neither of these conditions is met. + */ + } while (likely(++limit < poll_limit)); + + return limit; +} + struct qm_dqrr_entry *qman_dequeue(struct qman_fq *fq) { struct qman_portal *p = get_affine_portal(); diff --git a/drivers/bus/dpaa/base/qbman/qman.h b/drivers/bus/dpaa/base/qbman/qman.h index a433369..4346d86 100644 --- a/drivers/bus/dpaa/base/qbman/qman.h +++ b/drivers/bus/dpaa/base/qbman/qman.h @@ -154,7 +154,7 @@ struct qm_eqcr { }; struct qm_dqrr { - const struct qm_dqrr_entry *ring, *cursor; + struct qm_dqrr_entry *ring, *cursor; u8 pi, ci, fill, ithresh, vbit; #ifdef RTE_LIBRTE_DPAA_HWDEBUG enum qm_dqrr_dmode dmode; @@ -441,7 +441,7 @@ static inline u8 DQRR_PTR2IDX(const struct qm_dqrr_entry *e) return ((uintptr_t)e >> 6) & (QM_DQRR_SIZE - 1); } -static inline const struct qm_dqrr_entry *DQRR_INC( +static inline struct qm_dqrr_entry *DQRR_INC( const struct qm_dqrr_entry *e) { return DQRR_CARRYCLEAR(e + 1); diff --git a/drivers/bus/dpaa/include/fsl_qman.h b/drivers/bus/dpaa/include/fsl_qman.h index d769d50..ad40d80 100644 --- a/drivers/bus/dpaa/include/fsl_qman.h +++ b/drivers/bus/dpaa/include/fsl_qman.h @@ -1124,6 +1124,12 @@ typedef enum qman_cb_dqrr_result (*qman_cb_dqrr)(struct qman_portal *qm, struct qman_fq *fq, const struct qm_dqrr_entry *dqrr); +typedef enum qman_cb_dqrr_result (*qman_dpdk_cb_dqrr)(void *event, + struct qman_portal *qm, + struct qman_fq *fq, + const struct qm_dqrr_entry *dqrr, + void **bd); + /* * This callback type is used when handling ERNs, FQRNs and FQRLs via MR. They * are always consumed after the callback returns. @@ -1182,7 +1188,10 @@ enum qman_fq_state { */ struct qman_fq_cb { - qman_cb_dqrr dqrr; /* for dequeued frames */ + union { /* for dequeued frames */ + qman_dpdk_cb_dqrr dqrr_dpdk_cb; + qman_cb_dqrr dqrr; + }; qman_cb_mr ern; /* for s/w ERNs */ qman_cb_mr fqs; /* frame-queue state changes*/ }; @@ -1299,6 +1308,9 @@ int qman_get_portal_index(void); */ u16 qman_affine_channel(int cpu); +unsigned int qman_portal_poll_rx(unsigned int poll_limit, + void **bufs, struct qman_portal *q); + /** * qman_set_vdq - Issue a volatile dequeue command * @fq: Frame Queue on which the volatile dequeue command is issued diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map index 212c75f..ac455cd 100644 --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map @@ -70,11 +70,15 @@ DPDK_18.02 { dpaa_svr_family; qman_alloc_cgrid_range; + qman_alloc_pool_range; qman_create_cgr; qman_delete_cgr; qman_modify_cgr; + qman_oos_fq; + qman_portal_poll_rx; qman_query_fq_frm_cnt; qman_release_cgrid_range; + qman_retire_fq; rte_dpaa_portal_fq_close; rte_dpaa_portal_fq_init; -- 2.7.4