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 47C29A0563; Wed, 15 Apr 2020 16:51:06 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6FB1F1D903; Wed, 15 Apr 2020 16:50:34 +0200 (CEST) Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) by dpdk.org (Postfix) with ESMTP id A80FD1D909 for ; Wed, 15 Apr 2020 16:50:33 +0200 (CEST) Received: by mail-pf1-f195.google.com with SMTP id r20so47155pfh.9 for ; Wed, 15 Apr 2020 07:50:33 -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=9IHGvWWi1vEiBbpInOgEKAmU/l9nBVNpSKDuIsilt/U=; b=RL0QmMakjaZ0yDhU6pMkFwwcfigN+aUtm47ZEwtDodXd9jZPywaCsxvnaDezLgVSkB 5QAsq0xj+K9exfgj7yuR9uU3hHy6APLSs7Cx9FJCm44RNq7CY0mSXCC6IwbP49XsPkKe +A2Rrym2Mwk5qp1qKvX2iYe25RwFcNu56NuHo= 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=9IHGvWWi1vEiBbpInOgEKAmU/l9nBVNpSKDuIsilt/U=; b=KN3t1tNBXIYT/FYx7yEBVmOmA6NGuBuRJ29GoTyj+GS7RwdcboVCab8D7gjNZM5u2G DimThhVkklu5VmbLOyfZZWPqSYCXOKIJPWVeag95I7BKxvQ1Q2u2dSghxFPm2lmcpY7n LyyKBwmS0rHbajZnrW6kZ2Iq2tD4iMf9lcXFyJ07e/2cDZC6vZzu+O4ax4ahsVqIf+to Tcykx5D1RQ7AZKuAgbs6q2LozkvZwIkhgZkeApaZZ5ob9Lw5bnO0pDH+/okIF1OMDVYt d44VlZ27ZIBZc6z6FRlc09VF0p7loSTVRgr4Pg1CgBNXumIF44htHykkwXA3a76J13j2 6N6Q== X-Gm-Message-State: AGi0Puaa1HsLkKDVWYoHPMS7RN2nQbrQ1ZuA6bTTFKF79/2e4HeslE+b uXXqYN8AGPkzPuiPUs/rcVTwp2EVk4bJq8Dj/MWeUXUtth/129QQ4RE6wApF0iqsUjm5PdRdJfR g24njq7nbcseWR8bpjOVeTATwsoVeVIBBfolI/S2KXWVwDyl0H98Rti9Rtp6fp2yen4vR X-Google-Smtp-Source: APiQypLu1ydAdkjEPg9TdSOp5XGmszIclItUbb7wTXONS7e/sfauy1KpZBP+r+c3+HYqxDrwjhKXBw== X-Received: by 2002:a63:5724:: with SMTP id l36mr23072671pgb.366.1586962232220; Wed, 15 Apr 2020 07:50:32 -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.29 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Apr 2020 07:50:31 -0700 (PDT) From: Venkat Duvvuru To: dev@dpdk.org Cc: Mike Baucom , Venkat Duvvuru Date: Wed, 15 Apr 2020 20:19:09 +0530 Message-Id: <1586962156-11179-5-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 04/11] net/bnxt: added type of resource name to debug messages 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 Added the name of the resource to the index/result and key/mask common builder functions. Reviewed-by: Kishore Padmanabha Signed-off-by: Mike Baucom Signed-off-by: Venkat Duvvuru --- 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 a5fb1a3..84d5ac6 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, ®val)) { - 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, ®val, 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, ®val)) { - 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, ®val, 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.7.4