From: Ajit Khaparde <ajit.khaparde@broadcom.com>
To: dev@dpdk.org
Cc: Mike Baucom <michael.baucom@broadcom.com>,
Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Subject: [dpdk-dev] [PATCH v2 06/12] net/bnxt: aggregate ulp mapper create arguments
Date: Fri, 17 Apr 2020 09:19:14 -0700 [thread overview]
Message-ID: <20200417161920.85858-7-ajit.khaparde@broadcom.com> (raw)
In-Reply-To: <20200417161920.85858-1-ajit.khaparde@broadcom.com>
From: Mike Baucom <michael.baucom@broadcom.com>
The changes are to the ulp mapper flow_create, the API changed
to take the bnxt_ulp_mapper_create_parms structure instead of individual
fields.
Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Mike Baucom <michael.baucom@broadcom.com>
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
---
drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c | 19 +++++++-------
drivers/net/bnxt/tf_ulp/ulp_mapper.c | 33 +++++++++++--------------
drivers/net/bnxt/tf_ulp/ulp_mapper.h | 20 +++++++++------
3 files changed, 37 insertions(+), 35 deletions(-)
diff --git a/drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c b/drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c
index 026f33f66..9326401b4 100644
--- a/drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c
+++ b/drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c
@@ -67,11 +67,11 @@ bnxt_ulp_flow_create(struct rte_eth_dev *dev,
const struct rte_flow_action actions[],
struct rte_flow_error *error)
{
+ struct bnxt_ulp_mapper_create_parms mapper_cparms = { 0 };
struct ulp_rte_parser_params params;
struct bnxt_ulp_context *ulp_ctx = NULL;
uint32_t class_id, act_tmpl;
struct rte_flow *flow_id;
- uint32_t app_priority;
uint32_t fid;
uint8_t *buffer;
uint32_t vnic;
@@ -125,16 +125,17 @@ bnxt_ulp_flow_create(struct rte_eth_dev *dev,
if (ret != BNXT_TF_RC_SUCCESS)
goto parse_error;
- app_priority = attr->priority;
+ mapper_cparms.app_priority = attr->priority;
+ mapper_cparms.hdr_bitmap = ¶ms.hdr_bitmap;
+ mapper_cparms.hdr_field = params.hdr_field;
+ mapper_cparms.act = ¶ms.act_bitmap;
+ mapper_cparms.act_prop = ¶ms.act_prop;
+ mapper_cparms.class_tid = class_id;
+ mapper_cparms.act_tid = act_tmpl;
+
/* call the ulp mapper to create the flow in the hardware */
ret = ulp_mapper_flow_create(ulp_ctx,
- app_priority,
- ¶ms.hdr_bitmap,
- params.hdr_field,
- ¶ms.act_bitmap,
- ¶ms.act_prop,
- class_id,
- act_tmpl,
+ &mapper_cparms,
&fid);
if (!ret) {
flow_id = (struct rte_flow *)((uintptr_t)fid);
diff --git a/drivers/net/bnxt/tf_ulp/ulp_mapper.c b/drivers/net/bnxt/tf_ulp/ulp_mapper.c
index f787c6e4d..f70afa47f 100644
--- a/drivers/net/bnxt/tf_ulp/ulp_mapper.c
+++ b/drivers/net/bnxt/tf_ulp/ulp_mapper.c
@@ -1411,26 +1411,23 @@ ulp_mapper_flow_destroy(struct bnxt_ulp_context *ulp_ctx, uint32_t fid)
*/
int32_t
ulp_mapper_flow_create(struct bnxt_ulp_context *ulp_ctx,
- uint32_t app_priority __rte_unused,
- struct ulp_rte_hdr_bitmap *hdr_bitmap __rte_unused,
- struct ulp_rte_hdr_field *hdr_field,
- struct ulp_rte_act_bitmap *act_bitmap,
- struct ulp_rte_act_prop *act_prop,
- uint32_t class_tid,
- uint32_t act_tid,
- uint32_t *flow_id)
+ struct bnxt_ulp_mapper_create_parms *cparms,
+ uint32_t *flowid)
{
- struct ulp_regfile regfile;
- struct bnxt_ulp_mapper_parms parms;
- struct bnxt_ulp_device_params *device_params;
- int32_t rc, trc;
+ struct bnxt_ulp_device_params *device_params;
+ struct bnxt_ulp_mapper_parms parms;
+ struct ulp_regfile regfile;
+ int32_t rc, trc;
+
+ if (!ulp_ctx || !cparms)
+ return -EINVAL;
/* Initialize the parms structure */
memset(&parms, 0, sizeof(parms));
- parms.act_prop = act_prop;
- parms.act_bitmap = act_bitmap;
+ parms.act_prop = cparms->act_prop;
+ parms.act_bitmap = cparms->act;
parms.regfile = ®file;
- parms.hdr_field = hdr_field;
+ parms.hdr_field = cparms->hdr_field;
parms.tfp = bnxt_ulp_cntxt_tfp_get(ulp_ctx);
parms.ulp_ctx = ulp_ctx;
@@ -1441,7 +1438,7 @@ ulp_mapper_flow_create(struct bnxt_ulp_context *ulp_ctx,
}
/* Get the action table entry from device id and act context id */
- parms.act_tid = act_tid;
+ parms.act_tid = cparms->act_tid;
parms.atbls = ulp_mapper_action_tbl_list_get(parms.dev_id,
parms.act_tid,
&parms.num_atbls);
@@ -1452,7 +1449,7 @@ ulp_mapper_flow_create(struct bnxt_ulp_context *ulp_ctx,
}
/* Get the class table entry from device id and act context id */
- parms.class_tid = class_tid;
+ parms.class_tid = cparms->class_tid;
parms.ctbls = ulp_mapper_class_tbl_list_get(parms.dev_id,
parms.class_tid,
&parms.num_ctbls);
@@ -1506,7 +1503,7 @@ ulp_mapper_flow_create(struct bnxt_ulp_context *ulp_ctx,
goto flow_error;
}
- *flow_id = parms.fid;
+ *flowid = parms.fid;
return rc;
diff --git a/drivers/net/bnxt/tf_ulp/ulp_mapper.h b/drivers/net/bnxt/tf_ulp/ulp_mapper.h
index 5f3d46eff..24727a32d 100644
--- a/drivers/net/bnxt/tf_ulp/ulp_mapper.h
+++ b/drivers/net/bnxt/tf_ulp/ulp_mapper.h
@@ -38,20 +38,24 @@ struct bnxt_ulp_mapper_parms {
enum bnxt_ulp_flow_db_tables tbl_idx;
};
+struct bnxt_ulp_mapper_create_parms {
+ uint32_t app_priority;
+ struct ulp_rte_hdr_bitmap *hdr_bitmap;
+ struct ulp_rte_hdr_field *hdr_field;
+ struct ulp_rte_act_bitmap *act;
+ struct ulp_rte_act_prop *act_prop;
+ uint32_t class_tid;
+ uint32_t act_tid;
+};
+
/*
* Function to handle the mapping of the Flow to be compatible
* with the underlying hardware.
*/
int32_t
ulp_mapper_flow_create(struct bnxt_ulp_context *ulp_ctx,
- uint32_t app_priority,
- struct ulp_rte_hdr_bitmap *hdr_bitmap,
- struct ulp_rte_hdr_field *hdr_field,
- struct ulp_rte_act_bitmap *act,
- struct ulp_rte_act_prop *act_prop,
- uint32_t class_tid,
- uint32_t act_tid,
- uint32_t *flow_id);
+ struct bnxt_ulp_mapper_create_parms *parms,
+ uint32_t *flowid);
/* Function that frees all resources associated with the flow. */
int32_t
--
2.21.1 (Apple Git-122.3)
next prev parent reply other threads:[~2020-04-17 16:20 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-15 14:49 [dpdk-dev] [PATCH 00/11] enhancements to host based flow table management Venkat Duvvuru
2020-04-15 14:49 ` [dpdk-dev] [PATCH 01/11] net/bnxt: SVIF changes for dpdk port id Venkat Duvvuru
2020-04-15 14:49 ` [dpdk-dev] [PATCH 02/11] net/bnxt: allow usage of more resources in flow db Venkat Duvvuru
2020-04-15 14:49 ` [dpdk-dev] [PATCH 03/11] net/bnxt: Added flow database resource iteration API Venkat Duvvuru
2020-04-15 14:49 ` [dpdk-dev] [PATCH 04/11] net/bnxt: added type of resource name to debug messages Venkat Duvvuru
2020-04-15 14:49 ` [dpdk-dev] [PATCH 05/11] net/bnxt: aggregated ulp rte parser arguments to single structure Venkat Duvvuru
2020-04-15 14:49 ` [dpdk-dev] [PATCH 06/11] net/bnxt: aggregated ulp mapper create " Venkat Duvvuru
2020-04-15 14:49 ` [dpdk-dev] [PATCH 07/11] net/bnxt: use hashing for flow template matching Venkat Duvvuru
2020-04-15 14:49 ` [dpdk-dev] [PATCH 08/11] net/bnxt: addition of session and function flow flush Venkat Duvvuru
2020-04-15 14:49 ` [dpdk-dev] [PATCH 09/11] net/bnxt: default identifiers added to ulp mapper Venkat Duvvuru
2020-04-15 14:49 ` [dpdk-dev] [PATCH 10/11] net/bnxt: cache table type added for tcam lookups Venkat Duvvuru
2020-04-15 14:49 ` [dpdk-dev] [PATCH 11/11] net/bnxt: addition of the port database Venkat Duvvuru
2020-04-17 16:19 ` [dpdk-dev] [PATCH v2 00/12] enhancements to host based flow table management Ajit Khaparde
2020-04-17 16:19 ` [dpdk-dev] [PATCH v2 01/12] net/bnxt: add SVIF changes for dpdk port id Ajit Khaparde
2020-04-17 16:19 ` [dpdk-dev] [PATCH v2 02/12] net/bnxt: allow usage of more resources in flow db Ajit Khaparde
2020-04-17 16:19 ` [dpdk-dev] [PATCH v2 03/12] net/bnxt: add flow database resource iteration API Ajit Khaparde
2020-04-17 16:19 ` [dpdk-dev] [PATCH v2 04/12] net/bnxt: add resource name type to debug messages Ajit Khaparde
2020-04-17 16:19 ` [dpdk-dev] [PATCH v2 05/12] net/bnxt: aggregate ulp rte parser arguments Ajit Khaparde
2020-04-17 16:19 ` Ajit Khaparde [this message]
2020-04-17 16:19 ` [dpdk-dev] [PATCH v2 07/12] net/bnxt: use hashing for flow template match Ajit Khaparde
2020-04-17 16:19 ` [dpdk-dev] [PATCH v2 08/12] net/bnxt: add session and function flow flush Ajit Khaparde
2020-04-17 16:19 ` [dpdk-dev] [PATCH v2 09/12] net/bnxt: add default identifiers to ulp mapper Ajit Khaparde
2020-04-17 16:19 ` [dpdk-dev] [PATCH v2 10/12] net/bnxt: add cache table type for TCAM lookup Ajit Khaparde
2020-04-17 16:19 ` [dpdk-dev] [PATCH v2 11/12] net/bnxt: add port database Ajit Khaparde
2020-04-17 16:19 ` [dpdk-dev] [PATCH v2 12/12] net/bnxt: remove redefinition of page size Ajit Khaparde
2020-04-17 21:00 ` [dpdk-dev] [PATCH v2 00/12] enhancements to host based flow table management Ajit Khaparde
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=20200417161920.85858-7-ajit.khaparde@broadcom.com \
--to=ajit.khaparde@broadcom.com \
--cc=dev@dpdk.org \
--cc=michael.baucom@broadcom.com \
--cc=venkatkumar.duvvuru@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).