From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0089.outbound.protection.outlook.com [104.47.42.89]) by dpdk.org (Postfix) with ESMTP id 5F4CC913F for ; Wed, 23 Aug 2017 16:02:56 +0200 (CEST) Received: from CY4PR03CA0087.namprd03.prod.outlook.com (2603:10b6:910:4d::28) by SN2PR03MB2269.namprd03.prod.outlook.com (2603:10b6:804:d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1385.9; Wed, 23 Aug 2017 14:02:55 +0000 Received: from BN1BFFO11FD023.protection.gbl (2a01:111:f400:7c10::1:120) by CY4PR03CA0087.outlook.office365.com (2603:10b6:910:4d::28) 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:54 +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 BN1BFFO11FD023.mail.protection.outlook.com (10.58.144.86) 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:54 +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 v7NE2Q2x004389; Wed, 23 Aug 2017 07:02:52 -0700 From: Shreyansh Jain To: CC: , Date: Wed, 23 Aug 2017 19:41:46 +0530 Message-ID: <20170823141213.25476-14-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: 131479705747744299; (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)(189002)(199003)(6666003)(5660300001)(97736004)(105606002)(8656003)(626005)(68736007)(6916009)(4326008)(2950100002)(36756003)(86362001)(85426001)(2906002)(77096006)(356003)(305945005)(106466001)(53936002)(1076002)(8676002)(81166006)(50986999)(50226002)(76176999)(50466002)(8936002)(81156014)(5003940100001)(48376002)(104016004)(54906002)(2351001)(33646002)(110136004)(498600001)(189998001)(47776003); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR03MB2269; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD023; 1:I1E2cfWub1o1ejlsVkhKj6hmVIZKcGcCbXGwj7ujbJjZEuZT/3JFhQa0crF86xq9T1kXBHW0ppK231nGzzEXZAFmvKIHLCf5qr/dSiGdZvCKzSJm9GO75kXDHRLMvJQI MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cd23d893-0dda-42a3-04cb-08d4ea2fa6b9 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(2017052603185)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:SN2PR03MB2269; X-Microsoft-Exchange-Diagnostics: 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EhowZYHcMywcxuX8A9i6iu/I5lVwjDEcHlkO8RPDvFhaHe/1uNE6aFhCNbgNdx2PZwKid2WMWtWDmyoqtm4zMs5yM4ZfyCktzF83PQqUXFQmPx/MkmkRUof0F6gFcUsN92jFqkBr+sU0Woqg04nuuiD/RhJMYadE5NAT8+zxlfgGzK5K9iCcE2NDMcpj+EaspMkytXEN/vy8Trod1TZogKVSeq/sF2TMpUhdtFVLapcqdbuQ1ZwQaseZBMl5Pn3TThKxvobb9VZp3P4BFP/93L+TNfhiqLmJ9BoBNrInUYsupvw== X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(13018025)(13016025)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93001095)(100000703101)(100105400095)(6055026)(6096035)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123561025)(20161123563025)(20161123559100)(20161123556025)(20161123565025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:SN2PR03MB2269; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:SN2PR03MB2269; X-Forefront-PRVS: 040866B734 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR03MB2269; 23:TFKGOkCxSmIBpjXv3V+h4me2sd/qbJwqj+Vb+JHTg?= =?us-ascii?Q?jid9UQYV/t1EGfjypD3cmvBylMFHYDVR6hDjSrTiowUWE4TYb2o1uNf1WJbh?= =?us-ascii?Q?ee8uBE74LEV8ZuoXBGq6M29qcZygXo5Ulh38MaQnyi654LlnxTX/xeg/BRfM?= =?us-ascii?Q?a903Gtmqx0Ohx5kgSAUuZiFdMQ6GmWhNsuKulAjnd62F0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pueqpdLspZ+E8rHHA9IxF8/O6QUcuzoWKwsKT02QyT1FGMvqV+T1O8l?= =?us-ascii?Q?D5gDioqZNdUfsx90oChkN+F/+xN2r3q?= X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2269; 6:Fl/BJYaoJnJeEhmffO34yHmouTSkVojfHyeAFbao5WTXhmA0x+PR439L16X7s7CDXHZNUnD1fJL/RZpZ2P3MYj50Tbjd4eVir943O6o9K7h0G5iAs1iE+O4eOozxkQkO142ZYfc4q7nGWJnWdEWMdJdlUHCaMAH2z0byYeshtHCf9u83e+RvCgenkxdoHMu3TwZeIqmzrO6O43IRta+37kvVS7GYqSWfljL+uBgP3aysMpWePWU6fBFRQTl6u4KU/O4YY00igrcPTJjSnIr6iNhmAn3EHOGXvw4Gj77GaS7lcX4xYXL8T+mRQDiIIGHtx8UM2yRKSY0O8KnMe+HHNQ==; 5:73RhTLQr8y8fIAEFOmzFe9hAq596udSiU7LlZ7WcHT133TxWwT4EPYBhTumvYx/TQOePOgp6s16Bw+NU3Qh6HFv5R1zS8CxmKMPZRuNYU6vo2p8DrAf7kaDMwI9+7WB9jGjzsecWvCJHC/oa5n8PgA==; 24:kXHZ2BpFNEu0qZVrcd805o9NDkpTQJym7iYbesUFegDVOiA1iGTiG5mjmzzn2L7jsAy1sVioCbKUixFSZ/1IARJn5x54KWrSfCkKg+FlEnQ=; 7:WLI3lEBxJKxbbNbeMuFWNvRlFGfkQgNBtNlZAWjolZ1FS+jmRhg5fH16VhiS+qutD8adPo+uJPGs4OfkqRltNPAC090iPK4Viu+RvQC8qTwI71TrN3vJkqH1U+02DmRRjz6uXXPmX6jPAxTPlgRf3AXHUYHU8EwZXPmiLqGMJa9ca95lQ4fn6yfSsc/iLdCXBmgytchqVNGSgzzy7VH6WKqohyN8p/IVo9X7LOfpwNA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2017 14:02:54.4624 (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: SN2PR03MB2269 Subject: [dpdk-dev] [PATCH v3 13/40] bus/dpaa: add support for FMAN frame queue lookup 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:02:57 -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/qbman/qman.c | 99 ++++++++++++++++++++++++++++++- drivers/bus/dpaa/base/qbman/qman_driver.c | 7 ++- drivers/bus/dpaa/base/qbman/qman_priv.h | 11 ++++ drivers/bus/dpaa/include/fsl_qman.h | 12 ++++ 4 files changed, 126 insertions(+), 3 deletions(-) diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c index 494d54c..837e46c 100644 --- a/drivers/bus/dpaa/base/qbman/qman.c +++ b/drivers/bus/dpaa/base/qbman/qman.c @@ -176,6 +176,65 @@ static inline struct qman_fq *table_find_fq(struct qman_portal *p, u32 fqid) return fqtree_find(&p->retire_table, fqid); } +#ifdef CONFIG_FSL_QMAN_FQ_LOOKUP +static void **qman_fq_lookup_table; +static size_t qman_fq_lookup_table_size; + +int qman_setup_fq_lookup_table(size_t num_entries) +{ + num_entries++; + /* Allocate 1 more entry since the first entry is not used */ + qman_fq_lookup_table = vmalloc((num_entries * sizeof(void *))); + if (!qman_fq_lookup_table) { + pr_err("QMan: Could not allocate fq lookup table\n"); + return -ENOMEM; + } + memset(qman_fq_lookup_table, 0, num_entries * sizeof(void *)); + qman_fq_lookup_table_size = num_entries; + pr_debug("QMan: Allocated lookup table at %p, entry count %lu\n", + qman_fq_lookup_table, + (unsigned long)qman_fq_lookup_table_size); + return 0; +} + +/* global structure that maintains fq object mapping */ +static DEFINE_SPINLOCK(fq_hash_table_lock); + +static int find_empty_fq_table_entry(u32 *entry, struct qman_fq *fq) +{ + u32 i; + + spin_lock(&fq_hash_table_lock); + /* Can't use index zero because this has special meaning + * in context_b field. + */ + for (i = 1; i < qman_fq_lookup_table_size; i++) { + if (qman_fq_lookup_table[i] == NULL) { + *entry = i; + qman_fq_lookup_table[i] = fq; + spin_unlock(&fq_hash_table_lock); + return 0; + } + } + spin_unlock(&fq_hash_table_lock); + return -ENOMEM; +} + +static void clear_fq_table_entry(u32 entry) +{ + spin_lock(&fq_hash_table_lock); + DPAA_BUG_ON(entry >= qman_fq_lookup_table_size); + qman_fq_lookup_table[entry] = NULL; + spin_unlock(&fq_hash_table_lock); +} + +static inline struct qman_fq *get_fq_table_entry(u32 entry) +{ + DPAA_BUG_ON(entry >= qman_fq_lookup_table_size); + return qman_fq_lookup_table[entry]; +} +#endif + static inline void cpu_to_hw_fqd(struct qm_fqd *fqd) { /* Byteswap the FQD to HW format */ @@ -766,8 +825,13 @@ static u32 __poll_portal_slow(struct qman_portal *p, u32 is) break; case QM_MR_VERB_FQPN: /* Parked */ +#ifdef CONFIG_FSL_QMAN_FQ_LOOKUP + fq = get_fq_table_entry( + be32_to_cpu(msg->fq.contextB)); +#else fq = (void *)(uintptr_t) be32_to_cpu(msg->fq.contextB); +#endif fq_state_change(p, fq, msg, verb); if (fq->cb.fqs) fq->cb.fqs(p, fq, &swapped_msg); @@ -792,7 +856,11 @@ static u32 __poll_portal_slow(struct qman_portal *p, u32 is) } } else { /* Its a software ERN */ +#ifdef CONFIG_FSL_QMAN_FQ_LOOKUP + fq = get_fq_table_entry(be32_to_cpu(msg->ern.tag)); +#else fq = (void *)(uintptr_t)be32_to_cpu(msg->ern.tag); +#endif fq->cb.ern(p, fq, &swapped_msg); } num++; @@ -907,7 +975,11 @@ static inline unsigned int __poll_portal_fast(struct qman_portal *p, clear_vdqcr(p, fq); } else { /* 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(p, fq, dq); /* @@ -1119,7 +1191,12 @@ int qman_create_fq(u32 fqid, u32 flags, struct qman_fq *fq) fq->flags = flags; fq->state = qman_fq_state_oos; fq->cgr_groupid = 0; - +#ifdef CONFIG_FSL_QMAN_FQ_LOOKUP + if (unlikely(find_empty_fq_table_entry(&fq->key, fq))) { + pr_info("Find empty table entry failed\n"); + return -ENOMEM; + } +#endif if (!(flags & QMAN_FQ_FLAG_AS_IS) || (flags & QMAN_FQ_FLAG_NO_MODIFY)) return 0; /* Everything else is AS_IS support */ @@ -1193,7 +1270,9 @@ void qman_destroy_fq(struct qman_fq *fq, u32 flags __maybe_unused) case qman_fq_state_oos: if (fq_isset(fq, QMAN_FQ_FLAG_DYNAMIC_FQID)) qman_release_fqid(fq->fqid); - +#ifdef CONFIG_FSL_QMAN_FQ_LOOKUP + clear_fq_table_entry(fq->key); +#endif return; default: break; @@ -1258,7 +1337,11 @@ int qman_init_fq(struct qman_fq *fq, u32 flags, struct qm_mcc_initfq *opts) dma_addr_t phys_fq; mcc->initfq.we_mask |= QM_INITFQ_WE_CONTEXTB; +#ifdef CONFIG_FSL_QMAN_FQ_LOOKUP + mcc->initfq.fqd.context_b = fq->key; +#else mcc->initfq.fqd.context_b = (u32)(uintptr_t)fq; +#endif /* * and the physical address - NB, if the user wasn't trying to * set CONTEXTA, clear the stashing settings. @@ -1419,7 +1502,11 @@ int qman_retire_fq(struct qman_fq *fq, u32 *flags) msg.verb = QM_MR_VERB_FQRNI; msg.fq.fqs = mcr->alterfq.fqs; msg.fq.fqid = fq->fqid; +#ifdef CONFIG_FSL_QMAN_FQ_LOOKUP + msg.fq.contextB = fq->key; +#else msg.fq.contextB = (u32)(uintptr_t)fq; +#endif fq->cb.fqs(p, fq, &msg); } } else if (res == QM_MCR_RESULT_PENDING) { @@ -1861,7 +1948,11 @@ static inline struct qm_eqcr_entry *try_p_eq_start(struct qman_portal *p, QM_EQCR_DCA_PARK : 0) | ((flags >> 8) & QM_EQCR_DCA_IDXMASK); eq->fqid = cpu_to_be32(fq->fqid); +#ifdef CONFIG_FSL_QMAN_FQ_LOOKUP + eq->tag = cpu_to_be32(fq->key); +#else eq->tag = cpu_to_be32((u32)(uintptr_t)fq); +#endif eq->fd = *fd; cpu_to_hw_fd(&eq->fd); return eq; @@ -1907,7 +1998,11 @@ int qman_enqueue_multi(struct qman_fq *fq, /* try to send as many frames as possible */ while (eqcr->available && frames_to_send--) { eq->fqid = cpu_to_be32(fq->fqid); +#ifdef CONFIG_FSL_QMAN_FQ_LOOKUP + eq->tag = cpu_to_be32(fq->key); +#else eq->tag = cpu_to_be32((u32)(uintptr_t)fq); +#endif eq->fd.opaque_addr = fd->opaque_addr; eq->fd.addr = cpu_to_be40(fd->addr); eq->fd.status = cpu_to_be32(fd->status); diff --git a/drivers/bus/dpaa/base/qbman/qman_driver.c b/drivers/bus/dpaa/base/qbman/qman_driver.c index 90fb130..7a68896 100644 --- a/drivers/bus/dpaa/base/qbman/qman_driver.c +++ b/drivers/bus/dpaa/base/qbman/qman_driver.c @@ -279,5 +279,10 @@ int qman_global_init(void) else qman_clk = be32_to_cpu(*clk); - return ret; +#ifdef CONFIG_FSL_QMAN_FQ_LOOKUP + ret = qman_setup_fq_lookup_table(CONFIG_FSL_QMAN_FQ_LOOKUP_MAX); + if (ret) + return ret; +#endif + return 0; } diff --git a/drivers/bus/dpaa/base/qbman/qman_priv.h b/drivers/bus/dpaa/base/qbman/qman_priv.h index 4a11e40..4b6c13c 100644 --- a/drivers/bus/dpaa/base/qbman/qman_priv.h +++ b/drivers/bus/dpaa/base/qbman/qman_priv.h @@ -44,6 +44,10 @@ #include "dpaa_sys.h" #include +#if !defined(CONFIG_FSL_QMAN_FQ_LOOKUP) && defined(RTE_ARCH_ARM64) +#error "_ARM64 requires _FSL_QMAN_FQ_LOOKUP" +#endif + /* Congestion Groups */ /* * This wrapper represents a bit-array for the state of the 256 QMan congestion @@ -197,6 +201,13 @@ void qm_set_liodns(struct qm_portal_config *pcfg); int qman_testwrite_cgr(struct qman_cgr *cgr, u64 i_bcnt, struct qm_mcr_cgrtestwrite *result); +#ifdef CONFIG_FSL_QMAN_FQ_LOOKUP +/* If the fq object pointer is greater than the size of context_b field, + * than a lookup table is required. + */ +int qman_setup_fq_lookup_table(size_t num_entries); +#endif + /* QMan s/w corenet portal, low-level i/face */ /* diff --git a/drivers/bus/dpaa/include/fsl_qman.h b/drivers/bus/dpaa/include/fsl_qman.h index 85ae13b..eedfd7e 100644 --- a/drivers/bus/dpaa/include/fsl_qman.h +++ b/drivers/bus/dpaa/include/fsl_qman.h @@ -46,6 +46,15 @@ extern "C" { #include +/* FQ lookups (turn this on for 64bit user-space) */ +#if (__WORDSIZE == 64) +#define CONFIG_FSL_QMAN_FQ_LOOKUP +/* if FQ lookups are supported, this controls the number of initialised, + * s/w-consumed FQs that can be supported at any one time. + */ +#define CONFIG_FSL_QMAN_FQ_LOOKUP_MAX (32 * 1024) +#endif + /* Last updated for v00.800 of the BG */ /* Hardware constants */ @@ -1228,6 +1237,9 @@ struct qman_fq { enum qman_fq_state state; int cgr_groupid; struct rb_node node; +#ifdef CONFIG_FSL_QMAN_FQ_LOOKUP + u32 key; +#endif }; /* -- 2.9.3