From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM05-DM3-obe.outbound.protection.outlook.com (mail-eopbgr730070.outbound.protection.outlook.com [40.107.73.70]) by dpdk.org (Postfix) with ESMTP id C310B2C17; Mon, 2 Jul 2018 11:15:19 +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=8iO710yD4iWvmCTjmwEgGMAIdGz/iUxQaErdkSL2a38=; b=FsBUqCRR36Lqn2DV9FQdSTOtNXz73ly7VfN5d1LrZbFQ+wmAIQGSrBDOYRbih46Mr1j+PjRP+5WZj+/M+e/JKpQv36sepcqFNqS0tHHA44eMqMuFR24doAjsVSxcH6AXPKLFeBYKzz+ANK4xJ1nIq6/NiSeuAkSIn81Z5jwDb/E= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin (50.233.148.155) by CO2PR07MB2519.namprd07.prod.outlook.com (2603:10b6:102:13::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.906.24; Mon, 2 Jul 2018 09:15:14 +0000 Date: Mon, 2 Jul 2018 14:45:06 +0530 From: Jerin Jacob To: Pavan Nikhilesh Cc: santosh.shukla@caviumnetworks.com, olivier.matz@6wind.com, dev@dpdk.org, stable@dpdk.org Message-ID: <20180702091504.GA13965@jerin> References: <20180627114736.29484-1-pbhagavatula@caviumnetworks.com> <20180702062932.1548-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180702062932.1548-1-pbhagavatula@caviumnetworks.com> User-Agent: Mutt/1.10.0 (2018-05-17) X-Originating-IP: [50.233.148.155] X-ClientProxiedBy: BYAPR02CA0051.namprd02.prod.outlook.com (2603:10b6:a03:54::28) To CO2PR07MB2519.namprd07.prod.outlook.com (2603:10b6:102:13::6) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 23c1e8c5-6650-4794-6ee7-08d5dffc5358 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(2017052603328)(7153060)(7193020); SRVR:CO2PR07MB2519; X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB2519; 3:gbfHKJ0BhxGtw9PhBir3lcC3E9Dg5IwXR5o+cuKH/7cwqJTwu0rqtvYACmYgiZ8FJZy0AGRhUkc/Ew8PiYLvYFUiBhVgS1E3N2bzDyzFZw+XmGrbJdxfH9bFbuhwS7AI2NSr+oBHDx1Q7VEf4wA+E1hQTWF6zyvIO6H2jgZQJH5V7+mPS9pcYc+J3ZmggsVa64W72ph0iNzHBDkyNs1rjk4X7kbYVkH9NKtyY/Cr2wSGmBHV+4gImkFQUhJGQ855; 25:9Z6oo6i8obdFDxMlYJGi+K7xUwQ2u8gq0Hflrme73WBb5osirB1U5oW5z1TY9NURTO+aU5qyZyVzKTIphpFt7bYg5oMc7NbkxvrObNZeueMyyWyVdq0elSXNdHYgUHq9Due3+UKjzzadLw410PNnuLSFnzHZMxFW/kWJAtsHGP8GjJVr9+fQVTMHhHB2vzNJbTUgpZMVcw6yMbhe3/rpvjI6S/MNEKPeRea7u/ZQPtwwZgdQxWe2A/XYqQ8YWylKhDA8zqcFd+VbZz34nQXMXivqDyARaSdVjc7itgbfVJ8LWg28VT8dUyURvO1lHm8EDHm2mHefzfpLUwiHidnhSA==; 31:f/11cB8ttWcVhFJlBCD8U0+OV3ntNLbk1N5bf03ad/sYrlwnkoD5hQPVElOrct7p+yfkOJO9zp3quIrgD51pU5sW0f0G1SN5OCTf6n9hXh57pULe9vvBvGfwfTfYhEVZCdodK+Y/3MtPFX+Qd+TijxI+Y2h/GzOz70zDyg66s0dBF0s3QlRhUl8EDNwiycCHS6wCfaygwWScXWeyW8p+38QkLpxZoNlY1z9DosQpsR4= X-MS-TrafficTypeDiagnostic: CO2PR07MB2519: X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB2519; 20:j+8xTWO/6uYAjwSGt2DZrgZ9KtOMN3fcWZF/ksV1NoX+JmSd5WOe2Ovlm0nWZQkDAHXlSjY+QM1P2hDFkntiw9nmZB/Mox6B8kUSgz31XsGQ8DJjcaviKXJh959Hi5cA3X72klWl9+iHO+EVGjnmte1HfD51ZCZXGfLHG7Vtv8h32h17DJCYjuFMifDegcr719xzMWErqj612lzkV55ixK3odeuAhWeY0piAW1tfm1a57mwahXoEYy1X0Iv7uc/GaMW6HazIUBpP3KTuETna+higvfnO4bFvDd3/4eJgWS6aj/SAw1ZD9UE52g1fq50e5EurV2Dp5fqy8wrdYPPeIDNE01w36T7ri0Axb630tveh6A4YD6hsx/SjDyam+dUXCZWktcRKvzzJ9aydnASftC98QXuTqvKcSfot8JoEClOEz2gsJDfHuF5saVflBCrtIdnl2gAi7ZejgkeiilfTfjt9m+CtDgDm+YdRNVTKxCtXRweXxm/QIclnyQ9tHl/YlwLU6Dll0QE3QBA0s/R/LMy28N3YmuwOlKF+1a3df0Q/60xRUtPvPKgw/0cHLC8b0CyaH9+l1ZtLX4nmSJo0IZ0lqFf1pchmpJtAkVdc5oU=; 4:BjVtaXHmYskjfTQ0ew+wrRUXBdoaQ5mMR/e92WRDlHTetBDVHSM6rr+5ES/t8djNLAqZ/dis0RcDrS5hoO5ybXmNOw/rY2OaMkoUQ3OSLJK4v2NDq8Dtkmoh4qaAAtA1O1P2HMmV9hwQ9kVujEUFDQPlhe3LE07IdiFEl1/SIbe7K2Iqrjzjj+ZuPQ3UN1LlwmIHWtq3NhhOfl+9BIsZJQuEd3yaWNmJRvGMQCSTTOOhSDe7YhwDZkZvGunFSiSzMPJ0sQHWPBxsJG0vSfHaGA== 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)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123558120)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:CO2PR07MB2519; BCL:0; PCL:0; RULEID:; SRVR:CO2PR07MB2519; X-Forefront-PRVS: 07215D0470 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(376002)(136003)(39860400002)(346002)(396003)(13464003)(189003)(199004)(305945005)(4326008)(476003)(6636002)(6862004)(81166006)(33896004)(81156014)(3846002)(6116002)(68736007)(1076002)(16586007)(76176011)(44832011)(23726003)(6496006)(316002)(229853002)(33656002)(42882007)(52116002)(486006)(26005)(55016002)(72206003)(8676002)(6666003)(8936002)(97736004)(5660300001)(9686003)(6246003)(106356001)(25786009)(50466002)(14444005)(5024004)(47776003)(66066001)(386003)(7736002)(2906002)(11346002)(105586002)(33716001)(53936002)(956004)(478600001)(16526019)(446003)(58126008)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR07MB2519; H:jerin; 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) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO2PR07MB2519; 23:4TMORfS6cvuvWvYb/Cqce/y8RCF/eCQn4XBzq9S4H?= =?us-ascii?Q?xO7ZCNTXtnBCIEzcD2qCr+3o+vcx4db7dUaGd02ea6O+HxXOLw/SM8Ht2Zi+?= =?us-ascii?Q?uzPzOk3oGpcr2r32aKtXYP/z5eH+klxAOHNAgVeVNxXPE9h6OmRcWm4OJQXW?= =?us-ascii?Q?PnYrAK/tOT3/gyK3+R5V+Vyy4ldx0L6ochNJ074ET22uIDmzjc1m1PeQohgU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hYznu6hvQbpL/dHNXpbPNXB02IjwOHBJRe6kzaHjyrnrvQxh2pR24ECd7vCD6E4wLd+YVvuHN6pV/kIFIG2T4RDd03CMRGT7/SWvxM1ymrQ//3vvjePTMZI2VS863Q0ossLxMB4nv7iScs/FzmxIsDu+w+z+Gc1pX2JxTWaw==; 5:3JWOIbuMrs/+vrMo4MD1Xw0Iu1Opwi3jRkfDf5T8tqs75P45T+BlOuv70cyjBWxeGlX1G03a63Ycb+aPSNSAqqCtTexDZlE5e/BCSjFB8DITHQ2GcUTQE50bISs8cR5qOnBwHUcIsGMs1S72tKmh1PrbdWJzI8OqFZvQdWrxp8A=; 24:Qdfr25SeMLmTaEkL+mpykTjoQHxdvGgMuMlbCvt4euBElcegWCR8cOJuE2W4oU21a6U0/u6s77zih2Rf4rJYvt0Mj6A/Ilv00tzOIcfOjHY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB2519; 7:PTSMOiqe9Zx1OWp5fkc+Of9n20oFBVki8v+mvYE47ECwGsjLDagCQ88M392Qz1xWGqxfJ6st1LNhrXt2O/UJDZh3pjfP0PVN1e6up4BEz0Zir5ZgJWNmMwKDZBBPkzdGz8rlHn2h8LRphIj9TrvCq/eRgU9/Vd6fqTTI9S1ceferPuRp9I6bu4IKA+s1ExwpeEhsRHWscj5rEoLAJor8m+G9HJzCjE3ZJbXYtrGq+uzetDs+dh0Espv0EiHt1S3A X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jul 2018 09:15:14.0999 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 23c1e8c5-6650-4794-6ee7-08d5dffc5358 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR07MB2519 Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH v2] mempool/octeontx: fix pool to aura mapping X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2018 09:15:20 -0000 -----Original Message----- > Date: Mon, 2 Jul 2018 11:59:32 +0530 > 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 > > Subject: [dpdk-dev] [PATCH v2] mempool/octeontx: fix pool to aura mapping > X-Mailer: git-send-email 2.18.0 > > 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 > --- > v2 Changes: > - use macro to avoid code duplication (Santosh). > - use uint16_t for gaura id. > > 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..e5918c866 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 = 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; > + 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 >