From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0053.outbound.protection.outlook.com [104.47.38.53]) by dpdk.org (Postfix) with ESMTP id AA46E1AEF3 for ; Thu, 28 Sep 2017 14:19:37 +0200 (CEST) Received: from BN6PR03CA0021.namprd03.prod.outlook.com (10.168.230.159) by CY4PR03MB2694.namprd03.prod.outlook.com (10.173.43.137) 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:36 +0000 Received: from BY2FFO11FD023.protection.gbl (2a01:111:f400:7c0c::108) by BN6PR03CA0021.outlook.office365.com (2603:10b6:404:23::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.8 via Frontend Transport; Thu, 28 Sep 2017 12:19:35 +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 BY2FFO11FD023.mail.protection.outlook.com (10.1.15.212) 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:34 +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 v8SCJ726008785; Thu, 28 Sep 2017 05:19:33 -0700 From: Shreyansh Jain To: CC: , Date: Thu, 28 Sep 2017 17:59:33 +0530 Message-ID: <20170928123000.1711-14-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: 131510747752487980; (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)(376002)(346002)(39380400002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(498600001)(2906002)(316002)(77096006)(81156014)(81166006)(54906003)(8936002)(48376002)(8676002)(50226002)(356003)(47776003)(85426001)(5660300001)(50466002)(16586007)(1076002)(68736007)(305945005)(2351001)(6916009)(33646002)(2950100002)(189998001)(4326008)(8656003)(104016004)(76176999)(50986999)(86362001)(5003940100001)(106466001)(97736004)(105606002)(53936002)(36756003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB2694; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD023; 1:i1OyRqAn8AwwdaiM1YeWmBB1/HgoWfc20iE39E+ZGCKgcPZGjUd/vZYN6Pgfep4pbmy4Lnp3Q0H5ONOSc3xbsS42h70qJS2d1XJkXo0+wRRlFVjA/dpDKTImCvD3y+Rr MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7819acc8-1269-4fba-d124-08d5066b2e52 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017052603199)(201703131430075)(201703131517081); SRVR:CY4PR03MB2694; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2694; 3:+9PfnbXC0rkpQVUULfvhX67aod6K0nnJkkRarKljXyi8qb+gOEhFl9inaHc4QpC8nqHbegKI1nruV30fyvqHurSemMF32N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a0hh10EWzUs0VQSQMRubdVPv6Z/J6JdS/PFAQPbkeWGk1NGTg5nGwUWKQpABrKilye7ytjWe+S589mhwtRxOwBjX6H7mKie19A3NTSkzdic0LBw2ejH8k9Ikmq59TqtiP06esrp5wpyomeNQ7llNpbkXUT5u7myqgLivd7U88sipe1sh9Q0JYMovA== 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)(2401047)(8121501046)(5005006)(10201501046)(3002001)(100000703101)(100105400095)(93006095)(93001095)(6055026)(6096035)(20161123561025)(20161123556025)(20161123565025)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123563025)(20161123559100)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR03MB2694; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR03MB2694; X-Forefront-PRVS: 0444EB1997 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR03MB2694; 23:mmP2jFnEM2EjvSCxa6A985HLXikiYOQ4dS6x5fjGC?= =?us-ascii?Q?E+IVPISSr8EIp7XiJ+ujwrSiNPYyHa09soZDbXVVdfzn7FHV/+gfDXedinV/?= =?us-ascii?Q?bJunkhL3Iptt5DKH/2VzAT7R2sN8JJQV/s64ZdGGAvxqz9vscs4wnoGroCoW?= =?us-ascii?Q?w6bctf6G1fCDTGfkHsoD0Nhmvd5i7KV52s3LvSljDxN45ourAPOHTANj52n2?= =?us-ascii?Q?+FdwP4MFFeDjCVbgq3h695DocEDcG1UTAlT6gCuofO525ExFlEm68Y95mys2?= =?us-ascii?Q?NEdtrpv22t/hemZS2479h8jM8CTZh2nt9226DP8acfKX8zR+ldL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change-Diagnostics: 1; CY4PR03MB2694; 6:yJdoxD8k67NaL+BI1CyBqg82uWlQz0d8670gjOUgm/Vj/OvnmmMpoYxjhN1emaEO1QQ9PMq/rGFCKhgqBs1AGvLk9NmbTGCbkSD5ryyQ/nE10TvmZIaRd5RymEwTzNzkoaqcFcSy5EWqwLK2yvPTtY6WCLXP+GU3a0g0M6kSHAEAauLLCSMd7ic4VJtxhdXRSmVt1ICiuNnU+4O7K5RVJpwUVu+/xGkG3FpbGIz3lyVrqwrmHGwHASaROO4E/Ra1U/Nes7bUVZpD3neQdBF/cmuWHJ3Zh5xLpsnDcJ+I7meoxw6/LVWivfPcTb+pYyZ33nwkcdqmGpvauUB1akIM9w==; 5:EZA4F15t+DcvO2UorKBU/1DuWTStQ/aMV9S+4Jemg4PuWhXTKKVdNd4+MGsvvhMfeohejKP6TslA2tDIyZzFkpYzsH8V2qp+23Ag7lsx01Y7xjxLnLN1l1vykMJCbHWCFWs98MBISM+9MA4Hy3zT1A==; 24:uYIpVujuYNBNPwuU/74UXn4VlUpBOO6fOJLkhBZz9hrsNT0hMsP7fd+bg+fjMDUTf+WFvN2LZOhQzK9MNWwT03j4iGPqx5BSaI3r23xp/UA=; 7:aytdefPJMNcPeirwkL75jGIxaVo8mFOqj7H09/H/UNe8/FkOnha/m4gYpt2Tk9LuoMyaidfSlDIOsFx5NnoWU+k6AccDx4nOwyQm0IK9Ow1P9zJKZQY0Ij0JjE3zV5OaSqHLKGjDiXUn1sVX8yEFIhXqo54UoW57TvZZ9or7FFdUtoiy/mkvEy9G9pQuZJ8LexY+6cqpOhi3QoWGuWIYu+AMg6AEoF/rsIcNS5+ijQo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2017 12:19:34.9367 (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: CY4PR03MB2694 Subject: [dpdk-dev] [PATCH v6 13/40] bus/dpaa: support 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: Thu, 28 Sep 2017 12:19:38 -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 | 7 +++ drivers/bus/dpaa/include/fsl_qman.h | 12 ++++ 4 files changed, 122 insertions(+), 3 deletions(-) diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c index 9b1630b..8c8d270 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..3e1d7f9 100644 --- a/drivers/bus/dpaa/base/qbman/qman_priv.h +++ b/drivers/bus/dpaa/base/qbman/qman_priv.h @@ -197,6 +197,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