From patchwork Fri Jan 11 12:24:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shreyansh Jain X-Patchwork-Id: 155342 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp516693jaa; Fri, 11 Jan 2019 04:25:50 -0800 (PST) X-Google-Smtp-Source: ALg8bN4D7u5Lvm9t+iX7oJzulFmbG7PgRtio8gykmIHGwU+l8y2Q2wDV+HVv94HMOlNBkORWYs7X X-Received: by 2002:adf:ff09:: with SMTP id k9mr12815729wrr.97.1547209549938; Fri, 11 Jan 2019 04:25:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547209549; cv=none; d=google.com; s=arc-20160816; b=zuByKsdfKk9EUXiaYVaq2qrkFW5c9mrY/mmbCyvoA3kolUKFhOQk1PmMopQN0sOsAs Ec4yLzraF8NjbSBcRVIJ0QyKbdTXWjvhRWYNOPtQ7nAVY7/jRlVYrOsgchdi4Ph38+PN La4DR5CiyAwJ0DTvjUaDtpibFoS+xU24wO8iP7DrD80FUVf9nU639VapXI4It2COzeu+ zxWBafVZj3zUwiq6XBV12usN7XWwMM0Ja4LUpbeXdtKEB7wjmZWx+kJnYtZeyyOYKInd f+E5lKd/N4BZ7zhqiyy9MuqAXtNBaeAokKswQydFxajfl/zoe9uL36Y60Ru2E+PG1HC1 ck5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:mime-version :content-transfer-encoding:spamdiagnosticmetadata :spamdiagnosticoutput:content-language:accept-language:in-reply-to :references:message-id:date:thread-index:thread-topic:cc:to:from :dkim-signature; bh=OBJWLXiD8twuKIB85solppzG0bxZdLEnvtTQped+mn4=; b=PVkrSRVa6fiyl+8emjsMCViAji30GLlwTMg+Z1rX6gwQv5BfsrrUzG8Jiui4p2xDqw eDuA0AA3CMI5Wlb5PHT6PWHgDOL5AEk8QLMMqdstOGSKS+9jUgSw3Vqtt5f45lqmxb9x wBW/oP1OpH+gbIK6ZFK5cT5I/SbICVx0d2zLWqKI4+9u/e6Eu4H2iqkajQ4pws99+0nh peUI4OkG6pCzXVqYRLc3Hh8u1ZEWzxzunYmZFDZqxLPZcgpj2BsE56DD5Wk2ORP3eqM4 H/0ZEX68fX9Eejif35AsdP5IhExDf4y/T80vyg+JqHS4XqsyVBuBJhTT5Ol6g4nVUj1Z RE1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=sx0KJojE; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id z22si12865362wma.123.2019.01.11.04.25.49; Fri, 11 Jan 2019 04:25:49 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=sx0KJojE; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 661FF1BBF3; Fri, 11 Jan 2019 13:24:38 +0100 (CET) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140070.outbound.protection.outlook.com [40.107.14.70]) by dpdk.org (Postfix) with ESMTP id 328D71BBE8 for ; Fri, 11 Jan 2019 13:24:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OBJWLXiD8twuKIB85solppzG0bxZdLEnvtTQped+mn4=; b=sx0KJojEIypUT9zOPrH59x7GPh+uPxGcZiZ/QGx9X0CBRFqa+cN2m/sVfV6CWoo+W7CcMOK4kshbJWwPLiRjkqRu4VdTBVSStIkRYVvcn5FTW1Ir/IZz82ezqh+19WTLg3EG3nYa/D+6exwt1w+714KficFIIJgtAqs6zC5uKtk= Received: from VI1PR04MB4688.eurprd04.prod.outlook.com (20.177.56.80) by VI1PR04MB5694.eurprd04.prod.outlook.com (20.178.126.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1516.14; Fri, 11 Jan 2019 12:24:34 +0000 Received: from VI1PR04MB4688.eurprd04.prod.outlook.com ([fe80::b1eb:7e7e:7b90:7b4]) by VI1PR04MB4688.eurprd04.prod.outlook.com ([fe80::b1eb:7e7e:7b90:7b4%4]) with mapi id 15.20.1516.016; Fri, 11 Jan 2019 12:24:34 +0000 From: Shreyansh Jain To: "dev@dpdk.org" CC: "ferruh.yigit@intel.com" , Hemant Agrawal , Youri Querry , Nipun Gupta Thread-Topic: [PATCH v3 09/19] bus/fslmc: upgrade to latest qbman library Thread-Index: AQHUqaiczDRUOZbs/0a61jVFVeijMg== Date: Fri, 11 Jan 2019 12:24:34 +0000 Message-ID: <20190111122305.7133-10-shreyansh.jain@nxp.com> References: <20190111115712.6482-1-shreyansh.jain@nxp.com> <20190111122305.7133-1-shreyansh.jain@nxp.com> In-Reply-To: <20190111122305.7133-1-shreyansh.jain@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [14.143.254.130] x-mailer: git-send-email 2.17.1 x-clientproxiedby: TY2PR01CA0017.jpnprd01.prod.outlook.com (2603:1096:404:a::29) To VI1PR04MB4688.eurprd04.prod.outlook.com (2603:10a6:803:71::16) authentication-results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR04MB5694; 6:T0dSDVjI6wBdsqct+a3nRdvPIS/5mCYoKmWITxdPuTR3Nd44yDfKx7R+ix5ehlmtbTxlwQ4tAancffJ5CXoznn9l0cRPBn4MB1zApCJD6nnyQ9JAhcOS3Jpn2i1eVcqpbpn8PdMsBBDH3WNdso7bE4E3/FGMuxnuq5NgSijmjbAEbDjNtWh6Fkgiq01aAkSSt0+WPChspuqterxYfnwe4XwUS4rBXbetflGWpjhVrlf/o9obMJ/Sbw+MvFNVHKPwUwfVxKySTsZ25Xb8Asqr40vmBwc/ni/PNaglLKG8I9LnjuKrAcdZYqlu6hYR16ymCZYNf6Sj89BgxPSmMt9uFDZoyYI4KWny1EKyroclUu/TFM8/w7uRXi97pD7EtD14vKyTHOaz7y2aTy9Wg0BtJVPCNtOnXD4IMsvOgUOC8XZU/O1cGYZA7rlf9xZ3XrVrGg0oQEM1p2OQzgxqn12WRg==; 5:aNRCj24JTbNYWJ3p3jSnMCDd+9gYeUUXWk3ghtThERhCP2DOeS5s4tYm0FxZM0ZX0+Po+R1G9KK4222sNvHWBp/xLz3IXacKJrlqAN2tGseJXZa0bYQq9ynvOF2yQX5WCSE3fYf3LSkkYbfyZoc18eYKV43yhAPyL1/wlUdT/7/pgDgcyM4/3UFfLGf5qynCVFoJmEAa04yUL4Q0T5CtUg==; 7:beC3blX6r6Xbqr+uip8dsrh2xOWPdAWSkp1Jr7eqiugTCnY9r9q3IY+sPukz6wJmeQ1WVguZo416T4HEAm0vJlrNGoy7qFQPTl30ZYufvrYM53eFBFngwSek3+zZ9/2nffJbciFaK3r37C04ZAb0ug== x-ms-office365-filtering-correlation-id: 78658d10-4364-4fb6-e13a-08d677bfbea8 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600109)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR04MB5694; x-ms-traffictypediagnostic: VI1PR04MB5694: x-microsoft-antispam-prvs: x-forefront-prvs: 09144DB0F7 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(366004)(136003)(39860400002)(346002)(396003)(199004)(189003)(446003)(71190400001)(26005)(8676002)(186003)(11346002)(14454004)(54906003)(476003)(2616005)(102836004)(386003)(7736002)(55236004)(6506007)(105586002)(99286004)(305945005)(478600001)(256004)(14444005)(1076003)(50226002)(36756003)(68736007)(2906002)(53936002)(5640700003)(6512007)(6916009)(76176011)(66066001)(106356001)(6486002)(25786009)(6436002)(78486014)(97736004)(486006)(52116002)(316002)(86362001)(6116002)(3846002)(81166006)(1730700003)(81156014)(8936002)(2351001)(44832011)(2501003)(71200400001)(5660300001)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB5694; H:VI1PR04MB4688.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: K4uUVzihP2K1j3wMjH0q1Ch9yheXOvEHxBZnrTYaSlhU71KHPAiN60e5icPgKsykGgoCwX0gmKIKR/Jo+Lot4Sq76KJ8RIcEvjk+5KJOp7Qy2bIEzhuQEuHZ06yIYraBL9r8sPlzPdZ391tHkX+Mq2dOorxYAoeBXdL8MoR0hZjpUd/3YNH3MxmAbIFYx61urQxpaO3bW28eQvT/gYwCoSqlO4BALKKxeDA3z9U5FmE3qAMzLxU+PItBBVzvT66w+7tW20FUIQYnSf+9CqQCk2+9vfRlPQ7R1+4aiN28tRnmp3w6zJZGQeycOw7WkMWGsendR0fkeM39csL1pkUhowjM1UD9Si7mQ+Lc23t0JZr0+MDYltFfWsoXfXJHiU0RyF0SX8ibHYCO764Z2IwjKvqu12Hz+xs94hdN1TI6Lac= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 78658d10-4364-4fb6-e13a-08d677bfbea8 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Jan 2019 12:24:30.9259 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5694 Subject: [dpdk-dev] [PATCH v3 09/19] bus/fslmc: upgrade to latest qbman library 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Hemant Agrawal This patch upgrades and sync the dpdk based qbman code with new version of qbman flib. Signed-off-by: Youri Querry Signed-off-by: Nipun Gupta Signed-off-by: Hemant Agrawal --- drivers/bus/fslmc/qbman/qbman_portal.c | 8 ++++---- drivers/bus/fslmc/qbman/qbman_sys.h | 17 +++++++++++------ 2 files changed, 15 insertions(+), 10 deletions(-) -- 2.17.1 diff --git a/drivers/bus/fslmc/qbman/qbman_portal.c b/drivers/bus/fslmc/qbman/qbman_portal.c index bbea37efc..2f572a08b 100644 --- a/drivers/bus/fslmc/qbman/qbman_portal.c +++ b/drivers/bus/fslmc/qbman/qbman_portal.c @@ -201,7 +201,7 @@ struct qbman_swp *qbman_swp_init(const struct qbman_swp_desc *d) p->vdq.valid_bit = QB_VALID_BIT; p->dqrr.valid_bit = QB_VALID_BIT; qman_version = p->desc.qman_version; - if ((qman_version & 0xFFFF0000) < QMAN_REV_4100) { + if ((qman_version & QMAN_REV_MASK) < QMAN_REV_4100) { p->dqrr.dqrr_size = 4; p->dqrr.reset_bug = 1; } else { @@ -1315,9 +1315,9 @@ const struct qbman_result *qbman_swp_dqrr_next_mem_back(struct qbman_swp *s) */ flags = p->dq.stat; response_verb = verb & QBMAN_RESPONSE_VERB_MASK; - if ((response_verb == QBMAN_RESULT_DQ) && - (flags & QBMAN_DQ_STAT_VOLATILE) && - (flags & QBMAN_DQ_STAT_EXPIRED)) + if ((response_verb == QBMAN_RESULT_DQ) + && (flags & QBMAN_DQ_STAT_VOLATILE) + && (flags & QBMAN_DQ_STAT_EXPIRED)) atomic_inc(&s->vdq.busy); return p; } diff --git a/drivers/bus/fslmc/qbman/qbman_sys.h b/drivers/bus/fslmc/qbman/qbman_sys.h index 0571097ab..e3bd1c5e6 100644 --- a/drivers/bus/fslmc/qbman/qbman_sys.h +++ b/drivers/bus/fslmc/qbman/qbman_sys.h @@ -387,6 +387,10 @@ static inline int qbman_swp_sys_init(struct qbman_swp_sys *s, { uint32_t reg; int i; + int cena_region_size = 4*1024; + + if ((d->qman_version & QMAN_REV_MASK) >= QMAN_REV_5000) + cena_region_size = 64*1024; #ifdef RTE_ARCH_64 uint8_t wn = CENA_WRITE_ENABLE; #else @@ -396,7 +400,8 @@ static inline int qbman_swp_sys_init(struct qbman_swp_sys *s, s->addr_cena = d->cena_bar; s->addr_cinh = d->cinh_bar; s->idx = (uint32_t)d->idx; - s->cena = malloc(64*1024); + s->cena = malloc(cena_region_size); + if (!s->cena) { pr_err("Could not allocate page for cena shadow\n"); return -1; @@ -412,12 +417,12 @@ static inline int qbman_swp_sys_init(struct qbman_swp_sys *s, QBMAN_BUG_ON(reg); #endif if ((d->qman_version & QMAN_REV_MASK) >= QMAN_REV_5000) - memset(s->addr_cena, 0, 64*1024); + memset(s->addr_cena, 0, cena_region_size); else { /* Invalidate the portal memory. * This ensures no stale cache lines */ - for (i = 0; i < 0x1000; i += 64) + for (i = 0; i < cena_region_size; i += 64) dccivac(s->addr_cena + i); } @@ -425,12 +430,12 @@ static inline int qbman_swp_sys_init(struct qbman_swp_sys *s, reg = qbman_set_swp_cfg(dqrr_size, wn, 0, 3, 2, 3, 1, 1, 1, 1, 1, 1); else { - if ((d->qman_version & QMAN_REV_MASK) < QMAN_REV_5000) + if ((d->qman_version & QMAN_REV_MASK) >= QMAN_REV_5000) reg = qbman_set_swp_cfg(dqrr_size, wn, - 1, 3, 2, 2, 1, 1, 1, 1, 1, 1); + 1, 3, 2, 0, 1, 1, 1, 1, 1, 1); else reg = qbman_set_swp_cfg(dqrr_size, wn, - 1, 3, 2, 0, 1, 1, 1, 1, 1, 1); + 1, 3, 2, 2, 1, 1, 1, 1, 1, 1); } if ((d->qman_version & QMAN_REV_MASK) >= QMAN_REV_5000) {