From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0062.outbound.protection.outlook.com [104.47.34.62]) by dpdk.org (Postfix) with ESMTP id 18CB81B1FA for ; Sat, 9 Sep 2017 13:11:01 +0200 (CEST) Received: from BN3PR03CA0076.namprd03.prod.outlook.com (10.167.1.164) by DM5PR03MB3321.namprd03.prod.outlook.com (10.174.241.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.35.12; Sat, 9 Sep 2017 11:10:59 +0000 Received: from BN1BFFO11FD039.protection.gbl (2a01:111:f400:7c10::1:169) by BN3PR03CA0076.outlook.office365.com (2a01:111:e400:7a4d::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.13.10 via Frontend Transport; Sat, 9 Sep 2017 11:10:59 +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 BN1BFFO11FD039.mail.protection.outlook.com (10.58.144.102) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1385.11 via Frontend Transport; Sat, 9 Sep 2017 11:10:57 +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 v89BAUhD026326; Sat, 9 Sep 2017 04:10:55 -0700 From: Shreyansh Jain To: CC: , Date: Sat, 9 Sep 2017 16:51:04 +0530 Message-ID: <20170909112132.13936-14-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170909112132.13936-1-shreyansh.jain@nxp.com> References: <20170823141213.25476-1-shreyansh.jain@nxp.com> <20170909112132.13936-1-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131494290590719724; (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)(1110001)(1109001)(339900001)(199003)(189002)(48376002)(50466002)(6916009)(2950100002)(97736004)(54906002)(8656003)(77096006)(110136004)(2906002)(53936002)(498600001)(2351001)(104016004)(85426001)(5003940100001)(36756003)(6666003)(189998001)(33646002)(5660300001)(8936002)(50986999)(81166006)(81156014)(76176999)(105606002)(106466001)(1076002)(47776003)(305945005)(68736007)(50226002)(86362001)(8676002)(356003)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR03MB3321; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD039; 1:irBV5D23FJhBg0s0LSvjdZx3wZMSULWpW6hx62UD66yCO8Q5thx+rYozc1FeX2/6voR0qj51wYjSDRNOJeStiNF+TbKSYblDfKBAoPJVTbFmwiPGxQow4iEWVTQ9jP7G MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 18f194a4-1d45-45d4-7d8b-08d4f773731b X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(2017052603199)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:DM5PR03MB3321; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB3321; 3:Cz857PPROMT2jC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UwO+PCCnSau4iTEvDtISz0KGcrOcDQHQiap4IZo3YTUP1dpO6E6FkXBAi5GmZfZB2yGHTA7WKZaLQzhlME6FgK87lJGSJstmmzuFZZfeYQd5FdvgRqBc8YY8GiUdIsek+GtXp30iPYWdDt2Yidh/j9byMz0Qm+PyS50PaV6kx7scnDX3ZXocZpG4e+LDLPHMXfnjU3rUgwkh8Cc2E5zNiWtKFQnIG5wDI49jbueiz1ksvqmGeUhvDelOPWoHl+Qn5Ukwl7rD8r7YfkOzuEw== 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)(10201501046)(100000703101)(100105400095)(3002001)(93006095)(93001095)(6055026)(6096035)(20161123565025)(20161123559100)(20161123556025)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123561025)(20161123563025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR03MB3321; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR03MB3321; X-Forefront-PRVS: 0425A67DEF X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR03MB3321; 23:JpbL3qAdHnJC4G9ruttHyVkOmMKfvtH/6y9vUuUTI?= =?us-ascii?Q?sXrN+Pi552Rlj0CVq/9BrV+ucfuaqHWirA3/hOweokUAqiQ4qcp+bC9hZ0As?= =?us-ascii?Q?R0TnCsyc2cFh6bpNGXSoY9QPSRM8Mg7wzVBkIA1xRJQcu11k7HC8FmUmAxAM?= =?us-ascii?Q?1bWLVy6G12cktNeq78QSpGg+0C+p3zsOKY4U8z1AA0FvRK0NSX1ZBb3txKK5?= =?us-ascii?Q?binXZ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jwbHKPR8S98TYl+pD?= =?us-ascii?Q?53FkyPv13351Bagx8EENIuxcDPe10cl?= X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB3321; 6:eYb5VrQIFPLdjOImdIMC+GcqTcyInUh9EOYq2tTUQGRNeGuGb3UJzbfTcGLX5eeqc5qnz192RUCu6PyYQ4B19u+2LjtjxMvSPAswXBpaK6pU68OZe+JiWQWJ9ZbiLx2eA0jrArwUSGdlSJLyjn6nNQmiLZMesDm2cd4p+5M71C0nIXWXvHokmyAgh+9DlYAN5oK5cmmalHQEl20YBi5B1Bbg5bYMr8YK0HkPQXV79vzR2ph1fLgwuys0rBGuM3Qe/8/S8a/iRQMSNJwGgi3k0q7J8ynO8TF6pUQp5k4L25J1E02TLjfA6zAdnUjA6Dm5EMlIRcK8wPrnUwMOPXlm3Q==; 5:gQhJYu6fyh/4eCHT+fW1r1Tj1FG8LIR3FIvlvgx62S+dpFiPI5WuwVJV84eqKJuAtvn+vOmSzLSsXiRdi8p+o2L4XaNSHA3VyYtSe0Hb9ZlJBBQeple7rW1UunYYxfIt/Y8hUx5fkIiLgNHUmSDquw==; 24:NPZPObalrlDBvFGbTA00U+6cbfwAL/uLBqyzfVyTuNnxMI4qEHl+4V2wab/5ztUvVe87rzoWfmss4Iu9HDneKV88G6Pvkv/Hajcwudk/PRQ=; 7:i0alBrCM+9fqnaAkqaazpO8EfJtkn0eKCKME5vnMNts2qB7nlZySjoxKmzDhc705OVOeMT0J7+wuVerXdqZ5eUq1otXE1Augyf6Oi0buJVOHpaN422n83UtoBXTwvJduIra2XITgRryAwlDntImT8mNP76Ns5wFhwejIaAsUmw86gXexALGrzfPfg2/sdo/XWsBWPBYW2ITbjDfUYN84eVAn0CNNbtQF4Pyi0iF4mQM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Sep 2017 11:10:57.8551 (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: DM5PR03MB3321 Subject: [dpdk-dev] [PATCH v4 13/41] 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: Sat, 09 Sep 2017 11:11:02 -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