From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM04-BN3-obe.outbound.protection.outlook.com (mail-eopbgr680044.outbound.protection.outlook.com [40.107.68.44]) by dpdk.org (Postfix) with ESMTP id 90A221BE59; Tue, 3 Jul 2018 06:51:21 +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=Y/3eOwjixLVxKIQUDvc2ZYcnyRFPi9FBaa5clKQ+di4=; b=iYKK60fN8L5v2iAMS+g2znNNLo/3n5gD4yy+3HlPSBmLgM1ACKK/i9OsDuALU2VeasWJUAmQvsXUARFJD/fl0nikWCO/ohicKahfOr1eeWWuGXbJzzpa9WLLCUmzN75szbHC7gxdlODC4AWvceSPs/BonKCC5blcJ3FkyneAoR8= Received: from localhost.localdomain (117.203.48.187) 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.906.25; Tue, 3 Jul 2018 04:51:16 +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: Tue, 3 Jul 2018 10:20:41 +0530 Message-Id: <20180703045041.28981-1-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180627114736.29484-1-pbhagavatula@caviumnetworks.com> References: <20180627114736.29484-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [117.203.48.187] X-ClientProxiedBy: MA1PR0101CA0058.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:20::20) To CY4PR07MB3463.namprd07.prod.outlook.com (2603:10b6:910:75::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 886e5df2-4de1-4040-a65b-08d5e0a09d91 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(2017052603328)(7153060)(7193020); SRVR:CY4PR07MB3463; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3463; 3:JuDTppj8doX7cQzmcDOhIFxFlUUkzvCcLq+ZsfgRgYFxqvYIBnSvQGtflE0vgYpq9eWTaL9+zJ3XlxmIq7JNA8fUQHKijGIAengNMyu3mO8ff0EIpeteGvM8A7GJ7hgfZ0BMOH2ae1cvjbcFigU6HlhA+RJHOI4Mc8EW9Z2ifXlHAJq+JZfATEN8F22+Wa0DW6LYNhND+vC89APJZcpnkx8RY8Wc/XoZ92xouJ2BFWnOm9XAuN4SMyctKylbRJbk; 25:SIiTDl6j0VSjriLwMGgYrJ0dqaP3n/wNdMLSRk14ZWaCrbCcMNINHbu6gGTmNBAuAWslx34qKfyRhN/Vfuio4UATOluRbEGfPXmc4u9vEVKwd+mtl7XNdrPnXo7T+nmjMbMuagYPXt4he1O1Mqpfh0YGBPIvrIZwp9JCaeVoaDyTsC7WNLIfa+68Ij2bDDyuHge+GiCehmn7K5ruSzLVeCmOYzCLoTUhphwm/NFvovVhCSWyU6uuRMMRD0a81bKkmdRdbUpaqTNqPwOyfqQQJleQpBxUHf6c6x3jKt44nifTwac713GSMWbgBYEgjKWdp0euyOwcTa8JUh1MUtoJcg==; 31:A5B/Pfpcy1FtfVRDUuDLcrPQIAPQjAx5jCxqbSxCuT6cKQjcfhpxXD6Wm+M3uv38nFWiO7YgoKdJWy14jDh4DZtWc5MxL0+CZtuwaYtgo4EvGVNLrUFQgyj6nvyUTVvsOFnwUd9eNsDAvIkxLUj/Ya4Qg0mbJ/+O6300joT92hKhm3ot7m3KbbYSFYBysBFIir0SNNkGBEpgmnEdelAxoWPze7UvRoxIi9aOXQ2va2Q= X-MS-TrafficTypeDiagnostic: CY4PR07MB3463: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3463; 20:LSuaF+2DBSZQn8CHuf/3KFILsBqkOJnUpauKsALLciidrJaS81QokS8tp221/l+yfhLCWaDoFbtKlv37FoBUlSMxDqzrRCr0IUCWpsymoxjawBhRnpxxvPTlgyDgFGRCNzewGI8nTl73sR+sKh+VCHU5Bf8YEvPJoGxg66yP5uPvIW9Aq3+2tdo/m1mU/FtrVkRlu6MPP47tzWX2gA1dKEprTAi6TKA9WKDzJDZvzkqEJqHK7r8ZtDEFVWc4mn/GhkQaJA+Y9Bpt/c7oyOze6WI5ATZ3L9FuUzYqvwHFOIcYLzjNZd2gGXNO8OYvN32qyZh7VKt6tDNhv/ZuMfdiUYWs7L1xskOwjHCG6DIcgsL1i+frQwhJo+KAI8SQ01kfM6+DWm6W964H+KZ8JP0qy9GJRgyAFrWnVlb35Djdune6ve+zwEdVgBkP4KSQHgpAKzkenBOekBm4s5DW69m8FGC6XFsxsofArrIzvN7WOe/ent/VVdcciEIYJtWigAR/mYy5Ub0AfAhsD8dDrxjFZLfLT6g99Wy7skG6SDPFlOF8F9KlNSqukeV2wsVU6s0CBz9SyxeSBjTmjLJd9xXTtEXBNQv792WD34x0rHwbNAo=; 4:CmPvpiov2SVB39t4+jR81F2cxIUCQvl/R1jSPDK9HUC9fapgoIgs/NWidlr8fPq0pz3I6ybkrPsH9/FlHjcGwnLf+Y0a3EV8f5UZR01rse94jqz4YtriMLoy/7+nvrMp7+c7iol/Aw5ucGjWdit0UUdTswTeRDm61i44C75w5JwwdaHuVbSo7LbfowRQg8XLsZhEk0P4I4Jf1ILQYoKM8YpF6VXWotJS0lYMYT8vfgAF3lNzV+Yi0Z/lOZBYLJKDWP6gD4q7nttUvj6pGkVAMw== 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)(8121501046)(5005006)(3002001)(10201501046)(93006095)(3231254)(944501410)(52105095)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:CY4PR07MB3463; BCL:0; PCL:0; RULEID:; SRVR:CY4PR07MB3463; X-Forefront-PRVS: 0722981D2A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(136003)(376002)(346002)(366004)(396003)(39860400002)(199004)(189003)(47776003)(6666003)(476003)(42882007)(316002)(8936002)(478600001)(97736004)(5660300001)(2906002)(446003)(107886003)(11346002)(8676002)(486006)(956004)(53936002)(2616005)(81156014)(16586007)(72206003)(81166006)(66066001)(6116002)(3846002)(68736007)(6512007)(50466002)(4326008)(48376002)(1076002)(25786009)(26005)(16526019)(76176011)(6506007)(36756003)(386003)(1857600001)(305945005)(7736002)(51416003)(52116002)(50226002)(5024004)(14444005)(105586002)(106356001)(6486002)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3463; H:localhost.localdomain; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR07MB3463; 23:vKWpOYDdWEQqYE//AIwDdkMqLmkU273yRMXarRlvb?= =?us-ascii?Q?A+yXmbUxP+cZY+7wvnv8OtXw/hBUQA0e4YxYQmfL5xuqWlpNgyZXvmUgKQme?= =?us-ascii?Q?Mfm2jKqaJATsjnBRFB6Exmsm4fCw9U+H6Z2jraUm1rv1zxrQY4xHKTATQyUo?= =?us-ascii?Q?S706tJ5PuF7+OYuDFYB5MdS+gp+ybdasgs6WU/BywLtmGeMvaIjhWKndxYFh?= =?us-ascii?Q?4PLP/d0DJRYafQFrvpS1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v3gnQsj57nYSBK54yRH4Vj5DT6NXjyA==; 5:BLqYSFqppsGpD15AI/nOC0GZdQExM8x3ivCEnphY/oUUmy34R1GGIEMNNQ+IYoTUhpo1Bw3zBLxVbE9Md1suDEn4uiSiUaekdEYtL7arePmEJYSLJtAtqscadj7TPdyR/JzZk9TBHaYwesv5BHk4h/YngLOuDBpoa/8okBXhF4w=; 24:qbBYhJJtBISpYUDxFny5TsJ6rWAKeIU9Xp6SZh7Gz8LtK5sqYuV9x0xnNJp32ken553a940wV+O0CPoo1vQn66JvJlOi7MD6NoT9asodJcs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3463; 7:PviUcmZsnnP3YCMZ89861XJh6lk7z8MX2U100XRst+XJrzfkBtHxvj6L3Qao8pzyzBZdnno7fbzFNHX2IFkHQhWSZKioWfuz7TrSieHNW50jgXMtPAXgKUhs5u/jfdQ9tUOR3oQVlK5c4R/+uVgElE5/At2gzsVw/+2Pdj0bodUdiVyjhI7qAzvu20+QjfSmj3wakCXVr7cP0WTwz/O810uT9LNaGC8VGWyoTSVm6tGk8Ofg3Aj8PIT6mzqRCGsE X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2018 04:51:16.1686 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 886e5df2-4de1-4040-a65b-08d5e0a09d91 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 v3] 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: Tue, 03 Jul 2018 04:51:22 -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 Acked-by: Santosh Shukla Acked-by: Jerin Jacob --- drivers/event/octeontx/timvf_evdev.c | 2 +- drivers/mempool/octeontx/octeontx_fpavf.c | 45 ++++++++++++++--------- drivers/mempool/octeontx/octeontx_fpavf.h | 9 +++++ drivers/net/octeontx/octeontx_ethdev.c | 6 +-- drivers/net/octeontx/octeontx_rxtx.c | 2 +- 5 files changed, 42 insertions(+), 22 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..c287dd799 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 = FPA_AURA_IDX(gpool); 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 = FPA_AURA_IDX(gpool_index); 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); + FPA_AURA_IDX(gpool_index), 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 = FPA_AURA_IDX(gpool_index); 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); + FPA_AURA_IDX(gpool_index), 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; + uint16_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 = FPA_AURA_IDX(gpool); + /* 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; + uint16_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..b00be137a 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)) @@ -36,6 +37,7 @@ #define FPA_VF_FREE_ADDRS_S(x, y, z) \ ((x) | (((y) & 0x1ff) << 3) | ((((z) & 1)) << 14)) +#define FPA_AURA_IDX(gpool) (gpool << FPA_GAURA_SHIFT) /* FPA VF register offsets from VF_BAR4, size 2 MByte */ #define FPA_VF_MSIX_VEC_ADDR 0x00000 #define FPA_VF_MSIX_VEC_CTL 0x00008 @@ -102,4 +104,11 @@ octeontx_fpa_bufpool_gpool(uintptr_t handle) { return (uint8_t)handle & FPA_GPOOL_MASK; } + +static __rte_always_inline uint16_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..705378186 100644 --- a/drivers/net/octeontx/octeontx_ethdev.c +++ b/drivers/net/octeontx/octeontx_ethdev.c @@ -787,7 +787,7 @@ octeontx_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t qidx, pki_qos_cfg_t pki_qos; uintptr_t pool; int ret, port; - uint8_t gaura; + uint16_t gaura; unsigned int ev_queues = (nic->ev_queues * nic->port_id) + qidx; unsigned int ev_ports = (nic->ev_ports * nic->port_id) + qidx; @@ -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.18.0