From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4A1A9A0597; Fri, 17 Apr 2020 18:20:27 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 616561EA32; Fri, 17 Apr 2020 18:19:37 +0200 (CEST) Received: from rnd-relay.smtp.broadcom.com (rnd-relay.smtp.broadcom.com [192.19.229.170]) by dpdk.org (Postfix) with ESMTP id 84D101E9CF for ; Fri, 17 Apr 2020 18:19:27 +0200 (CEST) Received: from mail-irv-17.broadcom.com (mail-irv-17.lvn.broadcom.net [10.75.242.48]) by rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id D353D30C1E3; Fri, 17 Apr 2020 09:08:06 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com D353D30C1E3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1587139686; bh=6M9c+e0TuvP2gMfcz/Gjel93WvHqNlmieEWZ4bTBiIY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DY2AWEdD0cN5YTJjOfBN0gdvqPJNC2WYOcv1bxaxLvO7HWFKhXHO10M9RV4OpTP6T 686UzYiYO0EkpXolhcNeYOY0LTUEfejC1T16Sw1I5sGLRF2OwQDZ4a06v0M67S9k7/ 7YaMX1/2KQSgAC9jrcggjueNxgjmFonGsmeGhzLY= Received: from localhost.localdomain (unknown [10.230.185.215]) by mail-irv-17.broadcom.com (Postfix) with ESMTP id 0D3B314008C; Fri, 17 Apr 2020 09:19:26 -0700 (PDT) From: Ajit Khaparde To: dev@dpdk.org Cc: Mike Baucom , Venkat Duvvuru Date: Fri, 17 Apr 2020 09:19:14 -0700 Message-Id: <20200417161920.85858-7-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.21.1 (Apple Git-122.3) In-Reply-To: <20200417161920.85858-1-ajit.khaparde@broadcom.com> References: <1586962156-11179-1-git-send-email-venkatkumar.duvvuru@broadcom.com> <20200417161920.85858-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 06/12] net/bnxt: aggregate ulp mapper create arguments 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Mike Baucom 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 Reviewed-by: Ajit Khaparde Signed-off-by: Mike Baucom Signed-off-by: Venkat Duvvuru --- 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)