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 091F8A0563; Wed, 15 Apr 2020 16:51:34 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 862641D91B; Wed, 15 Apr 2020 16:50:42 +0200 (CEST) Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by dpdk.org (Postfix) with ESMTP id 72B121D90F for ; Wed, 15 Apr 2020 16:50:39 +0200 (CEST) Received: by mail-pf1-f196.google.com with SMTP id r20so47301pfh.9 for ; Wed, 15 Apr 2020 07:50:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4uJQCodnE48Cx40hTtzws59/2lCEq8iveyGenkIww8E=; b=CbeEv1cWNyjvPWLxGpSLxvw7V/zVbsY/e6LPgy7pCQiOV5Dmy3Mcaufa7uoAGh2vEF goJ1hR+4Ir1RsErIoAWHntNB+pirTTTqoHfZ9m7RFa9i02JQqRcS6vUvUPRgN/JKWFkL ejs4C6H8Dxhzdl5yNxlbb2QmC7ya9GfXSkKws= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4uJQCodnE48Cx40hTtzws59/2lCEq8iveyGenkIww8E=; b=Ue7KsAVFuI+XAuIuTOgdTaGyLUxFjAaqCS/M4TTCSQywgXqJmExutD0F9f1fUn4f7m 3AfNOU8UplCe1IL7JJ06TowC74WI8bR3UIkIZv06+Z7vCGOzKHPWHEPG0YKzEN/Xxho9 BEhDc8T3krYerqxHOrm2vAJtU+sKaxWG25sxcoBz1kwpDMSaIYcnC4RX6hWLz501vyIM gtYX/m6iyYsd6r4+JimarbQJfivIfIMJFu+yTFhUKkKgxRtly0djRscw2HVCNK4V/6DR /yotL756P+kw2pLydppH/UKrol/rphd26y+ZmKMR1e8m8TUjH1Ujc7PbT1R99M7fDHBI ympA== X-Gm-Message-State: AGi0PuYk2Gj+O+H+/8MWdjm5iB8kBQhmrweS/1uoz3dh6WxI3xpOmRh1 17uFBTAvqWfCnEFkS1k67IIF2qAtslL8UyGr7X7XEg+Sijmqf/sANYQKg4oXP6ktmXFRFcA6QUd aV8pcYRGigdio6XELibhnqDdAZIlcD2xDVa5xyoIx8BxvIcVtgQArYD/YXzhi4tsEoJN8 X-Google-Smtp-Source: APiQypJDioE17Bnb8kG0xLJtvJ5gr6qKy33bmvf8N+07J0M7wLChEyZljAGuzonDoqifC+Rqmy388g== X-Received: by 2002:a63:48a:: with SMTP id 132mr27366111pge.380.1586962237961; Wed, 15 Apr 2020 07:50:37 -0700 (PDT) Received: from S60.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 11sm13767969pfz.91.2020.04.15.07.50.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Apr 2020 07:50:37 -0700 (PDT) From: Venkat Duvvuru To: dev@dpdk.org Cc: Mike Baucom , Venkat Duvvuru Date: Wed, 15 Apr 2020 20:19:11 +0530 Message-Id: <1586962156-11179-7-git-send-email-venkatkumar.duvvuru@broadcom.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1586962156-11179-1-git-send-email-venkatkumar.duvvuru@broadcom.com> References: <1586962156-11179-1-git-send-email-venkatkumar.duvvuru@broadcom.com> Subject: [dpdk-dev] [PATCH 06/11] net/bnxt: aggregated ulp mapper create arguments to single structure 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 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 026f33f..9326401 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 84d5ac6..dd44938 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 5f3d46e..24727a3 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.7.4