From: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
To: dev@dpdk.org
Cc: Randy Schacher <stuart.schacher@broadcom.com>
Subject: [dpdk-dev] [PATCH v3 11/13] net/bnxt: dynamically allocate space for EM defrag function
Date: Sat, 11 Sep 2021 21:00:39 +0530 [thread overview]
Message-ID: <20210911153041.28510-12-venkatkumar.duvvuru@broadcom.com> (raw)
In-Reply-To: <20210911153041.28510-1-venkatkumar.duvvuru@broadcom.com>
From: Randy Schacher <stuart.schacher@broadcom.com>
Alter defrag function to dynamically allocate and delete
free_list and adj_list buffers.
Signed-off-by: Randy Schacher <stuart.schacher@broadcom.com>
Reviewed-by: Peter Spreadborough <peter.spreadborough@broadcom.com>
---
drivers/net/bnxt/tf_core/dpool.c | 38 +++++++++++++++++++++-----------
1 file changed, 25 insertions(+), 13 deletions(-)
diff --git a/drivers/net/bnxt/tf_core/dpool.c b/drivers/net/bnxt/tf_core/dpool.c
index 145efa486f..5c03f775a5 100644
--- a/drivers/net/bnxt/tf_core/dpool.c
+++ b/drivers/net/bnxt/tf_core/dpool.c
@@ -7,9 +7,6 @@
#include <stdbool.h>
#include <stdint.h>
#include <errno.h>
-
-#include <rte_malloc.h>
-
#include "tfp.h"
#include "dpool.h"
@@ -84,13 +81,13 @@ static int dpool_move(struct dpool *dpool,
return 0;
}
-
int dpool_defrag(struct dpool *dpool,
uint32_t entry_size,
uint8_t defrag)
{
struct dpool_free_list *free_list;
struct dpool_adj_list *adj_list;
+ struct tfp_calloc_parms parms;
uint32_t count;
uint32_t index;
uint32_t used;
@@ -103,15 +100,31 @@ int dpool_defrag(struct dpool *dpool,
uint32_t max_size = 0;
int rc;
- free_list = rte_zmalloc("dpool_free_list",
- sizeof(struct dpool_free_list), 0);
+ parms.nitems = 1;
+ parms.size = sizeof(struct dpool_free_list);
+ parms.alignment = 0;
+
+ rc = tfp_calloc(&parms);
+
+ if (rc)
+ return rc;
+
+ free_list = (struct dpool_free_list *)parms.mem_va;
if (free_list == NULL) {
TFP_DRV_LOG(ERR, "dpool free list allocation failed\n");
return -ENOMEM;
}
- adj_list = rte_zmalloc("dpool_adjacent_list",
- sizeof(struct dpool_adj_list), 0);
+ parms.nitems = 1;
+ parms.size = sizeof(struct dpool_adj_list);
+ parms.alignment = 0;
+
+ rc = tfp_calloc(&parms);
+
+ if (rc)
+ return rc;
+
+ adj_list = (struct dpool_adj_list *)parms.mem_va;
if (adj_list == NULL) {
TFP_DRV_LOG(ERR, "dpool adjacent list allocation failed\n");
return -ENOMEM;
@@ -239,8 +252,8 @@ int dpool_defrag(struct dpool *dpool,
free_list->entry[largest_free_index].index,
max_index);
if (rc) {
- rte_free(free_list);
- rte_free(adj_list);
+ tfp_free(free_list);
+ tfp_free(adj_list);
return rc;
}
} else {
@@ -249,12 +262,11 @@ int dpool_defrag(struct dpool *dpool,
}
done:
- rte_free(free_list);
- rte_free(adj_list);
+ tfp_free(free_list);
+ tfp_free(adj_list);
return largest_free_size;
}
-
uint32_t dpool_alloc(struct dpool *dpool,
uint32_t size,
uint8_t defrag)
--
2.17.1
next prev parent reply other threads:[~2021-09-11 15:32 UTC|newest]
Thread overview: 83+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-01 14:24 [dpdk-dev] [PATCH 00/14] enhancements to host based flow table management Venkat Duvvuru
2021-09-01 14:24 ` [dpdk-dev] [PATCH 01/14] net/bnxt: tf core index table updates Venkat Duvvuru
2021-09-01 14:24 ` [dpdk-dev] [PATCH 02/14] net/bnxt: enable dpool allocator Venkat Duvvuru
2021-09-01 14:24 ` [dpdk-dev] [PATCH 03/14] net/bnxt: add flow meter drop counter support Venkat Duvvuru
2021-09-01 14:24 ` [dpdk-dev] [PATCH 04/14] net/bnxt: add Thor SRAM mgr model Venkat Duvvuru
2021-09-01 14:24 ` [dpdk-dev] [PATCH 05/14] net/bnxt: add flow templates support for Thor Venkat Duvvuru
2021-09-01 14:24 ` [dpdk-dev] [PATCH 06/14] net/bnxt: add support for tunnel offloads Venkat Duvvuru
2021-09-01 14:24 ` [dpdk-dev] [PATCH 07/14] net/bnxt: add support for dynamic encap action Venkat Duvvuru
2021-09-01 14:24 ` [dpdk-dev] [PATCH 08/14] net/bnxt: add wild card TCAM byte order for Thor Venkat Duvvuru
2021-09-01 14:24 ` [dpdk-dev] [PATCH 09/14] net/bnxt: add flow templates " Venkat Duvvuru
2021-09-01 14:24 ` [dpdk-dev] [PATCH 10/14] net/bnxt: tf core SRAM Manager Venkat Duvvuru
2021-09-01 14:24 ` [dpdk-dev] [PATCH 11/14] net/bnxt: dynamically allocate space for EM defrag function Venkat Duvvuru
2021-09-01 14:24 ` [dpdk-dev] [PATCH 12/14] net/bnxt: sram manager shared session Venkat Duvvuru
2021-09-01 14:24 ` [dpdk-dev] [PATCH 13/14] net/bnxt: add enhancements to TF ULP Venkat Duvvuru
2021-09-01 14:24 ` [dpdk-dev] [PATCH 14/14] net/bnxt: add support for testpmd co-existence Venkat Duvvuru
2021-09-08 5:06 ` [dpdk-dev] [PATCH v2 00/13] enhancements to host based flow table management Venkat Duvvuru
2021-09-08 5:06 ` [dpdk-dev] [PATCH v2 01/13] net/bnxt: tf core index table updates Venkat Duvvuru
2021-09-08 5:06 ` [dpdk-dev] [PATCH v2 02/13] net/bnxt: enable dpool allocator Venkat Duvvuru
2021-09-08 5:06 ` [dpdk-dev] [PATCH v2 03/13] net/bnxt: add flow meter drop counter support Venkat Duvvuru
2021-09-08 5:06 ` [dpdk-dev] [PATCH v2 04/13] net/bnxt: add Thor SRAM mgr model Venkat Duvvuru
2021-09-08 5:06 ` [dpdk-dev] [PATCH v2 05/13] net/bnxt: add flow templates support for Thor Venkat Duvvuru
2021-09-08 5:06 ` [dpdk-dev] [PATCH v2 06/13] net/bnxt: add support for tunnel offloads Venkat Duvvuru
2021-09-08 5:06 ` [dpdk-dev] [PATCH v2 07/13] net/bnxt: add support for dynamic encap action Venkat Duvvuru
2021-09-08 5:06 ` [dpdk-dev] [PATCH v2 08/13] net/bnxt: add wild card TCAM byte order for Thor Venkat Duvvuru
2021-09-08 5:06 ` [dpdk-dev] [PATCH v2 09/13] net/bnxt: add flow templates " Venkat Duvvuru
2021-09-08 5:06 ` [dpdk-dev] [PATCH v2 10/13] net/bnxt: tf core SRAM Manager Venkat Duvvuru
2021-09-08 5:06 ` [dpdk-dev] [PATCH v2 11/13] net/bnxt: dynamically allocate space for EM defrag function Venkat Duvvuru
2021-09-08 5:06 ` [dpdk-dev] [PATCH v2 12/13] net/bnxt: sram manager shared session Venkat Duvvuru
2021-09-08 5:06 ` [dpdk-dev] [PATCH v2 13/13] net/bnxt: add enhancements to TF ULP Venkat Duvvuru
2021-09-11 15:30 ` [dpdk-dev] [PATCH v3 00/13] enhancements to host based flow table management Venkat Duvvuru
2021-09-11 15:30 ` [dpdk-dev] [PATCH v3 01/13] net/bnxt: tf core index table updates Venkat Duvvuru
2021-09-16 13:47 ` Ferruh Yigit
2021-09-16 15:51 ` Ajit Khaparde
2021-09-11 15:30 ` [dpdk-dev] [PATCH v3 02/13] net/bnxt: enable dpool allocator Venkat Duvvuru
2021-09-11 15:30 ` [dpdk-dev] [PATCH v3 03/13] net/bnxt: add flow meter drop counter support Venkat Duvvuru
2021-09-11 15:30 ` [dpdk-dev] [PATCH v3 04/13] net/bnxt: add Thor SRAM mgr model Venkat Duvvuru
2021-09-16 13:49 ` Ferruh Yigit
2021-09-16 14:01 ` Bruce Richardson
2021-09-16 14:04 ` Thomas Monjalon
2021-09-16 16:29 ` Venkat Duvvuru
2021-09-16 16:30 ` Ferruh Yigit
2021-09-11 15:30 ` [dpdk-dev] [PATCH v3 05/13] net/bnxt: add flow templates support for Thor Venkat Duvvuru
2021-09-11 15:30 ` [dpdk-dev] [PATCH v3 06/13] net/bnxt: add support for tunnel offloads Venkat Duvvuru
2021-09-11 15:30 ` [dpdk-dev] [PATCH v3 07/13] net/bnxt: add support for dynamic encap action Venkat Duvvuru
2021-09-11 15:30 ` [dpdk-dev] [PATCH v3 08/13] net/bnxt: add wild card TCAM byte order for Thor Venkat Duvvuru
2021-09-11 15:30 ` [dpdk-dev] [PATCH v3 09/13] net/bnxt: add flow templates " Venkat Duvvuru
2021-09-11 15:30 ` [dpdk-dev] [PATCH v3 10/13] net/bnxt: tf core SRAM Manager Venkat Duvvuru
2021-09-11 15:30 ` Venkat Duvvuru [this message]
2021-09-16 13:53 ` [dpdk-dev] [PATCH v3 11/13] net/bnxt: dynamically allocate space for EM defrag function Ferruh Yigit
2021-09-11 15:30 ` [dpdk-dev] [PATCH v3 12/13] net/bnxt: sram manager shared session Venkat Duvvuru
2021-09-11 15:30 ` [dpdk-dev] [PATCH v3 13/13] net/bnxt: add enhancements to TF ULP Venkat Duvvuru
2021-09-16 14:06 ` Ferruh Yigit
2021-09-16 3:25 ` [dpdk-dev] [PATCH v3 00/13] enhancements to host based flow table management Ajit Khaparde
2021-09-16 13:26 ` Ferruh Yigit
2021-09-16 14:17 ` Brandon Lo
2021-09-16 16:18 ` Ajit Khaparde
2021-09-20 7:42 ` [dpdk-dev] [PATCH v4 " Venkat Duvvuru
2021-09-20 7:42 ` [dpdk-dev] [PATCH v4 01/13] net/bnxt: updates to TF core index table Venkat Duvvuru
2021-09-20 7:42 ` [dpdk-dev] [PATCH v4 02/13] net/bnxt: enable dpool allocator Venkat Duvvuru
2021-09-20 7:42 ` [dpdk-dev] [PATCH v4 03/13] net/bnxt: add flow meter drop counter support Venkat Duvvuru
2021-09-20 7:42 ` [dpdk-dev] [PATCH v4 04/13] net/bnxt: add SRAM manager model Venkat Duvvuru
2021-09-20 7:42 ` [dpdk-dev] [PATCH v4 05/13] net/bnxt: add flow template support for Thor Venkat Duvvuru
2021-09-20 7:42 ` [dpdk-dev] [PATCH v4 06/13] net/bnxt: add support for tunnel offload API Venkat Duvvuru
2021-09-28 12:43 ` Ferruh Yigit
2021-09-28 15:46 ` Thomas Monjalon
2021-09-28 15:57 ` Ferruh Yigit
2021-09-28 21:32 ` Ajit Khaparde
2021-09-29 8:20 ` Thomas Monjalon
2021-09-29 9:44 ` Ferruh Yigit
2021-09-29 16:44 ` Ajit Khaparde
2021-09-20 7:42 ` [dpdk-dev] [PATCH v4 07/13] net/bnxt: add support for dynamic encap action Venkat Duvvuru
2021-09-20 7:42 ` [dpdk-dev] [PATCH v4 08/13] net/bnxt: add wild card TCAM byte order for Thor Venkat Duvvuru
2021-09-20 7:42 ` [dpdk-dev] [PATCH v4 09/13] net/bnxt: add flow templates " Venkat Duvvuru
2021-09-20 7:42 ` [dpdk-dev] [PATCH v4 10/13] net/bnxt: change log level to debug Venkat Duvvuru
2021-09-20 7:42 ` [dpdk-dev] [PATCH v4 11/13] net/bnxt: dynamically allocate space for EM defrag function Venkat Duvvuru
2021-09-20 7:42 ` [dpdk-dev] [PATCH v4 12/13] net/bnxt: add SRAM manager shared session Venkat Duvvuru
2021-09-20 7:42 ` [dpdk-dev] [PATCH v4 13/13] net/bnxt: add enhancements to TF ULP Venkat Duvvuru
2021-09-21 4:50 ` [dpdk-dev] [PATCH v4 00/13] enhancements to host based flow table management Ajit Khaparde
2021-09-22 17:36 ` Ferruh Yigit
2021-09-22 20:21 ` Ajit Khaparde
2021-09-23 7:19 ` Ferruh Yigit
2021-09-25 14:24 ` [dpdk-dev] [PATCH] net/bnxt: remove code to initialize SRAM slice node Ajit Khaparde
2021-09-27 10:25 ` Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210911153041.28510-12-venkatkumar.duvvuru@broadcom.com \
--to=venkatkumar.duvvuru@broadcom.com \
--cc=dev@dpdk.org \
--cc=stuart.schacher@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).