From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4B9BCA0C45; Wed, 1 Sep 2021 16:25:51 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B37F34118A; Wed, 1 Sep 2021 16:25:01 +0200 (CEST) Received: from relay.smtp-ext.broadcom.com (relay.smtp-ext.broadcom.com [192.19.166.231]) by mails.dpdk.org (Postfix) with ESMTP id 130D54117C for ; Wed, 1 Sep 2021 16:25:00 +0200 (CEST) Received: from S60.dhcp.broadcom.net (unknown [10.123.66.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by relay.smtp-ext.broadcom.com (Postfix) with ESMTPS id 6C96A2E2D4; Wed, 1 Sep 2021 07:24:58 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com 6C96A2E2D4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1630506299; bh=RUtfz3No2GVQTiXGTNdvLYKHoLWkhmaThfkJv+rfvkQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Sckw9iFD0HOD7alYUCIn7OrXzPIJFid70RnuSZ0ZkkJIE1opsGwgfpu2VYp5TxCkX 2WPBg+rG2nkzOvmkGgIK7d0dVoEfQ0TPI9p4O5LbQqRBcS8xQK9PI6Hjyzoex8PEb4 bGc17xjqD786yafi9tUYpBu1CoGnuI5W7pXc2rbI= From: Venkat Duvvuru To: dev@dpdk.org Cc: Kishore Padmanabha , Venkat Duvvuru Date: Wed, 1 Sep 2021 19:54:27 +0530 Message-Id: <20210901142433.8444-9-venkatkumar.duvvuru@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210901142433.8444-1-venkatkumar.duvvuru@broadcom.com> References: <20210901142433.8444-1-venkatkumar.duvvuru@broadcom.com> Subject: [dpdk-dev] [PATCH 08/14] net/bnxt: add wild card TCAM byte order for Thor X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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: Kishore Padmanabha The wild card tcam for Thor platform is different from the profile tcam byte order. Signed-off-by: Kishore Padmanabha Signed-off-by: Venkat Duvvuru Reviewed-by: Shuanglin Wang Reviewed-by: Michael Baucom Reviewed-by: Ajit Khaparde --- .../generic_templates/ulp_template_db_tbl.c | 2 ++ drivers/net/bnxt/tf_ulp/ulp_mapper.c | 25 +++++++++++++------ drivers/net/bnxt/tf_ulp/ulp_template_struct.h | 1 + 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_tbl.c b/drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_tbl.c index b5bce6f4c7..68f1b5fd00 100644 --- a/drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_tbl.c +++ b/drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_tbl.c @@ -201,6 +201,7 @@ struct bnxt_ulp_device_params ulp_device_params[BNXT_ULP_DEVICE_ID_LAST] = { .key_byte_order = BNXT_ULP_BYTE_ORDER_LE, .result_byte_order = BNXT_ULP_BYTE_ORDER_LE, .encap_byte_order = BNXT_ULP_BYTE_ORDER_BE, + .wc_key_byte_order = BNXT_ULP_BYTE_ORDER_BE, .encap_byte_swap = 1, .int_flow_db_num_entries = 16384, .ext_flow_db_num_entries = 32768, @@ -223,6 +224,7 @@ struct bnxt_ulp_device_params ulp_device_params[BNXT_ULP_DEVICE_ID_LAST] = { .key_byte_order = BNXT_ULP_BYTE_ORDER_LE, .result_byte_order = BNXT_ULP_BYTE_ORDER_LE, .encap_byte_order = BNXT_ULP_BYTE_ORDER_BE, + .wc_key_byte_order = BNXT_ULP_BYTE_ORDER_BE, .encap_byte_swap = 1, .int_flow_db_num_entries = 16384, .ext_flow_db_num_entries = 32768, diff --git a/drivers/net/bnxt/tf_ulp/ulp_mapper.c b/drivers/net/bnxt/tf_ulp/ulp_mapper.c index 2687a545f3..bcc089b3e1 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_mapper.c +++ b/drivers/net/bnxt/tf_ulp/ulp_mapper.c @@ -1953,6 +1953,15 @@ static void ulp_mapper_wc_tcam_tbl_post_process(struct ulp_blob *blob) #endif } +static int32_t ulp_mapper_tcam_is_wc_tcam(struct bnxt_ulp_mapper_tbl_info *tbl) +{ + if (tbl->resource_type == TF_TCAM_TBL_TYPE_WC_TCAM || + tbl->resource_type == TF_TCAM_TBL_TYPE_WC_TCAM_HIGH || + tbl->resource_type == TF_TCAM_TBL_TYPE_WC_TCAM_LOW) + return 1; + return 0; +} + static int32_t ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms, struct bnxt_ulp_mapper_tbl_info *tbl) @@ -1972,6 +1981,7 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms, uint32_t hit = 0; uint16_t tmplen = 0; uint16_t idx; + enum bnxt_ulp_byte_order key_byte_order; /* Set the key and mask to the original key and mask. */ key = &okey; @@ -2003,10 +2013,13 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms, return -EINVAL; } - if (!ulp_blob_init(key, tbl->blob_key_bit_size, - dparms->key_byte_order) || - !ulp_blob_init(mask, tbl->blob_key_bit_size, - dparms->key_byte_order) || + if (ulp_mapper_tcam_is_wc_tcam(tbl)) + key_byte_order = dparms->wc_key_byte_order; + else + key_byte_order = dparms->key_byte_order; + + if (!ulp_blob_init(key, tbl->blob_key_bit_size, key_byte_order) || + !ulp_blob_init(mask, tbl->blob_key_bit_size, key_byte_order) || !ulp_blob_init(&data, tbl->result_bit_size, dparms->result_byte_order) || !ulp_blob_init(&update_data, tbl->result_bit_size, @@ -2043,9 +2056,7 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms, } /* For wild card tcam perform the post process to swap the blob */ - if (tbl->resource_type == TF_TCAM_TBL_TYPE_WC_TCAM || - tbl->resource_type == TF_TCAM_TBL_TYPE_WC_TCAM_HIGH || - tbl->resource_type == TF_TCAM_TBL_TYPE_WC_TCAM_LOW) { + if (ulp_mapper_tcam_is_wc_tcam(tbl)) { if (dparms->dynamic_pad_en) { /* Sets up the slices for writing to the WC TCAM */ rc = ulp_mapper_wc_tcam_tbl_dyn_post_process(dparms, diff --git a/drivers/net/bnxt/tf_ulp/ulp_template_struct.h b/drivers/net/bnxt/tf_ulp/ulp_template_struct.h index 904763f27d..e2a4b81cec 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_template_struct.h +++ b/drivers/net/bnxt/tf_ulp/ulp_template_struct.h @@ -212,6 +212,7 @@ struct bnxt_ulp_device_params { enum bnxt_ulp_byte_order key_byte_order; enum bnxt_ulp_byte_order result_byte_order; enum bnxt_ulp_byte_order encap_byte_order; + enum bnxt_ulp_byte_order wc_key_byte_order; uint8_t encap_byte_swap; uint8_t num_phy_ports; uint32_t mark_db_lfid_entries; -- 2.17.1