From patchwork Fri Jan 11 12:24:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shreyansh Jain X-Patchwork-Id: 155344 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp517084jaa; Fri, 11 Jan 2019 04:26:14 -0800 (PST) X-Google-Smtp-Source: ALg8bN6iwDkSa3P1Ij8rJT9R1F+QUs3rcwro2ZJRY+WVhl9+SSEucXyKVB/TwTbODsrV23FVqhT6 X-Received: by 2002:a1c:c2d4:: with SMTP id s203mr2120740wmf.3.1547209574033; Fri, 11 Jan 2019 04:26:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547209574; cv=none; d=google.com; s=arc-20160816; b=GryaYtUDM+2VHu9ymjUtIbCOHgb21YgBwcVuxOXB7a7wS75rp0wVilLEAgxkTTGHbC iQIqxlYzqYVjF6Qx5/tzxhRIpTB9096CQpCXpuj24Qxt5uUZICAvHpmOVSZA4xwJtpbK QMuzVub0wcEhzjBksFRCLFILGNnbrDzLUSN2vb5UYxlFg6bMOMVuvE72YgNcCjlJbVBT wXXCCh9zowhfrsqI7XvpsNc9C0TRsiBFG2qfuy+z1XyBbqMv2cZlculn4mYFFykDzjww QRILEuENV1b+nUexIJ++L97faDKkx4406W/aMhGkWCNTWW/2SPVT3AEvRnTbbPraeAcW GfUw== 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=ZwIGfMC7Pa/Rr0Bbbfx996w9wTR9OZI77X6uZhXmIT4=; b=HBHJxqbKDQYWODXNEDVqU/Kgmhvs+Iv95fsPG5/ktlrJaQNINH87wDIt72MevBKfBw 3YA4NY+eW62Yk6qLpNty5ZFeaK70GX/sfFfLGl50e6Hu0zatzqzAa9sS6Z+weOFoPtEr amguw3KeueW6NL9im/Jr9Y9hPwp+VC+3D1HNShvvl4YDbl+M87uqBhlbL0kKMY0rvnbQ R7hweZ9IEM9/R6epmG4/Y1bWH4StF+SUs57JkgsPvQ6U7jZKE+Zc5xx5Y3TaRRHJDO7v b6t89C+5UiH5+c2Bm3WW/fdbC0iWv+8n62kmjlH2giYdHRvbasSfRKRyU9KLeX4cftxK Tj8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b="xBn//A8E"; 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 z17si43654366wrp.53.2019.01.11.04.26.13; Fri, 11 Jan 2019 04:26:14 -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="xBn//A8E"; 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 7B3CB1BC00; Fri, 11 Jan 2019 13:24:45 +0100 (CET) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130085.outbound.protection.outlook.com [40.107.13.85]) by dpdk.org (Postfix) with ESMTP id E0E6B1BC00 for ; Fri, 11 Jan 2019 13:24:43 +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=ZwIGfMC7Pa/Rr0Bbbfx996w9wTR9OZI77X6uZhXmIT4=; b=xBn//A8EtfYONwYJ+SrPqps+AZpJf11QC+wiRotUua2DQzeCC6jju1jxUy67U9E376vNKIX2U95n/3AxYPP1B6wcbxvDF2tR8TBoxVH5dzTYaYMTG1H46DbuWuSKVvCjjPYwBLsqkxbf/tSLinyasO+Ne9gCuZ8IUEpWBkcnTP0= Received: from VI1PR04MB4688.eurprd04.prod.outlook.com (20.177.56.80) by VI1PR04MB5455.eurprd04.prod.outlook.com (20.178.121.149) 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:42 +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:42 +0000 From: Shreyansh Jain To: "dev@dpdk.org" CC: "ferruh.yigit@intel.com" , Hemant Agrawal , Youri Querry Thread-Topic: [PATCH v3 11/19] bus/fslmc: rename portal pi index to consumer index Thread-Index: AQHUqaih4NLgaFtYRUyBkSkXwCHT/A== Date: Fri, 11 Jan 2019 12:24:42 +0000 Message-ID: <20190111122305.7133-12-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; VI1PR04MB5455; 6:uyzzGJUPlWHemRzopTsr0gQQS69D9KAHSpelr3eGzbXinCpxXHVP7yfdc39U4ZUvq1SaoE8XvzGx/PuZ9vvN815uybzVgk2ZXbXn3LTpV3ND9l6e/JzJvqx+uCvbGmCVXA68RCbNrJhGX+Is24LfuM2bSwd/EDyJuyAwnAzC+e4Q599WzJqc2WOCpPvAbAD8DbLmfH7PZlttE++vNIjkbegAoxd+6LwTgifiQXpKJcbQG+j1wtAwYdzCZc+XiLNVnZCasFrCWZTPxIsNS24xAyP4CVfJlrSOMTRvsWXrcuAs52shcs8VZ938JkmX3JihazMnGapFF0I329oRDHafdjWemc6Vn990GCwt1poUn17Qa4dhj+g2hENK6ZVHcszCCelroH9rgtyd0J4bJQyx996vHp1M4NJnY02uyBo8dnMsqV+qVekabeCuwdBZCLECxRX4B1TwJFv0B+j0ACaT9Q==; 5:uB7fLFrna/5OO3yA2Z34F7Gi5ogAomXv5DeGKd+U0yOwJcVOZOkcuzWO6yCMyxkVrBhPt7c8ZlcWVr59ut1k/HH5atU8GmHRE0OyXJQ8RYK+TGSHVGEt4AjrBO+mLlkCmcf6KnJbL3BFGwv6hVZwqWgg3sPlEYfPEO4xT3jJ9Gnu+2L1tzzXiQd1/ZZvrg273fxKfYHnONz3sudfQwy/6w==; 7:3HBJAROF4TKQhwN8N+Q0cZ8Qg/Jp9F5PAdB1uA1Cep7WCzqYs05DkwnUXW5SUgWBzjrULfuUJRA3q6lpGaPNaMrvjvzvznf9RP2DP3GHIhKvu4B11hFWHteGOB6iEQn0pa3AGAsr80n0wumWAX9wQw== x-ms-office365-filtering-correlation-id: 826ac6df-0e5b-432d-1c42-08d677bfc346 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:VI1PR04MB5455; x-ms-traffictypediagnostic: VI1PR04MB5455: x-microsoft-antispam-prvs: x-forefront-prvs: 09144DB0F7 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(366004)(376002)(39860400002)(396003)(346002)(189003)(199004)(66066001)(186003)(575784001)(86362001)(71200400001)(2351001)(71190400001)(55236004)(386003)(36756003)(6506007)(26005)(99286004)(105586002)(6116002)(14444005)(106356001)(102836004)(2906002)(54906003)(5660300001)(3846002)(256004)(8936002)(97736004)(78486014)(50226002)(2501003)(6486002)(305945005)(6436002)(14454004)(7736002)(8676002)(316002)(1730700003)(81166006)(81156014)(5640700003)(4326008)(2616005)(446003)(6916009)(478600001)(1076003)(52116002)(6512007)(44832011)(486006)(76176011)(53936002)(11346002)(68736007)(476003)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB5455; H:VI1PR04MB4688.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A: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: b5UBf3uYXyGC+uWf1Sgr03hw2Sjdf+Y/WxOk0rpBOkz+by9sPc42ZEbnwoKN2Sxb/ZzsiJz/MMqDxrkhcqqNAgZgCIM8HdVNPF3qXQWiTHvS/n83NOik2F1N2W7fZG5fH9uVQyjZRbdRr2EwPtzv62xAUL7hM1k0qNkksa0D12s2r4ZxhyfxeJZLQKhrSliksT0YXAXACl5WtIFXgMF4dXyt6MDQtg4cu0AMcVXXZfLMATBUzZGhHiZ1LS7rUmN+2EqW52nhbEBEFDrIrnBfCuCj6UbVNyhIbYKbB99dM2mObCDMjVC1gMlavbKJADkthQIR79JYOXpO4aa6zu1lwD1BEfmfDWa8mppXPdq9HXH17aLybA9wR1KrAUZLaL2Wl2SwxQZSy/7EgO1hIXY2uiEzIdV71M+4/gNM6Mxkzr0= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 826ac6df-0e5b-432d-1c42-08d677bfc346 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Jan 2019 12:24:39.0635 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5455 Subject: [dpdk-dev] [PATCH v3 11/19] 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" From: Hemant Agrawal 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(-) -- 2.17.1 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;