DPDK patches and discussions
 help / color / mirror / Atom feed
From: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
To: dev@dpdk.org
Cc: Kishore Padmanabha <kishore.padmanabha@broadcom.com>,
	Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Subject: [dpdk-dev] [PATCH v4 08/13] net/bnxt: add wild card TCAM byte order for Thor
Date: Mon, 20 Sep 2021 13:12:09 +0530	[thread overview]
Message-ID: <20210920074214.23747-9-venkatkumar.duvvuru@broadcom.com> (raw)
In-Reply-To: <20210920074214.23747-1-venkatkumar.duvvuru@broadcom.com>

From: Kishore Padmanabha <kishore.padmanabha@broadcom.com>

The wild card TCAM for Thor platform is different from the profile TCAM
byte order.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Shuanglin Wang <shuanglin.wang@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 .../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


  parent reply	other threads:[~2021-09-20  7:43 UTC|newest]

Thread overview: 83+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-01 14:24 [dpdk-dev] [PATCH 00/14] enhancements to host based flow table management Venkat Duvvuru
2021-09-01 14:24 ` [dpdk-dev] [PATCH 01/14] net/bnxt: tf core index table updates Venkat Duvvuru
2021-09-01 14:24 ` [dpdk-dev] [PATCH 02/14] net/bnxt: enable dpool allocator Venkat Duvvuru
2021-09-01 14:24 ` [dpdk-dev] [PATCH 03/14] net/bnxt: add flow meter drop counter support Venkat Duvvuru
2021-09-01 14:24 ` [dpdk-dev] [PATCH 04/14] net/bnxt: add Thor SRAM mgr model Venkat Duvvuru
2021-09-01 14:24 ` [dpdk-dev] [PATCH 05/14] net/bnxt: add flow templates support for Thor Venkat Duvvuru
2021-09-01 14:24 ` [dpdk-dev] [PATCH 06/14] net/bnxt: add support for tunnel offloads Venkat Duvvuru
2021-09-01 14:24 ` [dpdk-dev] [PATCH 07/14] net/bnxt: add support for dynamic encap action Venkat Duvvuru
2021-09-01 14:24 ` [dpdk-dev] [PATCH 08/14] net/bnxt: add wild card TCAM byte order for Thor Venkat Duvvuru
2021-09-01 14:24 ` [dpdk-dev] [PATCH 09/14] net/bnxt: add flow templates " Venkat Duvvuru
2021-09-01 14:24 ` [dpdk-dev] [PATCH 10/14] net/bnxt: tf core SRAM Manager Venkat Duvvuru
2021-09-01 14:24 ` [dpdk-dev] [PATCH 11/14] net/bnxt: dynamically allocate space for EM defrag function Venkat Duvvuru
2021-09-01 14:24 ` [dpdk-dev] [PATCH 12/14] net/bnxt: sram manager shared session Venkat Duvvuru
2021-09-01 14:24 ` [dpdk-dev] [PATCH 13/14] net/bnxt: add enhancements to TF ULP Venkat Duvvuru
2021-09-01 14:24 ` [dpdk-dev] [PATCH 14/14] net/bnxt: add support for testpmd co-existence Venkat Duvvuru
2021-09-08  5:06 ` [dpdk-dev] [PATCH v2 00/13] enhancements to host based flow table management Venkat Duvvuru
2021-09-08  5:06   ` [dpdk-dev] [PATCH v2 01/13] net/bnxt: tf core index table updates Venkat Duvvuru
2021-09-08  5:06   ` [dpdk-dev] [PATCH v2 02/13] net/bnxt: enable dpool allocator Venkat Duvvuru
2021-09-08  5:06   ` [dpdk-dev] [PATCH v2 03/13] net/bnxt: add flow meter drop counter support Venkat Duvvuru
2021-09-08  5:06   ` [dpdk-dev] [PATCH v2 04/13] net/bnxt: add Thor SRAM mgr model Venkat Duvvuru
2021-09-08  5:06   ` [dpdk-dev] [PATCH v2 05/13] net/bnxt: add flow templates support for Thor Venkat Duvvuru
2021-09-08  5:06   ` [dpdk-dev] [PATCH v2 06/13] net/bnxt: add support for tunnel offloads Venkat Duvvuru
2021-09-08  5:06   ` [dpdk-dev] [PATCH v2 07/13] net/bnxt: add support for dynamic encap action Venkat Duvvuru
2021-09-08  5:06   ` [dpdk-dev] [PATCH v2 08/13] net/bnxt: add wild card TCAM byte order for Thor Venkat Duvvuru
2021-09-08  5:06   ` [dpdk-dev] [PATCH v2 09/13] net/bnxt: add flow templates " Venkat Duvvuru
2021-09-08  5:06   ` [dpdk-dev] [PATCH v2 10/13] net/bnxt: tf core SRAM Manager Venkat Duvvuru
2021-09-08  5:06   ` [dpdk-dev] [PATCH v2 11/13] net/bnxt: dynamically allocate space for EM defrag function Venkat Duvvuru
2021-09-08  5:06   ` [dpdk-dev] [PATCH v2 12/13] net/bnxt: sram manager shared session Venkat Duvvuru
2021-09-08  5:06   ` [dpdk-dev] [PATCH v2 13/13] net/bnxt: add enhancements to TF ULP Venkat Duvvuru
2021-09-11 15:30   ` [dpdk-dev] [PATCH v3 00/13] enhancements to host based flow table management Venkat Duvvuru
2021-09-11 15:30     ` [dpdk-dev] [PATCH v3 01/13] net/bnxt: tf core index table updates Venkat Duvvuru
2021-09-16 13:47       ` Ferruh Yigit
2021-09-16 15:51         ` Ajit Khaparde
2021-09-11 15:30     ` [dpdk-dev] [PATCH v3 02/13] net/bnxt: enable dpool allocator Venkat Duvvuru
2021-09-11 15:30     ` [dpdk-dev] [PATCH v3 03/13] net/bnxt: add flow meter drop counter support Venkat Duvvuru
2021-09-11 15:30     ` [dpdk-dev] [PATCH v3 04/13] net/bnxt: add Thor SRAM mgr model Venkat Duvvuru
2021-09-16 13:49       ` Ferruh Yigit
2021-09-16 14:01         ` Bruce Richardson
2021-09-16 14:04           ` Thomas Monjalon
2021-09-16 16:29         ` Venkat Duvvuru
2021-09-16 16:30           ` Ferruh Yigit
2021-09-11 15:30     ` [dpdk-dev] [PATCH v3 05/13] net/bnxt: add flow templates support for Thor Venkat Duvvuru
2021-09-11 15:30     ` [dpdk-dev] [PATCH v3 06/13] net/bnxt: add support for tunnel offloads Venkat Duvvuru
2021-09-11 15:30     ` [dpdk-dev] [PATCH v3 07/13] net/bnxt: add support for dynamic encap action Venkat Duvvuru
2021-09-11 15:30     ` [dpdk-dev] [PATCH v3 08/13] net/bnxt: add wild card TCAM byte order for Thor Venkat Duvvuru
2021-09-11 15:30     ` [dpdk-dev] [PATCH v3 09/13] net/bnxt: add flow templates " Venkat Duvvuru
2021-09-11 15:30     ` [dpdk-dev] [PATCH v3 10/13] net/bnxt: tf core SRAM Manager Venkat Duvvuru
2021-09-11 15:30     ` [dpdk-dev] [PATCH v3 11/13] net/bnxt: dynamically allocate space for EM defrag function Venkat Duvvuru
2021-09-16 13:53       ` Ferruh Yigit
2021-09-11 15:30     ` [dpdk-dev] [PATCH v3 12/13] net/bnxt: sram manager shared session Venkat Duvvuru
2021-09-11 15:30     ` [dpdk-dev] [PATCH v3 13/13] net/bnxt: add enhancements to TF ULP Venkat Duvvuru
2021-09-16 14:06       ` Ferruh Yigit
2021-09-16  3:25     ` [dpdk-dev] [PATCH v3 00/13] enhancements to host based flow table management Ajit Khaparde
2021-09-16 13:26     ` Ferruh Yigit
2021-09-16 14:17       ` Brandon Lo
2021-09-16 16:18       ` Ajit Khaparde
2021-09-20  7:42   ` [dpdk-dev] [PATCH v4 " Venkat Duvvuru
2021-09-20  7:42     ` [dpdk-dev] [PATCH v4 01/13] net/bnxt: updates to TF core index table Venkat Duvvuru
2021-09-20  7:42     ` [dpdk-dev] [PATCH v4 02/13] net/bnxt: enable dpool allocator Venkat Duvvuru
2021-09-20  7:42     ` [dpdk-dev] [PATCH v4 03/13] net/bnxt: add flow meter drop counter support Venkat Duvvuru
2021-09-20  7:42     ` [dpdk-dev] [PATCH v4 04/13] net/bnxt: add SRAM manager model Venkat Duvvuru
2021-09-20  7:42     ` [dpdk-dev] [PATCH v4 05/13] net/bnxt: add flow template support for Thor Venkat Duvvuru
2021-09-20  7:42     ` [dpdk-dev] [PATCH v4 06/13] net/bnxt: add support for tunnel offload API Venkat Duvvuru
2021-09-28 12:43       ` Ferruh Yigit
2021-09-28 15:46         ` Thomas Monjalon
2021-09-28 15:57           ` Ferruh Yigit
2021-09-28 21:32         ` Ajit Khaparde
2021-09-29  8:20           ` Thomas Monjalon
2021-09-29  9:44             ` Ferruh Yigit
2021-09-29 16:44               ` Ajit Khaparde
2021-09-20  7:42     ` [dpdk-dev] [PATCH v4 07/13] net/bnxt: add support for dynamic encap action Venkat Duvvuru
2021-09-20  7:42     ` Venkat Duvvuru [this message]
2021-09-20  7:42     ` [dpdk-dev] [PATCH v4 09/13] net/bnxt: add flow templates for Thor Venkat Duvvuru
2021-09-20  7:42     ` [dpdk-dev] [PATCH v4 10/13] net/bnxt: change log level to debug Venkat Duvvuru
2021-09-20  7:42     ` [dpdk-dev] [PATCH v4 11/13] net/bnxt: dynamically allocate space for EM defrag function Venkat Duvvuru
2021-09-20  7:42     ` [dpdk-dev] [PATCH v4 12/13] net/bnxt: add SRAM manager shared session Venkat Duvvuru
2021-09-20  7:42     ` [dpdk-dev] [PATCH v4 13/13] net/bnxt: add enhancements to TF ULP Venkat Duvvuru
2021-09-21  4:50     ` [dpdk-dev] [PATCH v4 00/13] enhancements to host based flow table management Ajit Khaparde
2021-09-22 17:36       ` Ferruh Yigit
2021-09-22 20:21         ` Ajit Khaparde
2021-09-23  7:19           ` Ferruh Yigit
2021-09-25 14:24             ` [dpdk-dev] [PATCH] net/bnxt: remove code to initialize SRAM slice node Ajit Khaparde
2021-09-27 10:25               ` Ferruh Yigit

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=20210920074214.23747-9-venkatkumar.duvvuru@broadcom.com \
    --to=venkatkumar.duvvuru@broadcom.com \
    --cc=dev@dpdk.org \
    --cc=kishore.padmanabha@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).