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 70425A0548; Mon, 20 Sep 2021 09:43:10 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8584B41100; Mon, 20 Sep 2021 09:42:46 +0200 (CEST) Received: from relay.smtp-ext.broadcom.com (lpdvsmtp11.broadcom.com [192.19.166.231]) by mails.dpdk.org (Postfix) with ESMTP id 200CF41100 for ; Mon, 20 Sep 2021 09:42:36 +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 641B8E5; Mon, 20 Sep 2021 00:42:34 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com 641B8E5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1632123755; bh=HIRuG0l9Cy7SmrMbieKSOyX6115iD7UgU/NAWjGqteE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uto1FG3oQH/emSKGmSd2tNAUqjCm1HI0TwEYPaeHBHfmUisYZ4juOjjIJoK5EGWOd 4Z4Bztw6gEYG0YcxJcj/wV0CXzdQzSf8emlAYeZ8k2EfmY6mwS2mCOnNsdGyfHX9ms DdoRzUpblBt7zuSiqflpeTSdy8DFug7GPYqi0e/s= From: Venkat Duvvuru To: dev@dpdk.org Cc: Kishore Padmanabha , Venkat Duvvuru Date: Mon, 20 Sep 2021 13:12:09 +0530 Message-Id: <20210920074214.23747-9-venkatkumar.duvvuru@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210920074214.23747-1-venkatkumar.duvvuru@broadcom.com> References: <20210908050643.9989-1-venkatkumar.duvvuru@broadcom.com> <20210920074214.23747-1-venkatkumar.duvvuru@broadcom.com> Subject: [dpdk-dev] [PATCH v4 08/13] 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: Mike 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