From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0085.outbound.protection.outlook.com [104.47.41.85]) by dpdk.org (Postfix) with ESMTP id 722E71BEF8; Wed, 27 Jun 2018 13:48:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+IYJwWJcOjytuNaltklFpXYtpRlqtE1dBnaERGI6dgI=; b=N4IpUeT/IibfGYb5qumK+tgWXh9lyOwdyJ+jDjDg+fb861zkh5Ya5O4FzFU/twTAK9y4DGVAth3YeyUvRCRXL9rTBDWe9SSTAqhrsrHDrpbY5ieuuJSe8GnYZPy7MJFnwPNESTL4//A1RCQwvGVglrCy0Jzc02PyCIMEK6lmPE8= Received: from localhost.localdomain (111.93.218.67) by CY4PR07MB3463.namprd07.prod.outlook.com (2603:10b6:910:75::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.884.24; Wed, 27 Jun 2018 11:48:08 +0000 From: Pavan Nikhilesh To: jerin.jacob@caviumnetworks.com, santosh.shukla@caviumnetworks.com, olivier.matz@6wind.com Cc: dev@dpdk.org, stable@dpdk.org, Pavan Nikhilesh Date: Wed, 27 Jun 2018 17:17:36 +0530 Message-Id: <20180627114736.29484-1-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BM1PR0101CA0031.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:1a::17) To CY4PR07MB3463.namprd07.prod.outlook.com (2603:10b6:910:75::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c4bee9d8-1c4b-4b14-ee6a-08d5dc23dbd6 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(8989117)(5600026)(711020)(2017052603328)(7153060)(7193020); SRVR:CY4PR07MB3463; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3463; 3:dxyfpmxdccDX6bRKLEHdSaLzoTzcI+wADPoKEpv8mX1v833Wu63GAErrKz4jt/u/hSSxhfoUWeNLI+wTNb216d8cuEMI76HNYCvvhrvj8nZIf9QUQghlB4aL/iYo5QIlaKr7AyV9LQtYYMO9wn8mvlzRjaIknLPtpAp8BKKTi+FukNw+awPnhnhw1tiWC6G5grDfq5xWO2rtkHK9dJSi7mF2UHnGzAYlx9N9dG4OKJbY/Y4pQvXDQ2u50xDBatNA; 25:3+NsA9cXY2h+n/FCpUIttAmLDpNCK4lCu8+IjY4rxTxz50Myit41EBh7PZ2fmeT4SrvMIg6XW4TFxsVW/EjGlWW3/aasTRxiHdoY93kLYqGlmwiVvRZebRoYYuIR2wKHQfAUkN9ltrhgWL1eAgZ9L+Uapdz/T0u38m5q8YG+dEWmAwBiRCvG+Px+DScGyFtcd5v3gEwzrvf3SdZV+5KPPW3mjzTop9GgtraAPllw35h+P49OU8adWhUZ0wKx4ytQ0zVgohBqVlqiwdbYzeE4D8m00IcnEebXYfSbR+fBcRLo3udwEH+jEaOHWQlMYLRyJOvvnxMXKyMVWJugrPDI6g==; 31:+2LYhEaSrR6MWr7gokd/Ihap5cRBdYRl1S3kZ/8vY4YSgprbWx4AmfvmGBDNElJMH9nSoYDsQDeuvRMI30Zq9YcSfRe/TB51PeCU/Z47BvRqpSx9Yi3/HtaQSyCwIkE9lhOSz+qaOPdAJD9ClyUyTAFUWPrMt7M7aM4nOxMptWxKJUQgpogWKHv1jEx7CUjDi0HBnSUprjBGqOjKwEV+f9xy/ciYggG5F9sHd3d/Si4= X-MS-TrafficTypeDiagnostic: CY4PR07MB3463: X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3463; 20:1dOJJFhbm6n9EqtUUyEBXiGaDS0fkO++ARCIimgoNqy2UKUTt1tDRIILNY6Qyo3se+YBTlnf0EWOwOO0vhVdU2+khDCEbkquQNqQ7NrUSvipjOeH7vV7ZE9zZo2g/xKipsAjNn/imh9/uXDrIiRBYH5p2mxTexaADG7ZK+fNWHxeivLgx8noQhuaQwyIKHuLwbFuUZ6TvWcwI2vE7XxTAWkfk2lwj89fMbKdrYWeEEuEEUAAKLNds4EKa0XcFHdZ5fp6W3lPsOjggSvHf9OQXjdKrX4jZIwndZgScI3KTyVuhRvekI7TMOAQvZl1lSc9lu+oIvRdbSWfnKl3jBcvyqPZmqMrXjpHMsMO7ZWAlprYvJC3t32PnyNUu6VfvMlVcX/un27j0OtxEMtH7s4hckNrUMJPBWjmNu495tkXATKirLUP5Ko2ZqFPrROQl9kJQ88wqDbHbi2t7UixvOpF/iEnx8+aHPSSge6LRc0GNdeG0DcYoWi4At4y4o61KGe/qofkfRH2aptA6MKrfYDS3SfH4DkFUqL4+hFpY2q8YH67dr8kRd/H/iMPkIzGjmmzrLx4IYzHd/n0wWkKg1qSpWwJgH38Dz8dhw50orYsil4=; 4:ikdxSLL/VEyHRoeyXKoo14szlyEYXEfcennDxuf3A/3p8KatllHpegSUkviL9Qxl3brdhE4OSwkqUiJzi+Vez6GKL/pWiKECe94cvVJ1cJVPx1C9ws48g8jGZBosUDwqv9CME+SuJ5zgKQIJWZZYqVaiYHAOeGGN2MQ9PCbaJMBFckVIJKi6vtwBbkN4uZWTA/feeAvD8NzS7yN9DHBn6kyW4Eg9gtiRUxBLrkziba2wV1oD2j3oqn/RsCGC4FH6FJC0Zld6O6eBZ0YvzNZMyQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(3231254)(944501410)(52105095)(10201501046)(93006095)(149027)(150027)(6041310)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:CY4PR07MB3463; BCL:0; PCL:0; RULEID:; SRVR:CY4PR07MB3463; X-Forefront-PRVS: 0716E70AB6 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(366004)(39860400002)(136003)(376002)(346002)(396003)(189003)(199004)(2616005)(5660300001)(6666003)(81156014)(42882007)(1857600001)(316002)(72206003)(6486002)(5009440100003)(8936002)(6512007)(8676002)(81166006)(7736002)(6116002)(3846002)(1076002)(305945005)(2906002)(486006)(476003)(956004)(6346003)(25786009)(36756003)(97736004)(4326008)(106356001)(48376002)(478600001)(66066001)(107886003)(16586007)(6506007)(386003)(53936002)(68736007)(47776003)(51416003)(14444005)(5024004)(16526019)(52116002)(26005)(105586002)(50466002)(50226002)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3463; H:localhost.localdomain; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR07MB3463; 23:qpqjvILtxzV4dGO6U0zhUZjefQVmWx7F1f9rabbt7?= =?us-ascii?Q?uYesZQ33eN4AEFoDAXO2k18H9VeKE6ExDko23W3kMWCZMLGCsOulCGQ6YOgH?= =?us-ascii?Q?ukVaOjNsodE2nLe4HGRZaZC3Ib2nS2G25CWmZujK6cch4AH7exPRuQ0LCp00?= =?us-ascii?Q?XlhUsC9Hz//WLIg8Tps+8DJSJaRHvr7Sj1lsAYYKn5U8CF9eH5unfRwNo4FQ?= =?us-ascii?Q?+h7s+3oTRySbdSmQYMnW2uFjYt4ti0Sc2b2igqAVAtNsDKE/JTrGa9NJi1vl?= =?us-ascii?Q?J4g1kGbWd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KdtscLOSsWeIpLQibBBtr36cwliFiuiaybeihb79cFRPqN3kto2yPIoI4eVxvRacx6tIDiEKmUoDHfMooBLGEjc4Zi07IA3lfiADwuVsiyk5+NNgTDq+epoNZ3SdcmdnChybIRAZZQybGH71ymqNgDk8=; 24:58+2Cl7R+Feo4LrWcE8MpWNty3jdUNjm7EWnYfxihuI5uZ1qSji2olpbpK3/yKmuXotBGcwJ7TNzjmNMFvme4k3nT/kSDrIJf29tvMsQKRE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3463; 7:F07+6P68JNn/1aIWOmkY8Xmvt6NDg3fte4EYGjOjS26OWdk+SyQaslyua7TyyCb82t4Bn0/I8m9EYhdSObvaYWPUM/FBKG+lyuq86TW6LnbtzV/c4Pu0H2iBg70YMvNzDvVG6PS3xowtcgp02EWwH9O+YVqBYJh+NOsrmvALKHXAiSkZXqlPDVeiVhaCvdd5jEK71yD8a+Jd12ZNj80eYaJsvfrIkIoBF2TdqyJa/dNiIFyjrDMPhoYFtBKyb1YM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2018 11:48:08.9468 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c4bee9d8-1c4b-4b14-ee6a-08d5dc23dbd6 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3463 Subject: [dpdk-dev] [PATCH] mempool/octeontx: fix pool to aura mapping 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: Wed, 27 Jun 2018 11:48:13 -0000 HW needs each pool to be mapped to an aura set of 16 auras. Previously, pool to aura mapping was considered to be 1:1. Fixes: 02fd6c744350 ("mempool/octeontx: support allocation") Cc: stable@dpdk.org Signed-off-by: Pavan Nikhilesh --- drivers/event/octeontx/timvf_evdev.c | 2 +- drivers/mempool/octeontx/octeontx_fpavf.c | 45 ++++++++++++++--------- drivers/mempool/octeontx/octeontx_fpavf.h | 8 ++++ drivers/net/octeontx/octeontx_ethdev.c | 4 +- drivers/net/octeontx/octeontx_rxtx.c | 2 +- 5 files changed, 40 insertions(+), 21 deletions(-) diff --git a/drivers/event/octeontx/timvf_evdev.c b/drivers/event/octeontx/timvf_evdev.c index c4fbd2d86..8a045c250 100644 --- a/drivers/event/octeontx/timvf_evdev.c +++ b/drivers/event/octeontx/timvf_evdev.c @@ -174,7 +174,7 @@ timvf_ring_start(const struct rte_event_timer_adapter *adptr) if (use_fpa) { pool = (uintptr_t)((struct rte_mempool *) timr->chunk_pool)->pool_id; - ret = octeontx_fpa_bufpool_gpool(pool); + ret = octeontx_fpa_bufpool_gaura(pool); if (ret < 0) { timvf_log_dbg("Unable to get gaura id"); ret = -ENOMEM; diff --git a/drivers/mempool/octeontx/octeontx_fpavf.c b/drivers/mempool/octeontx/octeontx_fpavf.c index 7aecaa85d..e931cf055 100644 --- a/drivers/mempool/octeontx/octeontx_fpavf.c +++ b/drivers/mempool/octeontx/octeontx_fpavf.c @@ -243,7 +243,7 @@ octeontx_fpapf_pool_setup(unsigned int gpool, unsigned int buf_size, POOL_LTYPE(0x2) | POOL_STYPE(0) | POOL_SET_NAT_ALIGN | POOL_ENA; - cfg.aid = 0; + cfg.aid = gpool << FPA_GAURA_SHIFT; cfg.pool_cfg = reg; cfg.pool_stack_base = phys_addr; cfg.pool_stack_end = phys_addr + memsz; @@ -327,7 +327,7 @@ octeontx_fpapf_aura_attach(unsigned int gpool_index) hdr.vfid = gpool_index; hdr.res_code = 0; memset(&cfg, 0x0, sizeof(struct octeontx_mbox_fpa_cfg)); - cfg.aid = gpool_index; /* gpool is guara */ + cfg.aid = gpool_index << FPA_GAURA_SHIFT; ret = octeontx_mbox_send(&hdr, &cfg, sizeof(struct octeontx_mbox_fpa_cfg), @@ -335,7 +335,8 @@ octeontx_fpapf_aura_attach(unsigned int gpool_index) if (ret < 0) { fpavf_log_err("Could not attach fpa "); fpavf_log_err("aura %d to pool %d. Err=%d. FuncErr=%d\n", - gpool_index, gpool_index, ret, hdr.res_code); + gpool_index << FPA_GAURA_SHIFT, gpool_index, ret, + hdr.res_code); ret = -EACCES; goto err; } @@ -355,14 +356,15 @@ octeontx_fpapf_aura_detach(unsigned int gpool_index) goto err; } - cfg.aid = gpool_index; /* gpool is gaura */ + cfg.aid = gpool_index << FPA_GAURA_SHIFT; hdr.coproc = FPA_COPROC; hdr.msg = FPA_DETACHAURA; hdr.vfid = gpool_index; ret = octeontx_mbox_send(&hdr, &cfg, sizeof(cfg), NULL, 0); if (ret < 0) { fpavf_log_err("Couldn't detach FPA aura %d Err=%d FuncErr=%d\n", - gpool_index, ret, hdr.res_code); + gpool_index << FPA_GAURA_SHIFT, ret, + hdr.res_code); ret = -EINVAL; } @@ -469,6 +471,7 @@ octeontx_fpa_bufpool_free_count(uintptr_t handle) { uint64_t cnt, limit, avail; uint8_t gpool; + uint8_t gaura; uintptr_t pool_bar; if (unlikely(!octeontx_fpa_handle_valid(handle))) @@ -476,14 +479,16 @@ octeontx_fpa_bufpool_free_count(uintptr_t handle) /* get the gpool */ gpool = octeontx_fpa_bufpool_gpool(handle); + /* get the aura */ + gaura = octeontx_fpa_bufpool_gaura(handle); /* Get pool bar address from handle */ pool_bar = handle & ~(uint64_t)FPA_GPOOL_MASK; cnt = fpavf_read64((void *)((uintptr_t)pool_bar + - FPA_VF_VHAURA_CNT(gpool))); + FPA_VF_VHAURA_CNT(gaura))); limit = fpavf_read64((void *)((uintptr_t)pool_bar + - FPA_VF_VHAURA_CNT_LIMIT(gpool))); + FPA_VF_VHAURA_CNT_LIMIT(gaura))); avail = fpavf_read64((void *)((uintptr_t)pool_bar + FPA_VF_VHPOOL_AVAILABLE(gpool))); @@ -496,6 +501,7 @@ octeontx_fpa_bufpool_create(unsigned int object_size, unsigned int object_count, unsigned int buf_offset, int node_id) { unsigned int gpool; + unsigned int gaura; uintptr_t gpool_handle; uintptr_t pool_bar; int res; @@ -545,16 +551,18 @@ octeontx_fpa_bufpool_create(unsigned int object_size, unsigned int object_count, goto error_pool_destroy; } + gaura = gpool << FPA_GAURA_SHIFT; + /* Release lock */ rte_spinlock_unlock(&fpadev.lock); /* populate AURA registers */ fpavf_write64(object_count, (void *)((uintptr_t)pool_bar + - FPA_VF_VHAURA_CNT(gpool))); + FPA_VF_VHAURA_CNT(gaura))); fpavf_write64(object_count, (void *)((uintptr_t)pool_bar + - FPA_VF_VHAURA_CNT_LIMIT(gpool))); + FPA_VF_VHAURA_CNT_LIMIT(gaura))); fpavf_write64(object_count + 1, (void *)((uintptr_t)pool_bar + - FPA_VF_VHAURA_CNT_THRESHOLD(gpool))); + FPA_VF_VHAURA_CNT_THRESHOLD(gaura))); octeontx_fpapf_start_count(gpool); @@ -581,6 +589,7 @@ octeontx_fpa_bufpool_destroy(uintptr_t handle, int node_id) uint64_t sz; uint64_t cnt, avail; uint8_t gpool; + uint8_t gaura; uintptr_t pool_bar; int ret; @@ -594,13 +603,15 @@ octeontx_fpa_bufpool_destroy(uintptr_t handle, int node_id) /* get the pool */ gpool = octeontx_fpa_bufpool_gpool(handle); + /* get the aura */ + gaura = octeontx_fpa_bufpool_gaura(handle); /* Get pool bar address from handle */ pool_bar = handle & ~(uint64_t)FPA_GPOOL_MASK; /* Check for no outstanding buffers */ cnt = fpavf_read64((void *)((uintptr_t)pool_bar + - FPA_VF_VHAURA_CNT(gpool))); + FPA_VF_VHAURA_CNT(gaura))); if (cnt) { fpavf_log_dbg("buffer exist in pool cnt %" PRId64 "\n", cnt); return -EBUSY; @@ -613,9 +624,9 @@ octeontx_fpa_bufpool_destroy(uintptr_t handle, int node_id) /* Prepare to empty the entire POOL */ fpavf_write64(avail, (void *)((uintptr_t)pool_bar + - FPA_VF_VHAURA_CNT_LIMIT(gpool))); + FPA_VF_VHAURA_CNT_LIMIT(gaura))); fpavf_write64(avail + 1, (void *)((uintptr_t)pool_bar + - FPA_VF_VHAURA_CNT_THRESHOLD(gpool))); + FPA_VF_VHAURA_CNT_THRESHOLD(gaura))); /* Empty the pool */ /* Invalidate the POOL */ @@ -627,11 +638,11 @@ octeontx_fpa_bufpool_destroy(uintptr_t handle, int node_id) /* Yank a buffer from the pool */ node = (void *)(uintptr_t) fpavf_read64((void *) - (pool_bar + FPA_VF_VHAURA_OP_ALLOC(gpool))); + (pool_bar + FPA_VF_VHAURA_OP_ALLOC(gaura))); if (node == NULL) { fpavf_log_err("GAURA[%u] missing %" PRIx64 " buf\n", - gpool, avail); + gaura, avail); break; } @@ -665,9 +676,9 @@ octeontx_fpa_bufpool_destroy(uintptr_t handle, int node_id) /* Deactivate the AURA */ fpavf_write64(0, (void *)((uintptr_t)pool_bar + - FPA_VF_VHAURA_CNT_LIMIT(gpool))); + FPA_VF_VHAURA_CNT_LIMIT(gaura))); fpavf_write64(0, (void *)((uintptr_t)pool_bar + - FPA_VF_VHAURA_CNT_THRESHOLD(gpool))); + FPA_VF_VHAURA_CNT_THRESHOLD(gaura))); ret = octeontx_fpapf_aura_detach(gpool); if (ret) { diff --git a/drivers/mempool/octeontx/octeontx_fpavf.h b/drivers/mempool/octeontx/octeontx_fpavf.h index b76f40e75..b97ce98c3 100644 --- a/drivers/mempool/octeontx/octeontx_fpavf.h +++ b/drivers/mempool/octeontx/octeontx_fpavf.h @@ -14,6 +14,7 @@ #define FPA_VF_MAX 32 #define FPA_GPOOL_MASK (FPA_VF_MAX-1) +#define FPA_GAURA_SHIFT 4 /* FPA VF register offsets */ #define FPA_VF_INT(x) (0x200ULL | ((x) << 22)) @@ -102,4 +103,11 @@ octeontx_fpa_bufpool_gpool(uintptr_t handle) { return (uint8_t)handle & FPA_GPOOL_MASK; } + +static __rte_always_inline uint8_t +octeontx_fpa_bufpool_gaura(uintptr_t handle) +{ + return octeontx_fpa_bufpool_gpool(handle) << FPA_GAURA_SHIFT; +} + #endif /* __OCTEONTX_FPAVF_H__ */ diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c index 1eb453b21..a3f2b471f 100644 --- a/drivers/net/octeontx/octeontx_ethdev.c +++ b/drivers/net/octeontx/octeontx_ethdev.c @@ -898,8 +898,8 @@ octeontx_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t qidx, pool = (uintptr_t)mb_pool->pool_id; - /* Get the gpool Id */ - gaura = octeontx_fpa_bufpool_gpool(pool); + /* Get the gaura Id */ + gaura = octeontx_fpa_bufpool_gaura(pool); pki_qos.qpg_qos = PKI_QPG_QOS_NONE; pki_qos.num_entry = 1; diff --git a/drivers/net/octeontx/octeontx_rxtx.c b/drivers/net/octeontx/octeontx_rxtx.c index 2502d90e9..a9149b4e1 100644 --- a/drivers/net/octeontx/octeontx_rxtx.c +++ b/drivers/net/octeontx/octeontx_rxtx.c @@ -31,7 +31,7 @@ __octeontx_xmit_pkts(void *lmtline_va, void *ioreg_va, int64_t *fc_status_va, return -ENOSPC; /* Get the gaura Id */ - gaura_id = octeontx_fpa_bufpool_gpool((uintptr_t)tx_pkt->pool->pool_id); + gaura_id = octeontx_fpa_bufpool_gaura((uintptr_t)tx_pkt->pool->pool_id); /* Setup PKO_SEND_HDR_S */ cmd_buf[0] = tx_pkt->data_len & 0xffff; -- 2.17.1