net/bnxt: support EM with FKB
[dpdk.git] / drivers / net / bnxt / tf_core / tf_rm.c
index 887a3dc..19de6e4 100644 (file)
@@ -6,6 +6,7 @@
 #include <string.h>
 
 #include <rte_common.h>
+#include <rte_debug.h>
 
 #include <cfa_resource_types.h>
 
@@ -414,6 +415,7 @@ tf_rm_create_db(struct tf *tfp,
 
        /* Get Firmware Capabilities */
        rc = tf_msg_session_resc_qcaps(tfp,
+                                      dev,
                                       parms->dir,
                                       max_types,
                                       query,
@@ -484,20 +486,27 @@ tf_rm_create_db(struct tf *tfp,
                                req[j].max = parms->alloc_cnt[i];
                                j++;
                        } else {
+                               const char *type_str;
+                               uint16_t hcapi_type = parms->cfg[i].hcapi_type;
+
+                               dev->ops->tf_dev_get_resource_str(tfp,
+                                                                 hcapi_type,
+                                                                 &type_str);
                                TFP_DRV_LOG(ERR,
-                                           "%s: Resource failure, type:%d\n",
-                                           tf_dir_2_str(parms->dir),
-                                           parms->cfg[i].hcapi_type);
+                                       "%s: Resource failure, type:%d:%s\n",
+                                       tf_dir_2_str(parms->dir),
+                                       hcapi_type, type_str);
                                TFP_DRV_LOG(ERR,
                                        "req:%d, avail:%d\n",
                                        parms->alloc_cnt[i],
-                                       query[parms->cfg[i].hcapi_type].max);
+                                       query[hcapi_type].max);
                                return -EINVAL;
                        }
                }
        }
 
        rc = tf_msg_session_resc_alloc(tfp,
+                                      dev,
                                       parms->dir,
                                       hcapi_items,
                                       req,
@@ -596,13 +605,6 @@ tf_rm_create_db(struct tf *tfp,
        rm_db->type = parms->type;
        *parms->rm_db = (void *)rm_db;
 
-#if (TF_RM_DEBUG == 1)
-       printf("%s: type:%d num_entries:%d\n",
-              tf_dir_2_str(parms->dir),
-              parms->type,
-              i);
-#endif /* (TF_RM_DEBUG == 1) */
-
        tfp_free((void *)req);
        tfp_free((void *)resv);