From patchwork Thu Dec 27 06:23:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 49299 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 33D8E5B3A; Thu, 27 Dec 2018 07:23:20 +0100 (CET) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140084.outbound.protection.outlook.com [40.107.14.84]) by dpdk.org (Postfix) with ESMTP id 63B6B5689 for ; Thu, 27 Dec 2018 07:23:09 +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=9CuOq796UjiJQbUIFpBH2AAxFTj/0nyzLS+l5XC//DA=; b=k26UTk2BIXpMavAtKhmUBrmMw0iv/FUO6/ASxOHELEn94r7ZijVKg/GSbQvvSLiPnwt/hxHQ9mPKT9xZdLQXYOpiWRTPv4OoXYvJmCfoef1tGWS4yBqz7Y8fL27ke7L8dWhBspqNL4SBIkLxZoHzItpxTTQGmeQ1o/I/Oy+OC18= 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:08 +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:08 +0000 From: Hemant Agrawal To: "dev@dpdk.org" CC: "ferruh.yigit@intel.com" , Shreyansh Jain , Youri Querry Thread-Topic: [PATCH 11/20] bus/fslmc: rename portal pi index to consumer index Thread-Index: AQHUnayiIT6BsRrKw0qXGAwMptZ4Mg== Date: Thu, 27 Dec 2018 06:23:08 +0000 Message-ID: <20181227062233.30781-12-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:uyX0FLKuMJ5Jqy9GcO8mlQ6TfBEt3bIql67YAzR+kZYRHX/hJtMkt+ZDFqAPFLCENUtFVjI2lXmYHt6h4yrsHUiTei4SDHPjigudsYpFG3mkZVKQFxEA92C21Xb+Mn5wUPAG73lx6dfUjcHb8z6l7OZ32hfm5VRYCT3qjfmLKdvrrplxrLOGBsrXKDozb3wOuCq0mUJBRr4tYJup/fdHJXlJeUrLjnyC3IxH3I2x+adBmkBkrBuFJhvNiYDXVokNi5Fw+f8JDP3vEohskyO7bwx34PqO/QiI1qsRkuG+wkA/9LEQqVvO2y7jBOsk7BpRaYtNKYdjN1ycWWkRKU6D6Q5+VKYkHcKEqxdZbRRfe/ydzpwteBFzuc7dDHFIN5UJuUZi/o/Qa/3+dsJvH9JYPqgSWJlzB4/UtCA76TQCngvQSda8LUPiZVo+lcT/PEwqIGmSr3Iz04Z/sjCDxE2Qsg==; 5:T+8PFyEMiyCMzZ6TDwjXzEYfybV9xnmFW4gE1XYOynvJ38pNH1EEOqPwIm11c30HgK5NLadWYEh5yoSgbEonBjDGebnfn4ElN95/eQPARX9jhe9flP3cmRHYTDW3Ki3SAqe7BlNZZdKDJd6liWtYtK7d1ybwKrf92L4y5i6JBPU=; 7:tLLFiHbnYKHoUcS90jpT6sLUGWOrKbK/a1g/M41371hwIZp4pMbuGr+37a43s/MiLOIMzOMsmN65LBWYgeEJyucDyx80Ujs/hZetJnSqbndwfP9CrAZpP/WAOAoYNXPbov3stjL6045z+x2R89nccA== x-ms-office365-filtering-correlation-id: 0ce76b5a-3d08-40d1-a796-08d66bc3c48f 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)(575784001)(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: uLtThg0PzY/mZsSLa4VVOC1Fx4WUDNJykK4vOtA4sURPo2ZwNa1zJoQqze5VLv2+Uxt4JahxXxAa4oSHMMnxYS660O16PzP6UHiFt1h30imFM/ZHJ22jnLLW1BmK+aCuNnwWhHPkcjZVI46ymjlkPNIO1XgI+s6MOqEXbgdNMvW5AKedf9yNOqobfAVL9d+MLbNmX1ObM/faqc7FtQMGk03pN1O612fBxOeLPo0G313rAQOv10JaRnfD3edirSD0ZBOYUMChlSVlxB+Zxe+QsTbrK63Od/JzO/SfY9MHieHdJRu8mj/YUTPyYRSrPXv3 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0ce76b5a-3d08-40d1-a796-08d66bc3c48f X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Dec 2018 06:23:08.3328 (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 11/20] bus/fslmc: rename portal pi index to consumer index 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 is to align with the latest qbman hw library Signed-off-by: Youri Querry Signed-off-by: Hemant Agrawal --- drivers/bus/fslmc/qbman/qbman_portal.c | 51 +++++++++++--------------- drivers/bus/fslmc/qbman/qbman_portal.h | 2 +- 2 files changed, 23 insertions(+), 30 deletions(-) diff --git a/drivers/bus/fslmc/qbman/qbman_portal.c b/drivers/bus/fslmc/qbman/qbman_portal.c index 08bfdc9f8..14f4b0344 100644 --- a/drivers/bus/fslmc/qbman/qbman_portal.c +++ b/drivers/bus/fslmc/qbman/qbman_portal.c @@ -251,21 +251,21 @@ struct qbman_swp *qbman_swp_init(const struct qbman_swp_desc *d) } for (mask_size = p->eqcr.pi_ring_size; mask_size > 0; mask_size >>= 1) - p->eqcr.pi_mask = (p->eqcr.pi_mask<<1) + 1; + p->eqcr.pi_ci_mask = (p->eqcr.pi_ci_mask<<1) + 1; eqcr_pi = qbman_cinh_read(&p->sys, QBMAN_CINH_SWP_EQCR_PI); - p->eqcr.pi = eqcr_pi & p->eqcr.pi_mask; + p->eqcr.pi = eqcr_pi & p->eqcr.pi_ci_mask; p->eqcr.pi_vb = eqcr_pi & QB_VALID_BIT; if ((p->desc.qman_version & QMAN_REV_MASK) >= QMAN_REV_5000 && (d->cena_access_mode == qman_cena_fastest_access)) - p->eqcr.ci = qbman_cinh_read(&p->sys, - QBMAN_CINH_SWP_EQCR_CI) & p->eqcr.pi_mask; + p->eqcr.ci = qbman_cinh_read(&p->sys, QBMAN_CINH_SWP_EQCR_PI) + & p->eqcr.pi_ci_mask; else - p->eqcr.ci = qbman_cinh_read(&p->sys, - QBMAN_CINH_SWP_EQCR_PI) & p->eqcr.pi_mask; + p->eqcr.ci = qbman_cinh_read(&p->sys, QBMAN_CINH_SWP_EQCR_CI) + & p->eqcr.pi_ci_mask; p->eqcr.available = p->eqcr.pi_ring_size - qm_cyc_diff(p->eqcr.pi_ring_size, - p->eqcr.ci & (p->eqcr.pi_mask<<1), - p->eqcr.pi & (p->eqcr.pi_mask<<1)); + p->eqcr.ci & (p->eqcr.pi_ci_mask<<1), + p->eqcr.pi & (p->eqcr.pi_ci_mask<<1)); portal_idx_map[p->desc.idx] = p; return p; @@ -646,8 +646,8 @@ static int qbman_swp_enqueue_ring_mode_direct(struct qbman_swp *s, const uint32_t *cl = qb_cl(d); uint32_t eqcr_ci, full_mask, half_mask; - half_mask = (s->eqcr.pi_mask>>1); - full_mask = s->eqcr.pi_mask; + half_mask = (s->eqcr.pi_ci_mask>>1); + full_mask = s->eqcr.pi_ci_mask; if (!s->eqcr.available) { eqcr_ci = s->eqcr.ci; s->eqcr.ci = qbman_cena_read_reg(&s->sys, @@ -685,8 +685,8 @@ static int qbman_swp_enqueue_ring_mode_mem_back(struct qbman_swp *s, const uint32_t *cl = qb_cl(d); uint32_t eqcr_ci, full_mask, half_mask; - half_mask = (s->eqcr.pi_mask>>1); - full_mask = s->eqcr.pi_mask; + half_mask = (s->eqcr.pi_ci_mask>>1); + full_mask = s->eqcr.pi_ci_mask; if (!s->eqcr.available) { eqcr_ci = s->eqcr.ci; s->eqcr.ci = qbman_cena_read_reg(&s->sys, @@ -743,8 +743,8 @@ static int qbman_swp_enqueue_multiple_direct(struct qbman_swp *s, int i, num_enqueued = 0; uint64_t addr_cena; - half_mask = (s->eqcr.pi_mask>>1); - full_mask = s->eqcr.pi_mask; + half_mask = (s->eqcr.pi_ci_mask>>1); + full_mask = s->eqcr.pi_ci_mask; if (!s->eqcr.available) { eqcr_ci = s->eqcr.ci; s->eqcr.ci = qbman_cena_read_reg(&s->sys, @@ -811,8 +811,8 @@ static int qbman_swp_enqueue_multiple_mem_back(struct qbman_swp *s, uint32_t eqcr_ci, eqcr_pi, half_mask, full_mask; int i, num_enqueued = 0; - half_mask = (s->eqcr.pi_mask>>1); - full_mask = s->eqcr.pi_mask; + half_mask = (s->eqcr.pi_ci_mask>>1); + full_mask = s->eqcr.pi_ci_mask; if (!s->eqcr.available) { eqcr_ci = s->eqcr.ci; s->eqcr.ci = qbman_cena_read_reg(&s->sys, @@ -833,15 +833,6 @@ static int qbman_swp_enqueue_multiple_mem_back(struct qbman_swp *s, QBMAN_CENA_SWP_EQCR(eqcr_pi & half_mask)); memcpy(&p[1], &cl[1], 28); memcpy(&p[8], &fd[i], sizeof(*fd)); - eqcr_pi++; - } - - /* Set the verb byte, have to substitute in the valid-bit */ - eqcr_pi = s->eqcr.pi; - for (i = 0; i < num_enqueued; i++) { - p = qbman_cena_write_start_wo_shadow(&s->sys, - QBMAN_CENA_SWP_EQCR(eqcr_pi & half_mask)); - p[0] = cl[0] | s->eqcr.pi_vb; if (flags && (flags[i] & QBMAN_ENQUEUE_FLAG_DCA)) { struct qbman_eq_desc *d = (struct qbman_eq_desc *)p; @@ -849,6 +840,8 @@ static int qbman_swp_enqueue_multiple_mem_back(struct qbman_swp *s, ((flags[i]) & QBMAN_EQCR_DCA_IDXMASK); } eqcr_pi++; + p[0] = cl[0] | s->eqcr.pi_vb; + if (!(eqcr_pi & half_mask)) s->eqcr.pi_vb ^= QB_VALID_BIT; } @@ -880,8 +873,8 @@ static int qbman_swp_enqueue_multiple_desc_direct(struct qbman_swp *s, int i, num_enqueued = 0; uint64_t addr_cena; - half_mask = (s->eqcr.pi_mask>>1); - full_mask = s->eqcr.pi_mask; + half_mask = (s->eqcr.pi_ci_mask>>1); + full_mask = s->eqcr.pi_ci_mask; if (!s->eqcr.available) { eqcr_ci = s->eqcr.ci; s->eqcr.ci = qbman_cena_read_reg(&s->sys, @@ -943,8 +936,8 @@ static int qbman_swp_enqueue_multiple_desc_mem_back(struct qbman_swp *s, uint32_t eqcr_ci, eqcr_pi, half_mask, full_mask; int i, num_enqueued = 0; - half_mask = (s->eqcr.pi_mask>>1); - full_mask = s->eqcr.pi_mask; + half_mask = (s->eqcr.pi_ci_mask>>1); + full_mask = s->eqcr.pi_ci_mask; if (!s->eqcr.available) { eqcr_ci = s->eqcr.ci; s->eqcr.ci = qbman_cena_read_reg(&s->sys, diff --git a/drivers/bus/fslmc/qbman/qbman_portal.h b/drivers/bus/fslmc/qbman/qbman_portal.h index 3b0fc540b..e54f2661c 100644 --- a/drivers/bus/fslmc/qbman/qbman_portal.h +++ b/drivers/bus/fslmc/qbman/qbman_portal.h @@ -98,7 +98,7 @@ struct qbman_swp { uint32_t pi; uint32_t pi_vb; uint32_t pi_ring_size; - uint32_t pi_mask; + uint32_t pi_ci_mask; uint32_t ci; int available; } eqcr;