DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
To: dev@dpdk.org
Cc: Mike Baucom <michael.baucom@broadcom.com>,
	Kishore Padmanabha <kishore.padmanabha@broadcom.com>,
	Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Subject: [dpdk-dev] [PATCH v2 04/12] net/bnxt: add resource name type to debug messages
Date: Fri, 17 Apr 2020 09:19:12 -0700	[thread overview]
Message-ID: <20200417161920.85858-5-ajit.khaparde@broadcom.com> (raw)
In-Reply-To: <20200417161920.85858-1-ajit.khaparde@broadcom.com>

From: Mike Baucom <michael.baucom@broadcom.com>

Added the name of the resource to the index/result and key/mask common
builder functions.

Reviewed-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Mike Baucom <michael.baucom@broadcom.com>
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
---
 drivers/net/bnxt/tf_ulp/ulp_mapper.c | 61 ++++++++++++++++------------
 1 file changed, 34 insertions(+), 27 deletions(-)

diff --git a/drivers/net/bnxt/tf_ulp/ulp_mapper.c b/drivers/net/bnxt/tf_ulp/ulp_mapper.c
index ca4dd4562..f787c6e4d 100644
--- a/drivers/net/bnxt/tf_ulp/ulp_mapper.c
+++ b/drivers/net/bnxt/tf_ulp/ulp_mapper.c
@@ -365,7 +365,8 @@ ulp_mapper_ident_process(struct bnxt_ulp_mapper_parms *parms,
 static int32_t
 ulp_mapper_result_field_process(struct bnxt_ulp_mapper_parms *parms,
 				struct bnxt_ulp_mapper_result_field_info *fld,
-				struct ulp_blob *blob)
+				struct ulp_blob *blob,
+				const char *name)
 {
 	uint16_t idx, size_idx;
 	uint8_t	 *val = NULL;
@@ -376,20 +377,20 @@ ulp_mapper_result_field_process(struct bnxt_ulp_mapper_parms *parms,
 	case BNXT_ULP_RESULT_OPC_SET_TO_CONSTANT:
 		val = fld->result_operand;
 		if (!ulp_blob_push(blob, val, fld->field_bit_size)) {
-			BNXT_TF_DBG(ERR, "Failed to add field\n");
+			BNXT_TF_DBG(ERR, "%s failed to add field\n", name);
 			return -EINVAL;
 		}
 		break;
 	case BNXT_ULP_RESULT_OPC_SET_TO_ACT_PROP:
 		if (!ulp_operand_read(fld->result_operand,
 				      (uint8_t *)&idx, sizeof(uint16_t))) {
-			BNXT_TF_DBG(ERR, "operand read failed\n");
+			BNXT_TF_DBG(ERR, "%s operand read failed\n", name);
 			return -EINVAL;
 		}
 		idx = tfp_be_to_cpu_16(idx);
 
 		if (idx >= BNXT_ULP_ACT_PROP_IDX_LAST) {
-			BNXT_TF_DBG(ERR, "act_prop[%d] oob\n", idx);
+			BNXT_TF_DBG(ERR, "%s act_prop[%d] oob\n", name, idx);
 			return -EINVAL;
 		}
 		val = &parms->act_prop->act_details[idx];
@@ -400,20 +401,20 @@ ulp_mapper_result_field_process(struct bnxt_ulp_mapper_parms *parms,
 			val += field_size;
 		}
 		if (!ulp_blob_push(blob, val, fld->field_bit_size)) {
-			BNXT_TF_DBG(ERR, "push field failed\n");
+			BNXT_TF_DBG(ERR, "%s push field failed\n", name);
 			return -EINVAL;
 		}
 		break;
 	case BNXT_ULP_RESULT_OPC_SET_TO_ACT_PROP_SZ:
 		if (!ulp_operand_read(fld->result_operand,
 				      (uint8_t *)&idx, sizeof(uint16_t))) {
-			BNXT_TF_DBG(ERR, "operand read failed\n");
+			BNXT_TF_DBG(ERR, "%s operand read failed\n", name);
 			return -EINVAL;
 		}
 		idx = tfp_be_to_cpu_16(idx);
 
 		if (idx >= BNXT_ULP_ACT_PROP_IDX_LAST) {
-			BNXT_TF_DBG(ERR, "act_prop[%d] oob\n", idx);
+			BNXT_TF_DBG(ERR, "%s act_prop[%d] oob\n", name, idx);
 			return -EINVAL;
 		}
 		val = &parms->act_prop->act_details[idx];
@@ -421,7 +422,7 @@ ulp_mapper_result_field_process(struct bnxt_ulp_mapper_parms *parms,
 		/* get the size index next */
 		if (!ulp_operand_read(&fld->result_operand[sizeof(uint16_t)],
 				      (uint8_t *)&size_idx, sizeof(uint16_t))) {
-			BNXT_TF_DBG(ERR, "operand read failed\n");
+			BNXT_TF_DBG(ERR, "%s operand read failed\n", name);
 			return -EINVAL;
 		}
 		size_idx = tfp_be_to_cpu_16(size_idx);
@@ -439,20 +440,21 @@ ulp_mapper_result_field_process(struct bnxt_ulp_mapper_parms *parms,
 	case BNXT_ULP_RESULT_OPC_SET_TO_REGFILE:
 		if (!ulp_operand_read(fld->result_operand,
 				      (uint8_t *)&idx, sizeof(uint16_t))) {
-			BNXT_TF_DBG(ERR, "operand read failed\n");
+			BNXT_TF_DBG(ERR, "%s operand read failed\n", name);
 			return -EINVAL;
 		}
 
 		idx = tfp_be_to_cpu_16(idx);
 		/* Uninitialized regfile entries return 0 */
 		if (!ulp_regfile_read(parms->regfile, idx, &regval)) {
-			BNXT_TF_DBG(ERR, "regfile[%d] read oob\n", idx);
+			BNXT_TF_DBG(ERR, "%s regfile[%d] read oob\n",
+				    name, idx);
 			return -EINVAL;
 		}
 
 		val = ulp_blob_push_64(blob, &regval, fld->field_bit_size);
 		if (!val) {
-			BNXT_TF_DBG(ERR, "push field failed\n");
+			BNXT_TF_DBG(ERR, "%s push field failed\n", name);
 			return -EINVAL;
 		}
 		break;
@@ -468,7 +470,8 @@ static int32_t
 ulp_mapper_keymask_field_process(struct bnxt_ulp_mapper_parms *parms,
 				 struct bnxt_ulp_mapper_class_key_field_info *f,
 				 struct ulp_blob *blob,
-				 uint8_t is_key)
+				 uint8_t is_key,
+				 const char *name)
 {
 	uint64_t regval;
 	uint16_t idx, bitlen;
@@ -493,13 +496,13 @@ ulp_mapper_keymask_field_process(struct bnxt_ulp_mapper_parms *parms,
 	case BNXT_ULP_SPEC_OPC_SET_TO_CONSTANT:
 		val = operand;
 		if (!ulp_blob_push(blob, val, bitlen)) {
-			BNXT_TF_DBG(ERR, "push to key blob failed\n");
+			BNXT_TF_DBG(ERR, "%s push to key blob failed\n", name);
 			return -EINVAL;
 		}
 		break;
 	case BNXT_ULP_SPEC_OPC_ADD_PAD:
 		if (!ulp_blob_pad_push(blob, bitlen)) {
-			BNXT_TF_DBG(ERR, "Pad too large for blob\n");
+			BNXT_TF_DBG(ERR, "%s pad too large for blob\n", name);
 			return -EINVAL;
 		}
 
@@ -507,7 +510,7 @@ ulp_mapper_keymask_field_process(struct bnxt_ulp_mapper_parms *parms,
 	case BNXT_ULP_SPEC_OPC_SET_TO_HDR_FIELD:
 		if (!ulp_operand_read(operand, (uint8_t *)&idx,
 				      sizeof(uint16_t))) {
-			BNXT_TF_DBG(ERR, "key operand read failed.\n");
+			BNXT_TF_DBG(ERR, "%s key operand read failed.\n", name);
 			return -EINVAL;
 		}
 		idx = tfp_be_to_cpu_16(idx);
@@ -527,27 +530,27 @@ ulp_mapper_keymask_field_process(struct bnxt_ulp_mapper_parms *parms,
 		}
 
 		if (!ulp_blob_push(blob, val, bitlen)) {
-			BNXT_TF_DBG(ERR, "push to key blob failed\n");
+			BNXT_TF_DBG(ERR, "%s push to key blob failed\n", name);
 			return -EINVAL;
 		}
 		break;
 	case BNXT_ULP_SPEC_OPC_SET_TO_REGFILE:
 		if (!ulp_operand_read(operand, (uint8_t *)&idx,
 				      sizeof(uint16_t))) {
-			BNXT_TF_DBG(ERR, "key operand read failed.\n");
+			BNXT_TF_DBG(ERR, "%s key operand read failed.\n", name);
 			return -EINVAL;
 		}
 		idx = tfp_be_to_cpu_16(idx);
 
 		if (!ulp_regfile_read(regfile, idx, &regval)) {
-			BNXT_TF_DBG(ERR, "regfile[%d] read failed.\n",
-				    idx);
+			BNXT_TF_DBG(ERR, "%s regfile[%d] read failed.\n",
+				    name, idx);
 			return -EINVAL;
 		}
 
 		val = ulp_blob_push_64(blob, &regval, bitlen);
 		if (!val) {
-			BNXT_TF_DBG(ERR, "push to key blob failed\n");
+			BNXT_TF_DBG(ERR, "%s push to key blob failed\n", name);
 			return -EINVAL;
 		}
 	default:
@@ -715,7 +718,8 @@ ulp_mapper_action_info_process(struct bnxt_ulp_mapper_parms *parms,
 		fld = &flds[i];
 		rc = ulp_mapper_result_field_process(parms,
 						     fld,
-						     &blob);
+						     &blob,
+						     "Action");
 		if (rc) {
 			BNXT_TF_DBG(ERR, "Action field failed\n");
 			return rc;
@@ -777,7 +781,7 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 	for (i = 0; i < num_kflds; i++) {
 		/* Setup the key */
 		rc = ulp_mapper_keymask_field_process(parms, &kflds[i],
-						      &key, 1);
+						      &key, 1, "TCAM Key");
 		if (rc) {
 			BNXT_TF_DBG(ERR, "Key field set failed.\n");
 			return rc;
@@ -785,7 +789,7 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 
 		/* Setup the mask */
 		rc = ulp_mapper_keymask_field_process(parms, &kflds[i],
-						      &mask, 0);
+						      &mask, 0, "TCAM Mask");
 		if (rc) {
 			BNXT_TF_DBG(ERR, "Mask field set failed.\n");
 			return rc;
@@ -852,7 +856,8 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 		for (i = 0; i < num_dflds; i++) {
 			rc = ulp_mapper_result_field_process(parms,
 							     &dflds[i],
-							     &data);
+							     &data,
+							     "TCAM Result");
 			if (rc) {
 				BNXT_TF_DBG(ERR, "Failed to set data fields\n");
 				goto error;
@@ -955,7 +960,7 @@ ulp_mapper_em_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 	for (i = 0; i < num_kflds; i++) {
 		/* Setup the key */
 		rc = ulp_mapper_keymask_field_process(parms, &kflds[i],
-						      &key, 1);
+						      &key, 1, "EM Key");
 		if (rc) {
 			BNXT_TF_DBG(ERR, "Key field set failed.\n");
 			return rc;
@@ -981,7 +986,8 @@ ulp_mapper_em_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 
 		rc = ulp_mapper_result_field_process(parms,
 						     fld,
-						     &data);
+						     &data,
+						     "EM Result");
 		if (rc) {
 			BNXT_TF_DBG(ERR, "Failed to set data fields.\n");
 			return rc;
@@ -1130,7 +1136,8 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 	for (i = 0; i < num_flds; i++) {
 		rc = ulp_mapper_result_field_process(parms,
 						     &flds[i],
-						     &data);
+						     &data,
+						     "Indexed Result");
 		if (rc) {
 			BNXT_TF_DBG(ERR, "data field failed\n");
 			return rc;
-- 
2.21.1 (Apple Git-122.3)


  parent reply	other threads:[~2020-04-17 16:20 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-15 14:49 [dpdk-dev] [PATCH 00/11] enhancements to host based flow table management Venkat Duvvuru
2020-04-15 14:49 ` [dpdk-dev] [PATCH 01/11] net/bnxt: SVIF changes for dpdk port id Venkat Duvvuru
2020-04-15 14:49 ` [dpdk-dev] [PATCH 02/11] net/bnxt: allow usage of more resources in flow db Venkat Duvvuru
2020-04-15 14:49 ` [dpdk-dev] [PATCH 03/11] net/bnxt: Added flow database resource iteration API Venkat Duvvuru
2020-04-15 14:49 ` [dpdk-dev] [PATCH 04/11] net/bnxt: added type of resource name to debug messages Venkat Duvvuru
2020-04-15 14:49 ` [dpdk-dev] [PATCH 05/11] net/bnxt: aggregated ulp rte parser arguments to single structure Venkat Duvvuru
2020-04-15 14:49 ` [dpdk-dev] [PATCH 06/11] net/bnxt: aggregated ulp mapper create " Venkat Duvvuru
2020-04-15 14:49 ` [dpdk-dev] [PATCH 07/11] net/bnxt: use hashing for flow template matching Venkat Duvvuru
2020-04-15 14:49 ` [dpdk-dev] [PATCH 08/11] net/bnxt: addition of session and function flow flush Venkat Duvvuru
2020-04-15 14:49 ` [dpdk-dev] [PATCH 09/11] net/bnxt: default identifiers added to ulp mapper Venkat Duvvuru
2020-04-15 14:49 ` [dpdk-dev] [PATCH 10/11] net/bnxt: cache table type added for tcam lookups Venkat Duvvuru
2020-04-15 14:49 ` [dpdk-dev] [PATCH 11/11] net/bnxt: addition of the port database Venkat Duvvuru
2020-04-17 16:19 ` [dpdk-dev] [PATCH v2 00/12] enhancements to host based flow table management Ajit Khaparde
2020-04-17 16:19   ` [dpdk-dev] [PATCH v2 01/12] net/bnxt: add SVIF changes for dpdk port id Ajit Khaparde
2020-04-17 16:19   ` [dpdk-dev] [PATCH v2 02/12] net/bnxt: allow usage of more resources in flow db Ajit Khaparde
2020-04-17 16:19   ` [dpdk-dev] [PATCH v2 03/12] net/bnxt: add flow database resource iteration API Ajit Khaparde
2020-04-17 16:19   ` Ajit Khaparde [this message]
2020-04-17 16:19   ` [dpdk-dev] [PATCH v2 05/12] net/bnxt: aggregate ulp rte parser arguments Ajit Khaparde
2020-04-17 16:19   ` [dpdk-dev] [PATCH v2 06/12] net/bnxt: aggregate ulp mapper create arguments Ajit Khaparde
2020-04-17 16:19   ` [dpdk-dev] [PATCH v2 07/12] net/bnxt: use hashing for flow template match Ajit Khaparde
2020-04-17 16:19   ` [dpdk-dev] [PATCH v2 08/12] net/bnxt: add session and function flow flush Ajit Khaparde
2020-04-17 16:19   ` [dpdk-dev] [PATCH v2 09/12] net/bnxt: add default identifiers to ulp mapper Ajit Khaparde
2020-04-17 16:19   ` [dpdk-dev] [PATCH v2 10/12] net/bnxt: add cache table type for TCAM lookup Ajit Khaparde
2020-04-17 16:19   ` [dpdk-dev] [PATCH v2 11/12] net/bnxt: add port database Ajit Khaparde
2020-04-17 16:19   ` [dpdk-dev] [PATCH v2 12/12] net/bnxt: remove redefinition of page size Ajit Khaparde
2020-04-17 21:00   ` [dpdk-dev] [PATCH v2 00/12] enhancements to host based flow table management Ajit Khaparde

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=20200417161920.85858-5-ajit.khaparde@broadcom.com \
    --to=ajit.khaparde@broadcom.com \
    --cc=dev@dpdk.org \
    --cc=kishore.padmanabha@broadcom.com \
    --cc=michael.baucom@broadcom.com \
    --cc=venkatkumar.duvvuru@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).