From patchwork Thu Dec 27 06:23:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 154554 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp6605068ljp; Wed, 26 Dec 2018 22:24:27 -0800 (PST) X-Google-Smtp-Source: AFSGD/W9HHVqrOoiwhcF1lIyc74R0OFRmIj6R6uItSYDA4XdytKM0I0KjvoFdBK6kb+S035yvsNy X-Received: by 2002:a1c:a6c2:: with SMTP id p185mr18583528wme.133.1545891867320; Wed, 26 Dec 2018 22:24:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545891867; cv=none; d=google.com; s=arc-20160816; b=CMFpsJPKZ+KpZ0iudFHrww7dOsuJYLTm0NakRUvqcLfsHiZokRkqlRjeRdOHrUI+ze P0Z55gNwhJJvo/RuCrR4aQn3ZLOT7+0O9mHfSkUfSceYvD0TqL3FX1CUt3d41zkzdPAT bfWX/XZBa9QtHeaKn74SGfkdI2WxphlhPO3C5sGBD15qFUUsz+r0/ybK0S/j9elHtm6I 5jHdV46yshoqr/+bhPnIGMeMsSg9I9x57PltloAebC7EWtSpS76IwPF9OtDiVDuOtWfP zcEYli3UiM2pH0SA2iODwm4Es+RJKMet0Uu015u4+Z9+MUTHjozu22bsypb/YTLPAKeJ T/TA== 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=gYGg26Hi4WHGu76QL91wEzudXBl1iIOrM/5zqnMwmHA=; b=NnB86IKTBiKFRacgP2+2FaDzSilVeVarFCATyWDJz+pZf7c23RJMgoJO8iH+qRE6zX cJLS+vivlpVZnbJU24eYf78eAXqMGpKNHSmXivVpkYkXABqgOSlgQ2fJQ2NXqUL+xjUO dJjYuwLhpRv4J3G05vXSl6DdZ0+rbyPLLcjwhzlMtFgheB1Tje8bLo7m/7rMgqaVwDFY Nzmbjtl55N6qMClXTFlyuxqqgFbXG61LX7VWBBKIssMhfUdEBLIvrUCd6Q7n0bpA31De +5iv2C6xYCPzWxsc2xp1usCj1nIJ2vVtm/LbzoxDOIlYrKG9VBsONXvBdV6MnqdDKf3h tQ8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=QTdVpqxp; 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 m3si18935965wrj.401.2018.12.26.22.24.27; Wed, 26 Dec 2018 22:24:27 -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=QTdVpqxp; 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 530325920; Thu, 27 Dec 2018 07:23:16 +0100 (CET) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140088.outbound.protection.outlook.com [40.107.14.88]) by dpdk.org (Postfix) with ESMTP id 341DF5689 for ; Thu, 27 Dec 2018 07:23:06 +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=gYGg26Hi4WHGu76QL91wEzudXBl1iIOrM/5zqnMwmHA=; b=QTdVpqxpGXPJcoFbLkWLaqsobeA2l/G/VN/4rpwHLv0Bft0G+E6y30hzK6ozzlLPvfwvA8BWnlP/+jkOdlb0LjHZYDq7tIbyiPzYD1RpmMiv4k+FUTHJyM2YHhAhvlHk9x2Y39kHLLyIEzMVy2c3cujSpXVfVJMl9Inwm8JAcjg= Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com (10.168.65.19) by VI1PR0401MB2382.eurprd04.prod.outlook.com (10.169.134.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1471.20; Thu, 27 Dec 2018 06:23:05 +0000 Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4]) by VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::555e:164:f8f0:dbb4%2]) with mapi id 15.20.1471.019; Thu, 27 Dec 2018 06:23:05 +0000 From: Hemant Agrawal To: "dev@dpdk.org" CC: "ferruh.yigit@intel.com" , Shreyansh Jain , Youri Querry , Nipun Gupta Thread-Topic: [PATCH 09/20] bus/fslmc: upgrade to latest qbman library Thread-Index: AQHUnaygdr1vJTTkCUGG+FacvwnB5g== Date: Thu, 27 Dec 2018 06:23:05 +0000 Message-ID: <20181227062233.30781-10-hemant.agrawal@nxp.com> References: <20181227062233.30781-1-hemant.agrawal@nxp.com> In-Reply-To: <20181227062233.30781-1-hemant.agrawal@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [14.143.30.134] x-mailer: git-send-email 2.17.1 x-clientproxiedby: BM1PR01CA0120.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:40::14) To VI1PR0401MB2541.eurprd04.prod.outlook.com (2603:10a6:800:56::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR0401MB2382; 6:nbiwIKiMPjZBvl4WJs5p0SSJjsce0ABbjQryz1cBUjBZhnnZonLag7HRlQRwNEku2nVFZ3hAVayjZaA/ox9k2aGwLQo77UMZy8cXwCkT0CTfBiOBWkuwUlXga5Vvt8fQGO5/Rgp39YbUUiiVbwd62fx5QdGVkcj4qAnjKVjJbIYSY66KIAVjXCFSY8zkdaMoB/PQAkEGEO1kv+bXkxQrnhBR/MRjLvIqWJxP0C/rw+ZaXiNVW92XoL3BvrkfhEOBn49PAnZytVVk+SDV9cIWSe9ihmTUHGEgNLBCJgFsxRsEa6StPbsU5p+qoZ0vGqhvp14cxL4AHkMtOBECW8w/+0qFB8sEQtpYvlr7kuMPJmxRoeM/0JgsoEsVlcR3akVd/a9fDpDQqmJPOk1Gs4yPZwn+UOcbbn9k1y7bRDfFQ9dJg1hZ61Y44n9rNq9KchO/XjLiHkApnx18XsaSQP7hJg==; 5:AsBM6hEP5rcI+hNav2l5h3RDjWmWae/O3Y0uFGuq8DanN7qVuk3L/6j+wIGAgyTL/GJFeJtqDAdUVlDoa932y33Cf8OX7SHTvVjcWpdRni//bniRxbqFYCHw5SvfGlvRGtGYS1Ax+fYB0ljvilFRMm326uNKmFUEW3g2wyIYhFo=; 7:GjeV7Zooe4cIVkLl8KYXOnFaYY4FWVr6Kfs53/5FPl1YqrMLBuXhy60KKggsAYDF2vy8gLvNfKsvXdZh40xKUW1YSmTkbVJaJURO85UraCYyCJIEiuVJihhxhEv8IbyqjNe51mNbNHdj8WsRQLUSzA== x-ms-office365-filtering-correlation-id: d512e965-42ac-4c0d-c246-08d66bc3c29f x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR0401MB2382; x-ms-traffictypediagnostic: VI1PR0401MB2382: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(2401047)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231475)(944501520)(52105112)(6055026)(6041310)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:VI1PR0401MB2382; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0401MB2382; x-forefront-prvs: 0899B47777 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(396003)(366004)(376002)(39860400002)(346002)(199004)(189003)(5660300001)(1076003)(26005)(76176011)(186003)(71200400001)(256004)(25786009)(105586002)(4326008)(6436002)(305945005)(11346002)(106356001)(14444005)(446003)(44832011)(476003)(7736002)(55236004)(102836004)(78486014)(486006)(386003)(68736007)(52116002)(86362001)(6506007)(2616005)(71190400001)(66066001)(316002)(54906003)(6116002)(3846002)(2906002)(14454004)(36756003)(99286004)(50226002)(8936002)(1730700003)(81156014)(81166006)(8676002)(6512007)(53936002)(478600001)(97736004)(6486002)(6916009)(5640700003)(2351001)(2501003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0401MB2382; H:VI1PR0401MB2541.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: /bTeRlmBLh4WosqMD6DadX2NlU4mQxiqNSFM3kQdSUfR5s+HPixRUN2xQoTp1viwSQV0N3BUt0J6wkY6oxSQMznovu5BLHlIA+ZfCQEd2hN71I6BivacT9yWlpTmtQefQv4e/keVaylYZdf2SDz++bhWYUYjBSTrEi9zX3fjT04VRX9gG+cmLhx8LrItxcVjYC3uI3xseU+y5UdHoybCKOEZ1k93blKFIPRpN4wt0CJTtFVnyPmCtkBGH6t7yq+NQYt58v85l9XCDbAtSkwpwEIn5QIpwsTSDer9+r/HFik6tdW9rNOK0tRvHUT5yNhB spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d512e965-42ac-4c0d-c246-08d66bc3c29f X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Dec 2018 06:23:05.1454 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2382 Subject: [dpdk-dev] [PATCH 09/20] 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" 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) {