[05/47] net/bnxt: tf_core: flow scale improvement

Message ID 20240830140049.1715230-6-sriharsha.basavapatna@broadcom.com (mailing list archive)
State Superseded
Delegated to: Ajit Khaparde
Headers
Series TruFlow update for Thor2 |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Sriharsha Basavapatna Aug. 30, 2024, 2 p.m. UTC
From: Kishore Padmanabha <kishore.padmanabha@broadcom.com>

Added logic to add flows to wildcard tcam if flows fail to be added to
exact match table.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Michael Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Shahaji Bhosle <shahaji.bhosle@broadcom.com>
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
---
 drivers/net/bnxt/tf_core/tf_em_hash_internal.c | 4 ++--
 drivers/net/bnxt/tf_core/tf_msg.c              | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
  

Patch

diff --git a/drivers/net/bnxt/tf_core/tf_em_hash_internal.c b/drivers/net/bnxt/tf_core/tf_em_hash_internal.c
index d72ac83295..cb8da0e370 100644
--- a/drivers/net/bnxt/tf_core/tf_em_hash_internal.c
+++ b/drivers/net/bnxt/tf_core/tf_em_hash_internal.c
@@ -65,7 +65,7 @@  tf_em_hash_insert_int_entry(struct tf *tfp,
 		PMD_DRV_LOG(ERR,
 			    "%s, EM entry index allocation failed\n",
 			    tf_dir_2_str(parms->dir));
-		return -1;
+		return -ENOMEM; /* no more space to add entries */
 	}
 
 	if (dev->ops->tf_dev_cfa_key_hash == NULL)
@@ -87,7 +87,7 @@  tf_em_hash_insert_int_entry(struct tf *tfp,
 	if (rc) {
 		/* Free the allocated index before returning */
 		dpool_free(pool, index);
-		return -1;
+		return rc;
 	}
 
 	TF_SET_GFID(gfid,
diff --git a/drivers/net/bnxt/tf_core/tf_msg.c b/drivers/net/bnxt/tf_core/tf_msg.c
index dd5ea1c80e..1ef828a1e9 100644
--- a/drivers/net/bnxt/tf_core/tf_msg.c
+++ b/drivers/net/bnxt/tf_core/tf_msg.c
@@ -925,7 +925,7 @@  tf_msg_hash_insert_em_internal_entry(struct tf *tfp,
 	if (msg_record_size > TF_MSG_EM_INSERT_RECORD_SIZE) {
 		rc = -EINVAL;
 		TFP_DRV_LOG(ERR,
-			    "%s: Record size to large, rc:%s\n",
+			    "%s: Record size too large, rc:%s\n",
 			    tf_dir_2_str(em_parms->dir),
 			    strerror(-rc));
 		return rc;