From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0076.outbound.protection.outlook.com [104.47.41.76]) by dpdk.org (Postfix) with ESMTP id 0D46D1AEF4 for ; Thu, 28 Sep 2017 13:23:25 +0200 (CEST) Received: from BN6PR03CA0056.namprd03.prod.outlook.com (10.173.137.18) by CY1PR03MB2361.namprd03.prod.outlook.com (10.166.207.148) 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:24 +0000 Received: from BY2FFO11FD038.protection.gbl (2a01:111:f400:7c0c::135) by BN6PR03CA0056.outlook.office365.com (2603:10b6:404:4c::18) 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 11:23:24 +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 BY2FFO11FD038.mail.protection.outlook.com (10.1.14.223) 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:23 +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 v8SBMpFn016035; Thu, 28 Sep 2017 04:23:21 -0700 From: Shreyansh Jain To: CC: , Date: Thu, 28 Sep 2017 17:03:17 +0530 Message-ID: <20170928113344.12248-14-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: 131510714037311017; (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)(7966004)(336005)(346002)(39380400002)(39860400002)(376002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(77096006)(8936002)(76176999)(5660300001)(8676002)(81156014)(50986999)(81166006)(356003)(50466002)(48376002)(6666003)(305945005)(2950100002)(6916009)(4326008)(53936002)(50226002)(97736004)(189998001)(5003940100001)(2906002)(2351001)(498600001)(33646002)(106466001)(105606002)(36756003)(68736007)(104016004)(47776003)(86362001)(16586007)(8656003)(54906003)(85426001)(1076002)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB2361; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD038; 1:Ah8J4vRZnMyQRZHmc0oGOKHEGX6hKUOJ4ZAhcpssQT867johaH900IRotLmEHkmfu/xYyZymfTT87Udec9DeOeBUyA8G4zxd4vzmIbwc5PtK6/ZNJpqP5OXNTqZoQ06z MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b33f9236-ac48-4d08-b4c8-08d5066354ce X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017052603199)(201703131430075)(201703131517081); SRVR:CY1PR03MB2361; X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2361; 3:pXIhPG8SJyWLZi7KNurHw8hB1iJlpOM6z81Rrd8d9AzlOkI8WL+AU8ymTsJuxPT174smaJ0hEDHtC7Ur9H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ak3VVTUoaNn7fDe0GB/BDOZJ0/Y/c/6Gbx2qg6UV/dzVtyefcS1OFZsUr4nOJkKhlhfwmwvl3UIXKrercs+jhNOR8k3RlUCsBfXmdpfZVd1zha1e72/VbBnw+QyinweVfkLgypDCUaAKpd4AlgFtSDd2GLnlVSP++lXTYWP1ovHrCqHnGuix/xujTMznjLbU8qzOetHHRvH3Oa+zJL0eOXsI43bg== 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)(5005006)(8121501046)(93006095)(93001095)(100000703101)(100105400095)(3002001)(10201501046)(6055026)(6096035)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(20161123565025)(20161123563025)(20161123561025)(20161123556025)(20161123559100)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR03MB2361; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR03MB2361; X-Forefront-PRVS: 0444EB1997 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR03MB2361; 23:l7IoATKfVga9uTFRkz8/dqh1iwo+y5jn9URpQDMau?= =?us-ascii?Q?3zQQCGeQE3L9baaAX7bSF0pmZlEKMJqAZ1A+GHrz8LoGaK4wMbH+joFKmZ00?= =?us-ascii?Q?9AisD/BbV58dLRi67mGAXNm8BZmiBbUeku4VXGTA3laAWRhpKGwXZMnpqqB4?= =?us-ascii?Q?HRw3kfpcKgyW9ChVrQ5rEPWTBJpgsSOZINbppGgAxF7m8JoZcr10OeXJc3Qs?= =?us-ascii?Q?ds/LMmmz+hahcKDU6y88Jx8OEBf9YIGwS2KB5m86WG2sbsHoT8yOJhrfBwgK?= =?us-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+aoxShB?= =?us-ascii?Q?77Vf+Ec2ikj29cs+BILWVtImHif0yetktSh?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2361; 6:lgPSymVNfkdRMQTlDCbFMMSLlkltSjbDFhHIrdfWXWKT670mFjlh2qB89CFyntmNnmPbvds6RxV6IQ6EO3bWSRSrWS61s5DgKCGk3TqU8PE2q9/wgxlLcJcZkceuPsbEAvTX8GNx3PDyubtS313rvW8+4MFn4R0dv0wGBPjclRHFHKQftSfsG82AkB1qrZPXVh+MDP2NpnP+tgVystDj+/YmWRyUFn+8DjV8psg5yrorzI0QUj0nvpp2m3Kd3SRkOkMJPCX97oIcJKhW+LrCacrcEENgBYdU6fKJGVphNpOlou1EpQr9uCmyeJJ73wIgKazPG99yTLGMkCM7e6RO0g==; 5:rWsdevs95M+0KLrLWFb+LnXaGlARHdGA7m2zLOy25QKHrNpsFCz2Dirt4VWdhvX3btrRlX1ELHwG48R22TiLiIyowTAuPSO9pITZ2GkWRm9AhdWp3UWv6RC/YQbQ68cflD8Gt7ccr+a3LZcFidbCuw==; 24:GoxmsH4z4tppWwrXBTYrMx7Lqmw9Id5tj1dBh6L4k5InPxFnMCmCITkUJoa0vD/nFD5HRgvp1Xu/tZW2FCl/Rs6Nr1A+yiyh1LT3rHUbVIw=; 7:Ln/4su0OisU9c6qG+ypdJ9kGaCgFJKQCJVzE9Or2yGmO9pyfPooFbd8IGE6Nf9LhpczY3DX6kHjRf6lMaPh4SdXFtRkvB7QPTKHuxvxZT+7PspsBdn92v6ODBIc2zfTSAH2t5Kwo2F/G8DHyzVE/E4TH3lvI6eJOcDyImGiLh/TZzkWdvInN4K+Z1Y8LXuBjWErfpxyD7stjDM1onaxK68Vvm4WP/aT/vv6l9QePfis= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2017 11:23:23.5283 (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: CY1PR03MB2361 Subject: [dpdk-dev] [PATCH v5 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 11:23:26 -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